romanimpreprocess.L1_to_L2.gen_cal_image
Main tools to drive exposure level processing.
Functions
- wcs_from_config
Extracts a WCS from the configuration file.
- initializationstep
Creates and initializes L2 data.
- saturation_check
Flags saturated pixels in a 3D cube.
- subtract_dark_current
Subtracts dark current in a 3D cube.
- repackage_wcs
Packages a WCS so that it can be handed to romanisim.
- calibrateimage
L1->L2 driver.
Attributes
Functions
|
Gets a WCS object from the configuration. |
|
Initialization step. |
|
Flags saturated pixels (in both 3D and 2D arrays). |
|
Subtracts dark current from a linearized image. |
|
Packages a WCS to feed to romanisim. |
|
Main routine to run the specified calibrations from a config file. |
Module Contents
- wcs_from_config(config)[source]
Gets a WCS object from the configuration.
Currently supports FITS headers imported from a simulation.
- Parameters:
config (dict) – Configuration dictionary (usually imported from YAML).
- Returns:
The WCS as a FITS header.
- Return type:
astropy.io.fits.header.Header
- initializationstep(config, caldir, mylog)[source]
Initialization step.
- Parameters:
config (dict) – Configuration dictionary (usually imported from YAML).
caldir (dict) – Locations of calibration files.
mylog (romanimpreprocess.utils.processlog.ProcessLog) – Processing log.
- Returns:
data (np.array) – 3D array, science cube loaded from L1
rdq (np.array) – 3D array, flags (ramp data quality)
pdq (np.array) – 2D array, flags (pixel data quality)
meta (dict) – Other metadata (right now: frame_time and read_pattern)
l1meta (dict) – Metadata stright from the L1 file (copy of ASDF subtree)
amp33 (np.array) – 3D array, reference output loaded from L1
- saturation_check(data, read_pattern, rdq, pdq, caldir, mylog)[source]
Flags saturated pixels (in both 3D and 2D arrays).
Performs a saturation check on the data cube (data) using the calibration files in caldir. Information is appended to mylog. The flags rdq and pdq are updated in place.
This function serves as a wrapper for
flag_saturated_pixels(imported fromstcal).- Parameters:
data (np.array) – 3D raw data cube (uint16, shape ngroup,4096,4096).
read_pattern (list of list of int) – MultiAccum table.
rdq (np.array) – 3D ramp data quality (uint32, shape ngroup,4096,4096).
pdq (np.array) – 2D pixel data quality (uint32, shape 4096,4096).
caldir (dict) – Locations of calibration files.
mylog (romanimpreprocess.utils.processlog.ProcessLog) – Processing log.
- Return type:
None
- subtract_dark_current(data, rdq, pdq, caldir, meta, mylog)[source]
Subtracts dark current from a linearized image.
The data, rdq, and pdq fields are updated in place.
- Parameters:
data (np.array) – 3D data cube (in DN_lin, shape ngroup,4096,4096)
rdq (np.array) – 3D ramp data quality (uint32, shape ngroup,4096,4096)
pdq (np.array) – 2D pixel data quality (uint32, shape 4096,4096)
caldir (dict) – Locations of calibration files.
meta (dict) – Metadata dictionary (from L1 ASDF tree).
mylog (romanimpreprocess.utils.processlog.ProcessLog) – Processing log.
- Returns:
The 2D image of subtracted dark current in DN/s.
- Return type:
np.array
- repackage_wcs(thewcs)[source]
Packages a WCS to feed to romanisim.
Right now supports FITS-standard headers from a simulation. Since this for compatibility in ramp-fitting routines, can use this and overwrite the WCS in the L2 ASDF tree with a full-accuracy gwcs at a later stage.
- Parameters:
thewcs (astropy.io.fits.Header or galsim.CelestialWCS) – Input WCS.
- Returns:
Packaged WCS, 2 layers deep for compatibility with romanisim.
- Return type:
class