This script produces the coefficient arrays 'z0' and 'z1' from a pixel-by-pixel fit of the relationship F = z1 + z0 * log10(Texp). The input is a list of master darks created from raw dark files. The input should cover a wide range of exposure times and can have multiple master dark files with the same exposure time. Master darks with non-standard ND filter settings should be avoided (they will not fit the same relationship as the other frames).
A list with master dark frames (YYYYMMDDTHH_masterdark_mean_TTTT.fits) incl. full path.
Numpy pickle files (one for each arm) with 2D coefficient arrays.
From the base directory (maroonx_reduce) call: PYTHONPATH=${PWD} python reduce/recipes/make_coeffs_masterdarks.py
with the following parameters:
-l FILELIST --filelist FILELIST File with list of input files (incl. full path) of all master darks.
-cb FILE, --coeff_file_blue FILE Name of coefficient file (.npz) for blue arm.
-cr FILE, --coeff_file_red FILE Name of coefficient file (.npz) for red arm.
--overwrite Overwrite existing coefficient files in the output directory. Default: False
-od OUTPUT_DIRECTORY, --output_directory OUTPUT_DIRECTORY Directory for output files. The coefficient files should be in this directory.
Example: '/data10/MaroonX_spectra_reduced/Maroonx_masterframes/202311xx/darks/'.
Should follow end in '/YYYYMMDD/darks/ '
Example 1: PYTHONPATH=${PWD} python reduce/recipes/make_coeffs_from_masterdarks.py -l '/data10/MaroonX_spectra_reduced/Maroonx_masterframes/masterdarks_202311xx_red.lis' -cr 'masterdarks_coeffs_202311xx_red.npz' -od '/data10/MaroonX_spectra_reduced/Maroonx_masterframes/202311xx/darks/' --overwrite
Example call to read in a list of master darks for the red arm from /data10/MaroonX_spectra_reduced/Maroonx_masterframes/masterdarks_202311xx_red.lis and save the coefficients in /data10/MaroonX_spectra_reduced/Maroonx_masterframes/202311xx/darks/masterdarks_coeffs_202311xx_red.npz. Overwrite existing results.
Blue and red master darks from the input list are separated, sorted by exposure time and stacked in a 3D datacube. On a pixel-by-pixel bases the relationship F = z1 + z0 * log10(Texp) is fitted and the results are saved.
A log file and plots should be produced to check for the validity of the log-linear fit, potential outliers and general variability between master darks for identical exposure times to check for flux changes of the etalon over time.