We have put some effort into adapting a ray-tracing simulation software from a similar instrument to CRIRES+. The software is dubbed “CRIRES+ Forward Simulator”, CRIFORS in short, and is hosted at https://github.com/ivh/crifors.
Starting from an input source spectrum (included or user-supplied) it does the following:
- Convolve the source spectrum with telluric absorption.
- Cut the spectrum into wavelength ranges that roughly match the orders on individual detectors.
- Convolve with the blaze function of the echelle grating.
- Decide 2D slit-illumination function.
- Randomly sample a number of rays that match the slit illumination and spectrum for each order.
- In case of polarimetry: Randomly distribute rays into one of the two split beams.
- Trace the rays through the optical elements onto the focal plane, depending foremost on the band (i.e. cross-disperser setting) and the echelle angle
- Calculate pixel coordinates for each ray, taking into account the (configurable) gap and orientation of the detectors.
- Add noise.
- Write result as FITS, including headers.
- Visualize result.
Several of these steps are optional and configurable to the user’s needs. For example, the slit can be illuminated fully, with the gaps from the deckers, or with a 2D Gaussian.
The ray-tracing itself is done in two variants. One based on interpolating between the results from a pre-run ray-tracing model, the same that was used for the optical design. The other is somewhat more simplistic and run at simulation time.
The image above shows an example. The bottom panel holds the input spectrum (blue) and the spectra of the individual orders that fall onto the three detectors, convolved with the blaze function; one can see that the echelle angle is chosen here just blueward of the blaze angle. The top panel shows the simulation result on the three detectors.
The image below is a calibration frame with an etalon spectrum with equi-spaced emission lines. The light illumintes the whole slit but here two quarters of the slit length are intentionally blocked by a decker.