daxs.scans
: Scans#
The module provides classes for the representation of scans in measurements.
- class daxs.scans.Scan(x: npt.NDArray[np.float64] | None = None, signal: npt.NDArray[np.float64] | None = None, *, data: dict[Any, Any] | None = None)[source]#
Bases:
object
- __init__(x: npt.NDArray[np.float64] | None = None, signal: npt.NDArray[np.float64] | None = None, *, data: dict[Any, Any] | None = None) None [source]#
Define the base representation of scans in measurements.
An scan can be initialized in two ways:
Direct initialization - by passing the x and signal directly to the constructor, with optional additional data.
Lazy initialization - by creating an empty scan and then setting values through properties, either all at once via the data property or individually x, signal, monitor, etc.
- Parameters:
x – X-axis values (1D array).
signal – Signal values (1D or 2D array). For a 2D array, the components must be stored as rows. A 1D array will be converted to a 2D array.
data – Storage for the raw scan data and metadata.
- property x#
- property y#
- property signal#
- property monitor#
- property indices#
- property data#
- property label: str#
- read_data_at_paths(data_paths: str | list[str]) npt.NDArray[np.float64] [source]#
Read and store the data from the file.
- find_outliers(method: str = 'hampel', **kwargs: Any)[source]#
Find outliers in the signal.
See the docstring in the
daxs.filters
.
- remove_outliers(method: str = 'hampel', **kwargs: Any)[source]#
Remove outliers from the signal.
See the docstring of
daxs.scans.Scan.find_outliers()
.
- dead_time_correction(tau: Iterable[float], detection_time: float | npt.NDArray[np.float64] | None = None)[source]#
Perform a dead time correction using a non-paralyzable model.
- Parameters:
tau – The detector dead time in seconds.
detection_time – The time spent on a point of the scan in seconds.
- interpolate(a: ndarray[Any, dtype[float64]])[source]#
Interpolate the signal and possibly the monitor data to the new X-axis values.
- Parameters:
a – Array used to interpolate the signal and monitor.