lib.Calibration.Qsaturation module
- class lib.Calibration.Qsaturation.saturation(sat_value=4190000.0, TES_number=256)[source]
Bases:
objectMethods
detect_saturation(todarray[, ...])Detect saturated TES in a TOD array.
- detect_saturation(todarray, return_time_indices=False)[source]
Detect saturated TES in a TOD array.
For each TES, computes the fraction of time samples exceeding the saturation threshold (either above +sat_value or below -sat_value). A TES is considered saturated if any of its samples exceed the threshold.
- Parameters:
todarray (ndarray) – Array of shape (TES_number, time_samples) containing TOD data.
return_time_indices (bool, optional) – If True, also return indices of time samples where saturation occurs for each TES.
- Returns:
is_valid (ndarray of bool) – Boolean array (True for valid TES, False for saturated TES).
saturated_indices (ndarray) – Indices of saturated TES.
saturation_fraction (ndarray) – Fraction of saturated samples for each TES.
num_saturated (int) – Number of saturated TES.
saturated_time_indices (dict, optional) – Dictionary mapping TES index to 1D array of time indices where saturation occurs. Returned only if return_time_indices=True.
- Raises:
ValueError – If the first dimension of todarray does not match TES_number.