scopesim.effects.metis_lms_trace_list module

SpectralTraceList and SpectralTrace for the METIS LM spectrograph

class scopesim.effects.metis_lms_trace_list.MetisLMSEfficiency(**kwargs)[source]

Bases: TERCurve

Computes the grating efficiency (blaze function) for the METIS LMS.

The procedure is described in E-REP-ATC-MET-1016_1.0. For a given order (determined by the central wavelength) the grating efficiency is modelled as a squared sinc function of wavelength via the grating angle.

make_ter_curve(wcal, wavelen=None)[source]

Compute the blaze function for the selected order

class scopesim.effects.metis_lms_trace_list.MetisLMSImageSlicer(filename, ext_id='Aperture List', **kwargs)[source]

Bases: ApertureMask

Treats the METIS LMS image slicer as an aperture mask effect. This helps in building a FieldOfView object that combines the spatial field of the slicer with the spectral range covered by the LMS setting.

The effect differs from its parent class ApertureMask in the initialisation from the Aperture List extension of the trace file !OBS.trace_file.

class scopesim.effects.metis_lms_trace_list.MetisLMSSpectralTrace(hdulist, spslice, params, **kwargs)[source]

Bases: SpectralTrace

SpectralTrace for the METIS LM spectrograph

compute_interpolation_functions()[source]

Define the transforms between (xi, lam) and (x, y). The LMS transforms actually operate on phase rather than wavelength, hence the necessity of defining pre- and posttransforms on the lam variable.

fov_grid()[source]

Provide information on the source space volume required by the effect

Returns:
A dictionary with entries wave_min and wave_max, x_min, y_min,
x_max, y_max. Spatial limits refer to the sky and are given in
arcsec.
fp2sky(fp_x)[source]

Convert position in FP2 to position on sky

get_matrices()[source]

Extract matrix from lms_dist_poly.txt

Evaluate polynomial to obtain matrices A, B, AI and BI at grism angle given echelle order and slice number

Parameters:
orderint

Echelle order

spsliceint

Slice number

anglefloat

Grism angle in degrees

Returns:
dict of four np.arrays of shape (4, 4) each
get_waverange(det_mm_lims)[source]

Determine wavelength range that spectral trace covers on image plane

lam2phase(lam)[source]

Convert wavelength to phase

Phase is lam * order / (2 * grat_spacing).

Parameters:
lamndarray (float)

wavelength (um)

Returns:
Phasendarray
phase2lam(phase)[source]

Convert phase to wavelength

Wavelength is phase * 2 * grat_spacing / order

Parameters:
phasendarray (float)

phase (dimensionless)

Returns:
wavelengthndarray (um)
sky2fp(xi)[source]

Convert position in arcsec to position in FP2

class scopesim.effects.metis_lms_trace_list.MetisLMSSpectralTraceList(**kwargs)[source]

Bases: SpectralTraceList

SpectralTraceList for the METIS LM spectrograph

apply_to(obj, **kwargs)[source]

overrides SpectralTraceList.apply_to()

make_spectral_traces()[source]

Compute the transformations by interpolation

scopesim.effects.metis_lms_trace_list.echelle_setting(wavelength, grat_spacing, wcal_def)[source]

Determine optimal echelle rotation angle for wavelength

Parameters:
lambdafloat

central wavelength in microns

grat_spacingfloat

grating rule spacing in microns

wcal_def: fits.TableHDU, fits.BinTableHDU, Table, str

definition of the wavelength calibration parameters If str, interpreted as name of a fits file, with a table extension ‘WCAL’.

Returns:
a dict with entries
  • Ord: echelle order
  • Angle: grism angle
  • Phase: phase