This recipe is used to reduce an IFU flat-field spectrum. The normalised flat is filed with the calibration system.
The relative positions of the slice spectra on the array are contained in a static look-up table. The flat field frame is used to measure the offset of these positions (they are shifted vertically by different amounts for different grisms). This value is filed with the calibration system for use when reducing subsequent frames.
The separate slice spectra are extracted from the frame and rearranged in a new 2-d frame in the correct order (the order in which they cover the 2-d field of view) and approximately aligned in the spectral axis. This produces a frame that looks more like a long-slit spectrum.
The frame is now treated as a standard long-slit spectrum. The image is collapsed in the y-direction, a black-body spectrum is fitted to this and all rows of the flat field are divided by this spectrum to remove the characteristics of the lamp from the flat-field (this does not have to be done precisely because the same flat-field is used for object frames and flux calibrators, so it cancels out anyway). The image is normalised to have a mean value of 1. The flat field is filed with the calibration system.
ORAC-DR -- integral field spectroscopy data reduction