Wavelength calibration requires the identification of known lines in a spectrum of an arc to determine the transformation between pixel space and wavelength.
HRSModel is a class for producing synthetic HRS spectra. HRSModel is based on the PySpectrograph.Spectrograph class. It includes a simple model for both arms that is based on the instrument confirguration and the spectrograph equation. After adjusting for offsets in the fiber position relative to the CCD, the model can return an approximation for the transformation that is accurate to within a few pixels.
The residuals between the model and the actual solution though are well described by a quadratic equation. This quadratic does slowly vary accross the orders and is different between the two arms. Due to the change in the fiber position between the different resolutions, this quadratic can change between the different configurations as well.
For these reasons, the initial guess for the wavelength solution is based on HRSModel plus a quadratic correction. The correction can either be calculated manual or by automatically fitting a single row of an order.
To calibrate a single order, the following steps are carried out:
All of these steps are carried out by wavelength_calibrate_order. In the end, this task returns an HRSOrder object with wavelengths correspond to every pixel where a good solution was found. In addition, it also returns the x-position, wavelength, and solution for the initial row.
For full automated calibration of an arc, wavelength_calibrate_arc can be used. In this task, it applies wavelength_calibrate_order to each of the orders in the frame. It uses pyhrs.HRSModel for the first guess but takes the quadratic correction from the solution of the nearest order. It starts with the initial order and the first row is also set by the user.