daxs.correctors: Measurement Correctors#

Classes to deal with different types of measurement correctors.

exception daxs.correctors.ConcentrationCorrectionError(message: str)[source]#

Bases: Exception

__init__(message: str)[source]#
args#
with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class daxs.correctors.Corrector[source]#

Bases: ABC

Base class for measurement correctors.

abstract apply(scans: Scans) None[source]#

Apply the correction to the scans.

class daxs.correctors.SimpleConcentrationCorrector(scans: Scan | Scans | list[Scan])[source]#

Bases: Corrector

Class to perform simple, length-based, concentration corrections.

__init__(scans: Scan | Scans | list[Scan])[source]#

Initialize the simple concentration corrector.

Parameters:

scans – Scans used for concentration correction.

apply(scans: Scans) None[source]#

Apply the correction to the scans.

class daxs.correctors.DataDrivenConcentrationCorrector(scans: Scan | Scans | list[Scan], data_mappings: dict[str, str])[source]#

Bases: Corrector

Class to perform concentration corrections using data from specified mappings.

__init__(scans: Scan | Scans | list[Scan], data_mappings: dict[str, str])[source]#

Initialize the data-driven concentration corrector.

Parameters:
  • scans – Scans used for concentration correction.

  • data_mappings – Mappings between scan attributes and paths in the raw data.

property conc_corr_points: ndarray[tuple[int, ...], dtype[float64]]#

Array of points used to determine the concentration correction indices.

Returns:

Array of points used for concentration correction.

Raises:

ValueError – If the concentration correction counters do not have the same length.

find_conc_corr_indices(scan: Scan) list[int][source]#

Determine the indices of the concentration correction data for the scan.

Parameters:

scan – Scan for which the concentration correction data need to be found.

Returns:

Indices of the concentration correction data for the points in the scan.

create_conc_corr_scan(indices: list[int]) Scan[source]#

Create a scan with the concentration correction data.

Parameters:

indices – Indices of the concentration correction data to be used.

Returns:

Scan with the concentration correction data at the specified indices.

apply(scans: Scans) None[source]#

Apply the concentration correction using data from the specified paths.

Parameters:

scans – Scans to be corrected.

class daxs.correctors.DeadTimeCorrector[source]#

Bases: Corrector

Class to perform dead time corrections.

abstract apply(scans: Scans) None#

Apply the correction to the scans.