This module handles all functionality related to saturation and persistency effects. Most functions are called during reduction from within collectcells.
-makecat
podi_persistency -makecat (-persistency=dir/) file1.fits file2.fits
Create saturation catalogs for a number of files and write results to the directory given with the -persistency flag.
-masksattrails
podi_persistency -masksattrails input.fits catalog.fits output.fits
Apply the persistency masking to the specified input file, using the saturation table from file catalog.fits and write the resulting file into output.fits. This assumes that the input.fits file is a valid file created with collectcells.
-findclosemjds
podi_persistency -findclosemjds (-persistency=/dir) input.fits
Test-routine to find saturation catalogs within a fixed range of [-1,600] seconds around the MJD of the specified input frame.
-fixpersistency
podi_persistency -fixpersistency (-persistency=/dir) input.fits output.fits
Similar to the -masksettrails functionality, but using all files within a fixed MJD range ([-1,1800] seconds) around the MJD of the input frame. Results are written to output.fits. As above it is assumed that input.fits is a valid frame created with collectcells.
Create a map, for the specified OTA, where are pixels affected by persistency are flagged with the MJD of their last saturation. From this we can then derive the required correction.
The detailed prescription for the amplitude of the correction is still unknown, so for the time being all persistent pixels are simply masked out (set to NaN).
At the present, this function is more complicated than it would need to be, but it is prepared for future improvements that correct and not just mask out the persistency effect.
Parameters : |
|
---|---|
Returns: | corrected data (ndarray) – Returns the data with affected pixels being masked out (set to NaNs) |
Warning
This routine likely does not handle binning correctly.
Create catalogs listing all saturated pixels to enable handling saturation and persistency effects later-on.
The main purpose of this file is to call create_saturation_catalog_ota, possibly wrapped for with mp_create_saturation_table for parallel processing.
Parameters : |
|
---|
Create a saturation table for a given OTA exposure.
Parameters : |
|
---|---|
Returns: |
|
Search the specified directory and create an inventory of available saturation maps. For each file we store the filename and the MJD-OBS header value that we will later use to specify the amount of correct required.
Reads the simple index file with the list of available saturation tables and their MJDs. This speed up processing.
Create a map, for the specified OTA, where are pixels affected by trailing are flagged. These pixels are then set to NaN to hopefully be removed during stacking.
Parameters : |
|
---|---|
Returns: | ndarray with all pixels affected by saturation masked out. |
Warning
This function does not yet handle binned data!
This is a small helper routine for the process of creating the saturation catalogs. It reads filenames from job queue, creates the arrays of pixel coordinates, and posts the results to a return queue. Actually creating the fits tables is then handled by the main process.
Parameters : |
|
---|
Write the catalog back to an index file so we can access it again in the future without having to re-read the MJDs from each file.
This routine filters the list of saturation maps to select only files within the specified delta_mjd window. Intervals are given in second, and both the upper and lower limit are considered to be within the window.
Parameters : |
|
---|---|
Returns: | close_mjd_files (dictionary) – Dictionary containing the filenames of all saturation catalogs with MJD in the search range and their respective MJD times. |