After identifying the arc lines you may now start the actual wavelength calibration with e.g.

Midas
...> `SET/MOS wlcmet=IC`

Midas ...> `CALIBRATE/MOS`

The first character of
gives the way the first lines are identified
(**I**dentify, **L**inear, **F**ors), the second character gives the
mode of fitting (**C**onstant or **V**ariable linelist, **F**it all).
For a detailed description see subsection L.3.3.
This program fits a dispersion relation at first to the row with the identified
lines, then to the slitlet, and afterwards to all slitlets (row by row,
separately for each slitlet).
The fitted line positions are compared to those listed in
.tbl
(**hear**).
The type of polynomials (Legendre or Chebyshev) is read from
(**CHEBYSHEV**), the fit order from
(**1**), and
the tolerance for automatic line identification from
((**2**)).
can be given in pixel (> 0) or wavelength units (< 0).
In case you know the central wavelength and the mean dispersion of the
grism you used and you determined the offsets of the slitlets with
`OFFSET/MOS` you have to correct the central wavelength for the offset
between the center of the CCD and the reference slitlet used by
`OFFSET/MOS`.

**Example:**- Your reference slitlet has an offset of -100 relative to the
center of the CCD in x-direction and you have a mean dispersion of 2Å/pixel
and a central wavelength of 5500Å. This central wavelength will always
lie at the x-position of the respective slitlet, which is in this case
-100pixels (i.e. -200Å) from the center of the CCD. This
means that you have a wavelength of 5700Å at the center of the CCD
within the reference slitlet. This wavelength should be used as
`wcenter`, since the program assumes that`:xoffset = 0`means that the slitlet is at the center of the CCD in x-direction.

Then you can use the following command

Midas
...> `SET/MOS wcenter=central_wavelength `

Midas ...> `SET/MOS avdisp=mean_linear_dispersion`

Midas ...> `SET/MOS wlcmet=LC`

Midas ...> `CALIBRATE/MOS`

which will read the two parameters from
and
.
If you have FORS data use

Midas
...> `SET/MOS wlcmet=RT`

Midas ...> `CALIBRATE/MOS`

This will read the grism number from the header of
and then take
the parameters stored in the respective keyword.
The plot option
(**N**)
decides whether or not you get a plot of the residuals
and the display option
(**0**) influences the amount of intermediate
results displayed on screen.
`CALIBRATE/MOS` stores the results in
.tbl (**coerbr**)
in the columns

:SLIT |
number of slitlet |

:ROW |
row for which dispersion relation was fitted (pixel coordinates) |

:Y |
row for which dispersion relation was fitted (world coordinates) |

:RMS |
r.m.s. error of fit |

:COEF_i |
fit coefficients |

and adds to
.tbl (**linpos**) the columns

:WAVE |
wavelength identification for :X |

:WAVEC |
fitted wavelength for :X |

:RESIDUAL |
:WAVE-:WAVEC |

:REJECT |
mark for rejected lines |

Slitlets where no dispersion relation could be fitted are marked with '-1'
in column `:SLIT`.
With

Midas
...> `RESPLOT/MOS ? slit`

you can also get a plot of the residuals for a certain slit (`slit` =
number) that are stored in
.tbl (**linpos**)
(or in the first parameter given on the command line).