The background in an un-illuminated frame is very low for exposure times of less than 900s and likely doesn't warrant a dark subtraction. Bias subtraction is taken care of by using the overscan in dispersion direction.
However, most science frames are taken with the simultaneous calibration fiber illuminated with the FP etalon. The extended wings of the etalon reach into one of the science fibers with a few 10 counts and a diffuse background several 10 counts is created as well. The count level is roughly constant as the flux level of the FP etalon is adjusted using a ND filter to result in a constant count level independent of the exposure time to optimize the SNR of the etalon lines. The ND filter wheel setting is thus specific to the exposure time, but the user can overwrite this, resulting in different etalon flux levels for the same exposure time.
To remove these wings and the broad diffuse background, DDDDE frames are taken in daytime to construct a DDDDE master dark. These darks are specific for different exposure times (or ND filter settings) and should be taken close in time (within a day or two) to the science frame as the etalon source brightness can be time variable.
Until Nov 2023, darks were taken during daytime during each run, matching the science exposure times of the previous night, as long as there was sufficient time. For operational reasons and to free up the day time for solar calibrator observations, later runs do no longer include daily darks. Instead a previous set of master darks (which can span an entire run with multiple observations of the same exposure time, if desired) is used to create a base on which darks for any arbitrary exposure time can be produced. It was found that the flux in the etalon lines in darks taken in Nov 2023 did have a slight dependency on exposure time with a clear linear dependance of log(Texp) to flux. The expectation would be that the flux is independent of exposure time, as this is the desired output of the automated ND filter wheel setting in the CCD control GUI. The effect seems to be due to an error in the filter wheel zero point determined in the past.
STEP 1 (This was the only step required until Nov 2023): Create master darks by combining individual dark frames of a sequence using the make_master_darks.py script.
STEP 2 (new since Nov 2023): Read in master darks with a wide range of exposure times (e.g. from a single night or a complete observing run) and create coefficients for a pixel-based linear fit between log(Texp) and flux. This is accomplished by make_coeffs_from_masterdarks.py . Coefficients along with exposure times and ND filter settings are saved in a numpy pickle file.
STEP 3 (new since Nov 2023): Create new 'synthetic' darks for any exposure time (or any combination of exposure time and ND filter) from the coefficients file with make_master_darks_from_coeffs.py script.
Steps 2 and 3 do not take changes in the etalon brightness over time into account. This would best be implemented by creating darks 'on-the-fly' for each science exposure or slightly scale a synthetic master dark to match the flux of the simultaneous calibration fiber of the science file.