Figaro expects you to have your spectral data oriented so that the x dimension is the wavelength dimension. If this is not the case, use `irot90' to switch the axes. In theory, Figaro does not care whether wavelength increases or decreases with x value, but in practice routines tend to be tested with data whose wavelength increases with x value, and odd bugs may turn up with `reversed' data. You are recommended to get your data into the more common form, if necessary using `irevx'. Note that, as always in Figaro, `x' means the horizontal axis when data is displayed using `image'.
The main problem with spectral flat-fields is that the flat-field data will usually vary in x, not because of the instrumental response, but simply because of the spectral response of the flat-field lamp. The usual way of dealing with this is to fit this spectral response-obtained by collapsing the flat-field in y-and then multiplying by the fitted value before dividing by the flat-field. Another way to look at this is to consider the result of dividing the flat-field by the fit to the spectral response. The result would be an image which was essentially flat in X, but which is `humped' in Y-since most flat-fields fall off at the edges in Y due to instrumental vignetting. Dividing by this-in a two-dimensional manner-will give you images where the pixel to pixel variations in the detector have been corrected, along with any spatial vignetting of the instrument, but where the overall wavelength response of the instrument is not corrected.
(Of course, if you think your flat-field lamp is flat-which may be true at high dispersion-you can just divide by the raw flat-field and you're taking out the instrumental wavelength response as well. However, the better way to deal with that is with your standard stars.)
The only problem, usually, is deciding on what represents an acceptable fit to the collapsed flat-field. One approach is to fit a polynomial to it. This at least has the advantage of being automatic, and if the result is satisfactory this is probably the best thing to do.
So this recipe is as follows:
The individual Figaro commands to do this might be the following
ICL> extract image=ff ystart=min yend=max spectrum=spres ICL> getglobal yend (y) ICL> icdiv image=spres factor=(y) output=spres ICL> sfit spectrum=spres order=2 output=spfit logs ICL> isxdiv image=ff spectrum=spfit output=ffcal ICL> idiv image=mydata image1=ffcal output=mydataff
which, given a flat-field exposure in `ff', and an image in `mydata', performs a flat-field calibration as described above and puts the result in `mydataff'.
This is a sufficiently common way of proceeding that there is a single Figaro command that performs all of this, without the overheads of running four programs and generating the intermediate files. This is the `ff' command. The command
ICL> ff image=mydata flat=ff order=2 output=mydataff
is functionally equivalent to the above sequence. However, the advantage of splitting up the process is that you can compare `spres' and `spfit' to see how good the polynomial fit to the collapsed data really is. E.g. by
ICL> splot spres reset accept ICL> splot spfit noaxes noerase accept
(You also have the advantage that you can control the limits used when collapsing the flat-field; you do not have to use `min' and `max' as the limits, although that is what `ff' does.)
If the fit is not satisfactory, what can you do instead? Well, the problem is essentially that of generating a smoothed spectrum, and Figaro has a number of ways of doing that.
One of these should enable you to get a satisfactory result, although they all require more effort than does the simple `ff'.
FIGARO A general data reduction system