next up previous 78
Next: B-Stars
Up: Flats
Previous: Image data


Spectral data

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'.

2df.gif

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:

  1. Collapse the flat-field in Y to give a single spectrum. This is the average spectral response of the flat-field lamp combined with that of the detector.
  2. Fit a low order polynomial to this, giving a smooth spectrum. It may be better to fit to the log of the data if large count numbers are involved, but this is not usually critical.
  3. Take each of the cross-sections of constant Y value in the flat-field and divide them by this smoothed spectrum. The result is your corrected flat-field calibration image.
  4. Divide each pixel of your image to be corrected by the corresponding pixel of the flat-field calibration image.

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.

  1. You can actually smooth the spectrum, using `ixsmooth'.
  2. You can do it by hand, using `cfit' to generate a spline fit between points indicated interactively using the cursor, having first displayed the spectrum with `splot'.
  3. A less interactive way of using spline fits would be to use `mcfit', probably with a zero spectrum for a mask, although you could always use `mask' to generate a suitable mask should there be bad regions in the spectrum. (You can generate a zero mask by multiplying the original spectrum by zero, obviously.)

One of these should enable you to get a satisfactory result, although they all require more effort than does the simple `ff'.



next up previous 78
Next: B-Stars
Up: Flats
Previous: Image data

FIGARO A general data reduction system
Starlink User Note 86
Keith Shortridge, Horst Meyerdierks,
Malcolm Currie, Martin Clayton, Jon Lockley,
Anne Charles, Clive Davenhall,
Mark Taylor, Tim Ash, Tim Wilkins, Dave Axon,
John Palmer, Anthony Holloway and
Vito Graffagnino
2004 February 17
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council