At present locating the orders is rather an interactive process (there is a program ECHFIND that does it automatically but it does not yet work very well in all cases and its use is not recommended).
First decide whether you are going to use the continuum source or the object to locate the orders. It is a good idea first to do a YSTRACT and SPLOT of the data to get a feel for the width, intensity and profiles of the orders.
$ YSTRACT CONT x1 x2 S
$ SPLOT S RESET \
Display the image and use ICUR to define a point near the peak of each order that you wish to track and extract. It is not recommended that you track orders that are only partially on the image. It is quite important to choose points close to the peak intensity. Then run SDIST to track the orders and fit polynomials to them. When using the periscopes, ensure that the first and second points selected with ICUR correspond to the two parts of the same order and similarly for the third and fourth points etc. Display an arc frame to clarify associations.
$ IMAGE CONT HIGH=hhhh RESET \
$ ICUR
$ SDIST
(IMage) Image containing distortion spectra [CONT] -
(COLumns) Number of cols to average to get peaks [8] -
(TRace) Trace mode - G(aussian) C(OG) or E(dge) [G] -
(WIdth) Half width of spectra - in pixels [2] - 3
(MAXdeg) Maximum degree polynomial to use [10] -
(DIsplay) Use image display to show fit results? [YES] -
(SOft) Display results on graphics device? [NO] -
Two non-obvious parameters are TRace and WIdth. If the profiles across the orders are roughly Gaussian, as would be the case for a stellar source, specify G(aussian) for TRace. If the profiles fill the slit and are reasonably flat, e.g. for a narrow quartz lamp exposure, use C(OG) (for Center Of Gravity). If there is a noticeable gradient across the profile you can try E(dge). For WIdth, specify an estimate of the FWHM for G(aussian) and an estimate of the half width for C(OG) and E(dge). If anything, underestimate it for G(aussian) and overestimate it for C(OG) and E(dge).
If SOft is .TRUE., be careful not to use the same display for IMAGE and SOFT!
Sky data can confuse SDIST because it gives rise to profiles that don't fit any of the trace modes. If this appears to be a problem, use CLIP (which sets all data values below a given low value to that low value and sets all values above a given high value to that high value) to get rid of the sky data values that are causing the problem. Alternatively, use a quartz lamp with SL MIN for the order tracing.
A couple of programs may be useful if you have moved to an object that is not in the same place on the slit: