3 Overview

The routine that is called is ECH_LOAD. This reads and interprets a spectrograph parameter file which defines the list of available spectrographs and their echelles and cameras. The use of ECH_LOAD is in fact optional — if it is not called then only UCLES with its 31 and 79 echelle and its long camera is available.

The next routine that is called is ECH_INIT. This selects the actual instrument / echelle / camera combination that is to be modelled. ECH_INIT allows use of the syntax “instrument/echelle/camera” in response to the prompt for the echelle name. The user response is split up into tokens and then the first token is checked against the list of defined instruments. If it matches one of them, attention switches to the next token. If it doesn’t, the first instrument defined in the spectrograph parameter file is assumed and the same token is regarded as a candidate echelle name. The list of defined echelles for the current instrument is searched in exactly the same way, as is the list of defined cameras. Attention only moves to the next token if a match is found to the current token. If, after all this, any unmatched tokens remain, an error is reported and the first instrument / echelle / camera combination defined in the spectrograph parameter file is assumed.

Once ECH_INIT has been called, any of the other routines can be called. Two of the routines are at a higher level than the rest of them. These are ECH_FORMAT_CENTRE, which determines the spectrograph settings for a given central wavelength and order number, and ECH_WAVECEN, which determines the central wavelength and order number for a given set of spectrograph settings.

One of the best ways to work out how to use the routines is to study and understand examples of their use. The source code for the ECHWIND program is a good place to start and Francisco Diego’s PhD thesis (he is one of the principal designers of UCLES) provides much valuable background information and develops most of the algorithms. A future version of this note will perhaps contain more examples.