hispecdrp.primitives.detector_flat.detflat_primitive
Functions
|
|
|
Correct the detector level flat field. |
Classes
|
Apply detector flat-field correction to the input data. |
- class DetectorFlatCorrectionPrimitive(dataset=None, config=None, context=None, log_config=None, parent=None, **kwargs)[source]
Bases:
BasePrimitiveApply detector flat-field correction to the input data.
This primitive corrects for pixel-to-pixel variations in detector response by dividing the input rate map by the appropriate master detector flat calibration. Uncertainties are propagated by combining the input errors with the detector flat errors in quadrature using the appropriate scaling. Data quality (DQ) flags from the flat calibration are merged into the output using a bitwise OR.
- Parameters:
dataset (str or L0Model) – Input file path or data model to process. This is expected to be a level 0 (rate map) data product.
suffix (str or None, optional) – Suffix to append to the output filename. Default is
'detflatcorr'.max_cores (int, optional) – Maximum number of CPU cores to use for parallel processing. Default is 1.
- Calibrations:
detflat (DetectorFlatModel) –
selector:
DetectorFlatSelector
- Returns:
output (DataModel) – Flat-field-corrected data model with updated error and data quality arrays.
- detector_flat_correction(input_rate, input_err, input_dq, detflat, detflat_err, detflat_dq, max_cores=1)[source]
Correct the detector level flat field.
- Parameters:
input_rate (ndarray) – The input rate image to be corrected.
input_err (ndarray) – The error associated with the input rate image.
input_dq (ndarray) – The data quality array associated with the input rate image.
detflat (ndarray) – The detector flat field image.
detflat_err (ndarray) – The error associated with the detector flat field image.
detflat_dq (ndarray) – The data quality array associated with the detector flat field image.
max_cores (int) – The number of CPU cores to use for processing.
- Returns:
input_rate (ndarray) – Input rate image (DN/s) with flat-field correction applied.
input_err (ndarray) – Input error image (DN/s) with flat-field correction applied.
input_dq (ndarray) – Input data quality image with flat-field correction applied.