#### 8.1 How to Use the echmenu Parameter Editor

In the worked example echmenu was extensively used. echomop is very flexible; there are a large number of parameters available which can be tuned to suit your data. Parameter values can be supplied on the command line, for example:

This is useful as normally tune_mxskypix will simply take its default value (21) without ever prompting.

Another method for checking and setting parameter values is to use the parameter editor built in to echmenu. If, for example, you want to inspect the parameters for Option 4 Determine dekker/object extent, you type -4 at the main echmenu prompt:

- Option number /’or Y for default=1’/ > -4

A display like this will appear:

Parameters for: Determine dekker/object extent. (ECH_SPATIAL)
A * means the parameter must be set; the displayed value is the default.
Select number of parameter to change:

0. Exit
1. INPTIM          =*’’            9. TUNE_MAXPOLY    = 50
2. PFL_INTERACT    =*TRUE         10. TUNE_MXSKYPIX   = 21
3. PFL_MODE        =*’A’          11. TUNE_OBJABV     = 0
4. SLITIM          =*’’           12. TUNE_OBJBLW     = 0
5. TUNE_DIAGNOSE   = FALSE        13. TUNE_PFLSSAMP   = 301
6. TUNE_DEKABV     = 0            14. TUNE_SKYHILIM   = 0.5
7. TUNE_DEKBLW     = 0            15. TUNE_USE_NXF    = 0.2
8. TUNE_DEKTHR     = 0.8

- Parameter number /1/ >

You can see that each of the task parameters is displayed with the current value, except for parameters marked with a *, for which the default is shown. To change a parameter you type its number (e.g. 10 for tune_mxskypix) and then enter the new value at the prompt.

When you are happy with the values set, enter 0 (zero) to exit the parameter editor.

#### 8.2 Looking at FITS Header Cards: Air Mass

There are several tools available for looking at FITS headers in KAPPA. The simplest is fitslist which displays the complete list of FITS header cards. For example,

% kappa    # Only needed once per session.
... setup messages ...
% fitslist object

will display the FITS header for the example dataset included with this document. This can be used to retrieve information such as the air mass:

% fitslist object | grep -i air
AMEND   =             1.350784 / Airmass at approx. end of exposure
AIRMASS =             1.323036 / Airmass at approx. start of exposure
AMSTART =             1.323036 / Airmass at approx. start of exposure

As you can see, the above example has retrieved three cards matching the string air, the -i option for grep ensures that the search is not case-sensitive.

Having extracted these data from the FITS header, we can now estimate the air mass for the exposure—about 1.337 in the example (that’s the mean of the start and end air masses).

#### 8.3 Looking at FITS Header Cards: Wavelength Coverage

Another use for fitslist might be to track down details of the wavelength range covered by the spectrum. Four invocations of fitslist will get all the information needed:

% kappa    # Only needed once per session.
... setup messages ...
% fitslist object | grep -i wavelength
CENWAVE =                 4499 /Approx. central wavelength (Angstroms)
% fitslist object | grep -i dispersion
DISPERSI=                   33 / Nomimal dispersion (Angstroms/mm)
% fitslist object | grep -i pixel
CCDXPIXE=            24.000000 / Size of unbinned pixels in x (micron)
CCDYPIXE=            24.000000 / Size of unbinned pixels in y (micron)
% fitslist object | grep -i ccd.size
CCDXSIZE=                 1124 / X dimension of digitised CCD frame
CCDYSIZE=                 1124 / Y dimension of digitised CCD frame

In this example, we can ignore the CCDY cards as these refer to the cross-dispersion direction of the image of the spectrum (I’m assuming that this is the example dataset object again here). If you have rotated your data frames then the CCDY cards should be used instead.

Using this simple formula we can determine the approximate wavelength range covered:

$\lambda \lambda =CCDXSIZE×CCDXPIXE×DISPERSI$

Appropriate units should be used, for the example above this comes to a coverage of about 890Å, centred at 4499Å. This information can be useful when trying to identify lines in an arc spectrum, and for constraining the automatic arc-line identifier in echmenu.

If the information you need is not present in the FITS headers you will have to consult the observatory’s instrument manual.

#### 8.4 Looking at FITS Header Cards: CCD Characteristics

Another common use for fitslist is to get the details of the CCD output transfer characteristic and readout noise. Two invocations of fitslist will get all the information needed:

% kappa    # Only needed once per session.
... setup messages ...
% fitslist object | grep -i noise
% fitslist object | grep -i -e gain -e adu
GAIN    =             1.300000 / Electrons/ADU conversion factor

The second grep searches for both ‘gain’ and ‘adu’ at the same time—it so happens that both are present in the record we are after.

If the information you need is not present in the FITS headers you will have to consult the observatory’s CCD manual.

#### 8.5 Problems Finding the Spectrum

The first thing to check if you can’t see the spectrum clearly when running echmenu Option 1, as in Figure 10 (see page 45) is that the image is correctly oriented with the spectrum dispersed from left-to-right.

See §5.2 for details of how to check the orientation. Perhaps the ‘zeroth’ thing to check is that you have chosen the correct image for the parameter tracim.

If you find that echmenu Option 1 does not automatically find the spectrum, and you can’t see it in the displayed plot, the next thing to try is a simple plot of a sum of all the columns of the image. This can be done with a series of figaro commands:

