kai.reduce.calib
Attributes
Functions
|
Make dark image for imaging data. Makes a calib/ directory |
|
Make flat field image for imaging data. Makes a calib/ directory |
|
Make bad pixel mask for imaging data. Makes a calib/ directory |
|
Make the static bad pixel mask for the instrument. This only needs to be |
|
Reduce data from the dark_calib script that should be run once |
Module Contents
- kai.reduce.calib.makedark(files, output, raw_dir=None, instrument=instruments.default_inst)[source]
Make dark image for imaging data. Makes a calib/ directory and stores all output there. All output and temporary files will be created in a darks/ subdirectory.
- Parameters:
- fileslist of int
Integer list of the files. Does not require padded zeros.
- outputstr
Output file name. Include the .fits extension.
- raw_dirstr, optional
Directory where raw files are stored. By default, assumes that raw files are stored in ‘../raw’
- instrumentinstruments object, optional
Instrument of data. Default is instruments.default_inst
- kai.reduce.calib.makeflat(onFiles, offFiles, output, dark_frame=None, normalizeFirst=False, raw_dir=None, instrument=instruments.default_inst)[source]
Make flat field image for imaging data. Makes a calib/ directory and stores all output there. All output and temporary files will be created in a flats/ subdirectory.
If only twilight flats were taken (as in 05jullgs), use these flats as the onFiles, and use 0,0 for offFiles. So the reduce.py file should look something like this: onFiles = range(22, 26+1) and offFiles = range(0,0) The flat will then be made by doing a median combine using just the twilight flats.
- Parameters:
- onFileslist of int
Integer list of lamps ON files. Does not require padded zeros.
- offFileslist of int
Integer list of lamps OFF files. Does not require padded zeros.
- outputstr
Output file name. Include the .fits extension.
- dark_framestr, default=None
File name for the dark frame in order to carry out dark correction. If not provided, dark frame is not subtracted and a warning is thrown. Assumes dark file is located under ./calib/darks/
- normalizeFirstbool, default=False
If the individual flats should be normalized first, such as in the case of twilight flats.
- raw_dirstr, optional
Directory where raw files are stored. By default, assumes that raw files are stored in ‘../raw’
- instrumentinstruments object, optional
Instrument of data. Default is instruments.default_inst
- kai.reduce.calib.makemask(dark, flat, output, instrument=instruments.default_inst)[source]
Make bad pixel mask for imaging data. Makes a calib/ directory and stores all output there. All output and temporary files will be created in a masks/ subdirectory.
- Parameters:
- darkstr
The filename of the dark file (must be in the calib/darks/ directory). This is used to construct a hot pixel mask. Use a long (t>20sec) exposure dark.
- flatstr
The filename of a flat file (must be in the calib/flats/ directory). This is used to construct a dead pixel mask. The flat should be normalized.
- outputstr
The output file name. This will be created in the masks/ subdirectory.
- instrumentinstruments object, optional
Instrument of data. Default is instruments.default_inst
- kai.reduce.calib.make_instrument_mask(dark, flat, outDir, instrument=instruments.default_inst)[source]
Make the static bad pixel mask for the instrument. This only needs to be run once. This creates a file called nirc2mask.fits or osiris_img_mask.fits which is subsequently used throughout the pipeline. The dark should be a long integration dark.
- Parameters:
- darkstr
The full absolute path to a medianed dark file. This is used to construct a hot pixel mask (4 sigma detection thresh).
- flatstr
The full absolute path to a medianed flat file. This is used to construct a dead pixel mask.
- outDirstr
full path to output directory with ‘/’ at the end.
- instrumentinstruments object, optional
Instrument of data. Default is instruments.default_inst