The tricky part is to determine the exact shape of the distortion, and in Figaro this is done using the command `sdist'. `sdist' requires an image with one or more spectra in it. The usual thing to do is to take an observation of a flat-field through a multi-hole mask, in which case the resulting image will show one spectrum for each hole in the mask, each distorted into an S. The spectra will be roughly parallel, but the two-dimensional nature of the distortion will mean that they are not exactly so; this is the reason for using multiple spectra: it allows the change in distortion with slit position to be determined. The `cdist' command can then be used to apply the results of the distortion analysis performed by `sdist' in order to correct an image.
The usual sequence of operations is as follows: assume `holes' is a multi-hole calibration image, and `object' is an image to be corrected.
ICL> image holes reset high=xxxx low=xxxx accept
ICL> icur { using space bar to indicate spectra to be used
ICL> sdist image=holes columns=9 width=2 maxdeg=10
ICL> cdist image=holes ystart=min yend=max output=test maxdegy=5
ICL> image test accept
ICL> cdist image=object ystart=min yend=max output=objc maxdegy=5
There are a couple of decisions that have to be made in this sequence. Firstly, there is the question of just how many of the hole spectra should be used. Generally the answer is that all should be used, unless they are going to cause problems-a spectrum that gets too close to the edge of the image will probably not be traced properly, for example. Then there is the use of the `columns' parameter in `sdist' to help control the tracing of the data. In most cases, the main point about the `columns' parameter is that making it larger reduces the number of points to which the polynomials are fitted, and so speeds up the process considerably. However, if the spectra are particularly weak, increasing `columns' will also improve the signal to noise of the cross-section profile of the spectra. (`sdist' sums the data over the specified number of columns, then tries to locate the centre of the resulting profile, assuming that the best starting guess for the centre is the value obtained from the previous fit.)
`sdist' can use a number of different algorithms for tracing the spectra, selected by the `trace' parameter. The original algorithm used by `sdist' is the G(aussian) option, and this is most suitable if the profile of the summed data is roughly Gaussian (as it usually is for stars observed using a slit). If the profile is roughly `top hat' in profile (if a dekker has been used, for example), then either E(dge) or C(enter of gravity) will probably be better. Edge fitting tends to produce rather jumpy fits, particularly if the edges are very sharp and therefore cannot be located to better than a pixel. The centre of gravity fit (which takes the COG of the data within the edges) is usually smoother, but can be inaccurate if the top of the data is not flat. A `ystract' through the data, followed by a `splot' can give a good feel for the data profiles, and the diagnostic display produced by selecting the `softd' option can be very helpful here. The information produced by specifying the `diagnostic' keyword is really for debugging new trace algorithms and is unlikely to be of general use.
In the end, there is no substitute for watching the results on the display. Remember that the polynomial will be unconstrained outside the range where it could trace the spectrum, and this may well show up in the final results from `cdist'. So see if the spectra seem to have been fitted acceptably, and if not, either ignore the bad ones or try to fine tune the fit using the `sdist' parameters. The display that `sdist' can produce on a line graphics device is a useful diagnostic. (In Figaro 3.0 `sdist' could overlay the fit on a previous display done with `image'. Sadly this option is not available in the current version.)
`offdist' may be useful if there is a slight linear offset in Y between the calibration data and the data to be corrected. This is not usually important if the data is to be corrected by `cdist', but other routines such as `maskext' can make use of `sdist' results in a way that makes such offsets (often the result of guiding changes) important. `offdist' adds an offset in Y to the results produced by `sdist'.
The final step, the correction of the object data, is an automatic process. So if a number of images are to be corrected there is a lot to be said for doing this as a batch job.
FIGARO A general data reduction system