In a similar manner, long dark exposures of the same exposure time can be averaged to produce the DARK frames. Please note that the output of AVERAGE/WINDOW is in units of the exposure time which is usually in seconds. Use the command COMPUTE/IMAGE to multiply the images by the exposure time and to add back the value for FLAT_BKG. Long dark exposures, and object and standard star frames contain a huge amount of cosmic events. If multiple exposures exist the above mentioned method can be used to average the frames and to remove the spikes. If not one can obtain good results by applying a median filtering algorithm to the frames (W.K. Pratt, Digital Image Processing, John Wiley & Sons, 1978). The corresponding MIDAS command is:
FILTER/MEDIAN input output 1,1,threshold NAwith the threshold depending on the r.m.s. noise in the exposure. The noise in the (pre-flashed) BIAS and DARK frames can further be decreased by smoothing the images via e.g.
FILTER/SMOOTH input output 10,10After having done all these steps the final (pre-flashed) BIAS and DARK frames can be subtracted using COMPUTE/IMAGE from the FLAT, OBJ and STD frames. Often, BIAS and DARK contain no large - scale structure. Then, it is preferable to substract a constant, thus avoiding extra noise addition.
It is also possible to use several spectra of the same target obtained under the same instrumental configuration. Offsets of the target resulting from the positioning of the target on the entrance slit of the spectrograph and variations of exposure time must be taken into account. The commands AVERAGE/IMAGE and AVERAGE/WEIGHT offer number of options to compare the images and filter particle hits.