% figaro   # Only needed once per session.
... setup messages ...
% ystract object min max slice
% splot slice soft=xw accept

You should see the spectrum somewhere in this section plot. Inspect the X-axis and redisplay the section, but this time zoom-in on the spectrum (in the example data the spectrum is at about Y=183).

% splot slice xstart=170 xend=200 soft=xw whole=f accept

It should now be possible to decide where the centre of the spectrum is by eye, or using the figaro command icur to measure the display.

Once you have decided where the spectrum is, you can write this into the echomop reduction structure file using figaro creobj and setobj:

% creobj _integer 1 rdf1.more.echelle.order_ypos
% setobj 183 ’rdf1.more.echelle.order_ypos(1)’
% setobj 1 rdf1.more.echelle.no_of_orders

This above assumes the reduction structure file is called rdf1. Notice that you have to mark the fact that one ‘order’ (i.e. spectrum) has been found. Once you have added this information you can proceed to try echmenu Option 2.

#### 8.6 Tracing Strategies

Usually the default value C, ‘centroid’ for trace_mode works reasonably well. Running echmenu Option 3 Clip fitted traces, and performing some small interactive adjustments, results in a good, clean spectrum trace. Sometimes, however, the object spectrum cannot be used for tracing—there may be significant absorption features present, the object frame may be severely contaminated with cosmic-ray defects.

If a flat-field frame is available this can sometimes be used for tracing. Such a frame must have been exposed with the dekker not completely open; we need to be able to find the edges of the dekker on the frame. To trace a flat field, proceed in the normal way, but set trace_mode=e which stands for ‘edges’:

TRACE_MODE - Type of order tracing to use /’C’/ > E

The trace will then be determined as the point mid-way between the edges of the dekker.

Another alternative to tracing the target object spectrum is to trace the spectrum of another target taken in the same instrument configuration. How the spectra taken with an instrument shift from exposure to exposure varies from instrument to instrument. For stable instruments you may find that the spectrum will have the same shape over the whole night; for a less stable instrument the spectra may shift depending on the zenith angle of the telescope. You should be aware of the characteristics for the instrument you are using. When you come to select the object and background channels for the spectrum extraction you may find that you have to position the channels off centre to compensate for a shift between the trace and target spectrum exposures.

#### 8.7 What if the Slit is More Than 21-Pixels Wide?

When modelling a spectrum echomop assumes by default that the longest slit required will be 21 detector-pixels in extent. This is often fine, however, there are many occasions when the models need to be extended over a wider range of pixels in order to get a good background (sky) channel. The number of pixels used is controlled by the parameter tune_mxskypix.

You can use figaro to display a slice across an image of the spectrum, and then estimate the value of tune_mxskypix:

% figaro   # Only needed once per session.
... setup messages ...
% ystract object min max slice
% splot slice soft=xw accept

A good value would be about twice the width of the spectrum at its base (i.e.  where the signal falls off to background level).

See §8.1 for details of how to set parameter values within echmenu.

#### 8.8 Better Flat-Field Models

Using a median filter for the flat-field model, by setting fltfit=median in echmenu is generally fine, however, sometimes this may not give the best result. For example, if the flat-field lamp has some a feature in its spectrum in an area which you want to use (not the best situation in the first place…but) then taking the median over a range of a few pixels (the default is 10 pixels) will not work well if the size of the feature is similar.

There are alternative fitting schemes, the most useful probably being spline. It may be useful to hone the flat-field model interactively, this can be done by setting tune_ffinter=yes. The order of fit can then be adjusted interactively.

#### 8.9 Reviewing the Flat Field

Although you can use the echmenu plotter to inspect the flat-field model for your spectrum, it is not always the easiest, or best, way to find problems. Another way is to output the model to an image file and then use kappa display to inspect that image. Within the echomop package there is a stand-alone task for extracting the ‘flattened’ field ech_genflat.

% echomop  # Only needed once per session.
... setup messages ...
% kappa    # Only needed once per session.
... setup messages ...
% ech_genflat ech_rdctn=rdf1 ech_rducd=flattened
% display ’flattened(,170:200)’ mode=pe accept

The above is, again, suitable for the example data supplied with the on-line version of this document.

#### 8.10 I Can’t Recognise the Arc Spectrum

What do you do if the automatic wavelength calibration in echmenu doesn’t work, and you haven’t been able to recognise any arc features?

The first thing you might try is to check for a reversed arc—one in which the wavelength decreases from left-to-right. echmenu doesn’t check for reversed arcs by default as that increases the processing time required. To try this, set the parameter tune_revchk=true, either on the command line:

or using the echmenu parameter editor to change the parameters for Option 10:

- Option number /’or Y for default=10’/ > -10

The next thing to try is to check the FITS headers to get an idea of the wavelength range covered.

The last item which might be wrong is the lamp type. Make sure you are looking at the right set of reference lines. This is another thing which you can check in FITS headers:

% kappa    # Only needed once per session.
... setup messages ...
% fitslist arc | grep -i lamp
CAGLAMPS= ’CuNe+CuAr         ’ / Cass. A&G box comparison lamps
ISICELL = ’ON                ’ / State of grating-cell clamps

You can see that for the arc image in the example data, a CuNe and/or CuAr line list is needed.

#### 8.11 Flux Calibration

For details of methods of flux calibration, refer to the documentation for FIGARO (SUN/86)[18], Section 4.5.