next up previous 79
Next: Normalising the Spectrum
Up: A Worked Example
Previous: Looking at the Extracted Spectrum

Wavelength Calibration

There are two stages to echmenu wavelength calibration; the first stage is simple; the second stage may be more complex. The first step is to run Option 9 Locate arc line candidates. This searches the arc spectrum for features which look like arc lines. The result is a small list of potential features which can be used in the second stage, wavelength calibration.

echmenu Option 10 Identify features performs wavelength calibration. There are a number of prompts:

   ECH_FTRDB - Reference line list database /'$ARCDIRS/THAR'/ > $ARCDIRS/CUAR
   ARC_TYPE - Type of arc lamp used /'$ARCDIRS/THAR.ARC'/ > $ARCDIRS/CUAR.ARC
   WAVFIT - Function for wavelength fitting /'POLY'/ >
   AUTO_ID - YES for fully automatic identification /FALSE/ >
   HI_WAVE - Longest wavelength to search for arc lines /0/ >
   LOW_WAVE - Shortest wavelength to search for arc lines /0/ >
   MAX_DISPERSION - Max dispersion (Units per pixel) allowed /1/ >
   MIN_DISPERSION - Min dispersion (Units per pixel) allowed /0.01/ >
   W_NPOLY - Number of coeffs of wavelength fitting function /7/ >

Arc lamp database information for CuAr and ThAr lamps is available, if you use some other lamp you will need a list of wavelengths for features in the spectrum of the lamp. Often a ThAr lamp is used, however, in the example data the lamp used is CuAr, so you can should set ech_ftrdb=$ARCDIRS/CUAR and arc_type=$ARCDIRS/CUAR.ARC. Note that the names of these files are case-sensitive. wavfit is the type of fit to use, poly should be fine.

If you select auto_id=true, echmenu will attempt a fully automatic wavelength calibration. This will often work; however, it is better to inspect the fit manually, rather than just accepting it automatically; so we accept the default auto_id=false.

hi_wave and low_wave are limits on the wavelength range that might be covered by the spectrum; setting the limits both to zero (the default) indicates we have no idea of the wavelength range. However, if you do have a rough idea of either or both limits then enter them here. Constraining the wavelength range speeds up the process of feature identification. The units are Angstroms for the ThAr and CuAr databases.

max_dispersion and min_dispersion are the limits on the dispersion of the spectrum. Again, if you know the dispersion, set these values close to the value to help constrain automatic feature identification. Inspection of FITS headers may reveal the dispersion used in your data, you might otherwise look in the instrument handbook for the spectrograph used. The units here are Angstroms per detector pixel. The default values are set for common échelle spectrographs and so may be too small for your data. If in doubt, set max_dispersion to a large value and leave the default for min_dispersion as it is.

w_npoly is the number of coefficients of fit to use for the wavelength polynomial. The default value of 7 is fine. The fitter will adjust the order automatically the first time a fit is made if the value is unusable.

Figure: Line Identification: a typical plot during interactive fitting with echmenu.
\epsfysize =136mm\epsfbox{sc7_08.eps}
Once you have worked through all the prompts for Option 10 another mini-menu will appear offering a default of I (identify features manually). Accept the default by pressing return and (yet) another menu appears. The graphics display will also update showing the arc spectrum. Each potential feature identified in the arc spectrum will be marked by a short vertical dash above the feature. This will be similar-looking to the figure above, except the features will not yet be labelled with wavelengths.

All these sub-menus may appear confusing, however, you can just accept the default to get to the interactive wavelength calibration. The other options are used when the dataset is multi-spectrum or multi-order. You should now have a menu like this one:

    Option [Info,Del,Set,Thresh,Auto,New,Plot,Re-interp,Worst,BClip,Fit,+-=,

As you can see, there are rather a large number of options. To apply an option, type its first letter with the graphics cursor on the displayed plot. Try an A, which will attempt automatic calibration. You will see some details of the fit displayed and then a plot with the wavelengths of the identified features overlaid. For the example dataset this is all you need to do - you now have a wavelength scale. If the display zooms on to only a small part of the spectrum hit R to get a full-spectrum plot.

At this point you may want to have one of the atlases mentioned earlier to hand to check the identifications manually. You can inspect the line-wavelength lists on-line, for example, the ThAr list by:


The important point in deciding whether the fit is good is the RMS error of the fit. Below is an example of a good fit:

              Line    Wavelength  Calculated Discrepancy    RMS if
                                  Wavelength                omitted

      1     297.366    4561.347    4561.349       0.001     0.00232
      2     451.861    4567.240    4567.238      -0.002     0.00243
    ... other lines ...
      9    1300.145    4598.763    4598.759      -0.004     0.00212
     10    1599.801    4609.567    4609.568       0.001     0.00207

    RMS error: 0.00250.

    Selected degree for fits: 4.
    Number of features identified: 10.

You can see that the RMS error is quite small, also the `RMS if omitted values' are all of similar values. If a mis-identified or badly recorded feature is included, then this will be indicated by a much lower `RMS if omitted' than the other features. To remove such a feature: position the graphics cursor on the feature; hit D to delete the feature from the list of features to be fitted; hit F to apply the new fit.

It is important not to over-fit the feature list. In the above example ten points are fitted with a fourth-order curve; this is fine, seventh-order would be too high as the errors would then be fitted away. The plus and minus (+ and -) keys change the order of fit. Press the E key when you are happy with the fit.

next up previous 79
Next: Normalising the Spectrum
Up: A Worked Example
Previous: Looking at the Extracted Spectrum

Simple Spectroscopy Reductions
Starlink Cookbook 7
Martin Clayton and Anthony Holloway
15 June 1998

Copyright © 2013 Science and Technology Facilities Council