liger_iris_pipeline.datamodels
- class liger_iris_pipeline.datamodels.DQModel(init=None, **kwargs)[source]
Bases:
ReferenceFileModel
A data model for 2D masks for Liger data.
Parameters
- dqnumpy uint32 array
The mask
- dq_defnumpy table
DQ flag definitions
- get_primary_array_name()[source]
Returns the name “primary” array for this model, which controls the size of other arrays that are implicitly created. This is intended to be overridden in the subclasses if the primary array’s name is not “data”.
- class liger_iris_pipeline.datamodels.DarkModel(init=None, schema=None, memmap=False, pass_invalid_values=None, strict_validation=None, validate_on_assignment=None, validate_arrays=False, ignore_missing_extensions=True, **kwargs)[source]
Bases:
ReferenceFileModel
A data model for darks from either the Liger or IRIS Imager or IFU.
- class liger_iris_pipeline.datamodels.FlatModel(init=None, schema=None, memmap=False, pass_invalid_values=None, strict_validation=None, validate_on_assignment=None, validate_arrays=False, ignore_missing_extensions=True, **kwargs)[source]
Bases:
ReferenceFileModel
A data model for flat field images from either the Liger or IRIS Imager or IFU.
- class liger_iris_pipeline.datamodels.IFUCubeModel(init=None, **kwargs)[source]
Bases:
LigerIRISDataModel
A data model for IFU data at the 3D cube stage.
Parameters: wavelength (np.ndarray): The wavelength vector. data (np.ndarray): The science data cube. err (np.ndarray): : The error array cube. dq (np.ndarray): The 3D data quality array cube.
- class liger_iris_pipeline.datamodels.IFUImageModel(init=None, **kwargs)[source]
Bases:
LigerIRISDataModel
A data model for IFU data at the 2D image stage.
Parameters: data (np.ndarray): The science data. err (np.ndarray): : The error array. dq (np.ndarray): The 2D data quality array.
- class liger_iris_pipeline.datamodels.ImagerModel(*args, **kwargs)[source]
Bases:
LigerIRISDataModel
A data model for the typical data product from the Liger or IRIS imager (single detector).
Parameters: data (np.ndarray): The science data array. err (np.ndarray): : The error array. dq (np.ndarray): 2D data quality array.
- class liger_iris_pipeline.datamodels.LigerIRISDataModel(init=None, schema=None, memmap=False, pass_invalid_values=None, strict_validation=None, validate_on_assignment=None, validate_arrays=False, ignore_missing_extensions=True, **kwargs)[source]
Bases:
DataModel
The base data model for Liger and IRIS data products. This class should not be instantiated on its own.
- generate_filename(suffix: str | None = None) str [source]
Generates a filename for this model instance. See LigerIRISDataModel._generate_filename() for details.
- get_crds_parameters()[source]
Collect the parameters used by CRDS to select references for this model.
- Returns:
dict : the CRDS parameters
- get_primary_array_name()[source]
Returns the name “primary” array for this model, which controls the size of other arrays that are implicitly created. This is intended to be overridden in the subclasses if the primary array’s name is not “data”.
- static get_sem_id(jd: float) str [source]
- on_init(init)[source]
Hook invoked by the base class before returning a newly created model instance.
- on_save()[source]
Hook invoked by the base class before writing a model to a file (FITS or ASDF).
- save(filepath: str | None = None, filename: str | None = None, output_dir: str | None = None, suffix: str | None = None, **kwargs) str [source]
Save the model to a file.
- Args:
filepath (str, optional): The filepath to save to. Defaults to self._filepath. filename (str, optional): The filename to save to. Defaults to None. output_dir (str, optional): The directory to save to. Defaults to the directory of self._filepath, then os.getcwd(). suffix (str, optional): The suffix to add to the filename. Defaults to None.
- schema_url = 'https://oirlab.github.io/schemas/LigerIRISDataModel.schema'
The schema URI to validate the model against. If None, only basic validation of required metadata properties (filename, model_type) will occur.
- to_fits(**kwargs)[source]
Write the model to a FITS file using self._filepath as the output_path.
- Args:
kwargs: Additional arguments to pass to the fits.writeto() function.
- class liger_iris_pipeline.datamodels.NonlinearReadoutParametersModel(init=None, schema=None, memmap=False, pass_invalid_values=None, strict_validation=None, validate_on_assignment=None, validate_arrays=False, ignore_missing_extensions=True, **kwargs)[source]
Bases:
ReferenceFileModel
A data model for the detector nonlinear readout polynomial coeffs.
- class liger_iris_pipeline.datamodels.RampModel(init=None, **kwargs)[source]
Bases:
LigerIRISDataModel
A data model for 4D ramps from Liger or IRIS for the IFU or Imager. 4D arrays are formatted as (groups, reads, pixely, pixelx).
Parameters: data (np.ndarray): 4-D array of counts for each read. dq (np.ndarray): 4-D data quality array for each read.
- class liger_iris_pipeline.datamodels.ReferenceFileModel(init=None, schema=None, memmap=False, pass_invalid_values=None, strict_validation=None, validate_on_assignment=None, validate_arrays=False, ignore_missing_extensions=True, **kwargs)[source]
Bases:
LigerIRISDataModel
A base data model for Liger and IRIS calibration reference data.
- generate_filename(suffix: str | None = None)[source]
Generates a filename for this model instance. See LigerIRISDataModel._generate_filename() for details.
- on_init(*args, **kwargs)[source]
Hook invoked by the base class before returning a newly created model instance.
- print_err(message)[source]
- liger_iris_pipeline.datamodels.open(init=None, memmap: bool = False, copy: bool = False, **kwargs)[source]
Creates a DataModel from a number of different types.
- Args:
- init (None | tuple | str | file object | astropy.io.fits.HDUList | numpy.ndarray | dict):
The input used to initialize the model:
None: A default data model with no shape.
tuple: A shape tuple to initialize empty data.
str: A file path to load data from (FITS, JSON, or ASDF).
file object: A readable file object.
astropy.io.fits.HDUList: Initialize from an ~astropy.io.fits.HDUList.
numpy.ndarray: A NumPy array to initialize the data.
dict: An object model tree for the data model.
memmap: (bool) (Turn memmap of file on or off. (default: False).
- kwargs (dict): Additional arguments used to initialize the model.
validate_arrays (bool): If True, arrays will be validated against ndim, max_ndim, and datatype validators in the schemas.
- Returns:
LigerIRISDataModel : The specific LigerIRISDataModel instance.
Modules
Liger and IRIS Data Quality Flags copied from jwst. |
|
This module supports the entry points for ASDF support for the liger_iris_pipeline.datamodels. |
|