Ray tracing algorithm for echelle spectrographs
moes a ray tracing package written in python that calculates the path of single rays through optical surfaces based on Fermat's principle. It models the optical paths of light rays through an echelle spectrograph from the slit to the detector. It can be used to build the spectrograph's wavelength solution and to characterize the expected instrumental RV systematics arising from changes in spectrograph's environment.
In the most cases the modules that describe the optical elements of the spectrograph are: slit, FN-system (FN stands for F-number, also known as focal ratio), collimator, echelle grating, transfer mirror, cross-dispersion grism, camera and detector.
Python 3.8+ highly recommended!
moes makes use of the following python libraries: numpy, astropy, scipy, simanneal, dynesty, matplotlib
The code is self-contained therefore it is not necessary to install anything. Just download the instrument folder and run the optimization.py script by doing python3 optimization.py.
Each instrument folder has an optimization.py file that contains three functions. The function run_instrument_model() creates a ray tracing model of the instrument based on a list of spectral lines provided by the caracal (https://github.com/caracal-pipeline/caracal) pipeline. The function fit_instrument_model(type) starts an optimization algorithm to fit a ray tracing instrument model to the calibration data. There are two types of optimizers implemented: simulated annealing (type=simulated-annealing) and nested sampling (type=nested-sampling). Once found the best-fit instrumental parameters, one can calculate chromatic aberrations by using the function fit_chromatic_aberrations(). Finally, once one has corrected for chromatic aberrations, it is possible to estimate the amount of optical aberrations using the function fit_optical_aberrations().
We emphasize that these functions work as an example for running the moes package to create a spectrograph model and find its best fit parameters. In each instrument folder there is a data folder that contain the instrumental and aberrations parameters for the example of the basic functions shown above, the time series of the caracal wavelength solutions and the time series of the moes instrumental and aberration parameters that best fit the caracal data.
Using the results from caracal and moes it is possible to compute the temperature zero points (TZP) from the calculation of differential drifts.
Differential drifts are defined by
with
where
where
The time series of the CARMENES VIS differential drifts and TZPs calculated using moes can be found in the data/drifts/ and in the data/tzp/ folders.
Marcelo Tala Pinto
moes v1.0