enyo.etc.spectrographs module

Module with defined spectrographs.


License

Copyright © 2020, Kyle B. Westfall


#.. _pypi https://pypi.org/project/sdss-mangadap/

class enyo.etc.spectrographs.SlitSpectrographArm(telescope, grating, cen_wave=None, grating_angle=None)[source]

Bases: object

Base class for spectrograph arms.

Cannot be instantiated as a useful class by itself because constants are undefined.

Parameters:
  • telescope (Telescope) – Spectrograph telescope properties
  • grating (VPHGrating) – The grating object.
  • cen_wave (float, optional) – Central wavelength in angstroms for an on-axis slit. Note this is mutually exclusive with grating_angle. If this is provided, the grating angle is set to the Bragg angle. If None, grating_angle must be provided, and the central wavelength is set to the Littrow value.
  • grating_angle (float, optional) – The angle of the grating normal with respect to the incoming beam in degrees. Note this is mutually exclusive with cen_wave. If provided, the central wavelength is set to the Littrow value. If None, cen_wave must be provided, and the grating angle is set to the Bragg angle.
Raises:

NotImplementedError – Raised if the derived class (see, e.g., TMTWFOSBlue) does not have base_file defined.

_base_efficiency()[source]

Internal method to construct the baseline efficiency (i.e., the combined efficiency of all spectrograph components for this arm, except for the grating and the telescope).

base_file = None

File with the grating-independent efficiencies. Must be defined by the derived class.

det = None

Detector instance with the detector properties.

efficiency(wave, x=0.0, y=0.0, same_type=True)[source]

Compute the total efficiency for this arm, from the ADC through to (and including) the detector.

Note

  • Note that x and y must be scalars for now.
Parameters:
  • wave (float, numpy.ndarray) – One or more wavelengths (angstroms in air) at which to sample the spectrograph efficiency.
  • x (float, optional) – Field position along the dispersion direction in arcseconds relative to the field center.
  • y (float, optional) – Field position along the cross-dispersed direction in arcseconds relative to the field center.
  • same_type (bool, optional) – Return the efficiency values relevant with the same type as the provided wave. If False, wave must be an array and an Efficiency object is returned.
Returns:

The efficiency of the spectrograph arm at one or more wavelengths. The returned type matches the input type of wave.

Return type:

float, numpy.ndarray, Efficiency

Raises:
  • TypeError – Raised if same_type is False and wave is not an array.
  • ValueError – Raised if x or y are outside the field limits of the instrument.
focal_length_cam = None

Camera focal length in mm

focal_length_coll = None

Collimator focal length in mm

focal_plane_limits = None

Upper and lower limits on focal plane coordinates relative to the field center in arcsec.

linear_dispersion(wave, x=0.0, m=1)[source]

Return the linear dispersion in mm per angstrom.

Parameters:
  • wave (float, array-like) – Wavelengths at which to calculate the linear dispersion.
  • x (float, optional) – Field position along the dispersion direction in arcseconds relative to the field center.
  • m (int, optional) – Grating order.
Returns:

Linear dispersion at each wavelength position in mm/angstrom.

Return type:

float, numpy.ndarray

max_field_angle_cam = None

Maximum camera field entrance angle (radius) in deg.

pixelscale

Pixelscale of the detector in arcsec/pixel.

resolution(wave, x=0, slit_width=0.75, m=1)[source]

Return the spectral resolution (\(R \equiv \lambda/\Delta\lambda\)) for a given slit width.

Warning

Assumes perfect image quality and a uniformly illuminated aperture.

Parameters:
  • wave (float, array-like) – Wavelengths at which to calculate the spectral resolution.
  • x (float, optional) – Field position along the dispersion direction in arcseconds relative to the field center.
  • slit_width (float, optional) – The width of the slit in arcsec along the dispersion direction (i.e., should account for any rotation of the slit).
  • m (int, optional) – Grating order.
Returns:

The spectral resolution, \(R \equiv \lambda/\delta\lambda\), at each wavelength position.

Return type:

float, numpy.ndarray

resolution_element(slit_width=0.75, units='micron', wave=None, x=0, m=1)[source]

Return the width of the resolution element (monochromatic image) at the camera focal plane.

Units can be micron, pixels, or angstroms. If in angstroms, wave must be provided.

Warning

Assumes perfect image quality and a uniformly illuminated aperture.

Parameters:
  • slit_width (float, optional) – The width of the slit in arcsec along the dispersion direction (i.e., should account for any rotation of the slit).
  • units (str, optional) – Units for the resolution element. Must be 'micron', 'pixels', or 'angstrom'. Note that wave is ignored (and the returned value is a single float) unless angstrom units are requested, when wave is required.
  • wave (float, array-like, optional) – Wavelengths at which to calculate the spectral resolution. Ignored unless units are angstroms.
  • x (float, optional) – Field position along the dispersion direction in arcseconds relative to the field center. Ignored unless units are angstroms.
  • m (int, optional) – Grating order. Ignored unless units are angstroms.
Returns:

The width of the spectral resolution element in the requested units. If units == 'angstroms, the returned type matches wave; otherwise, a single float is returned.

Return type:

float, numpy.ndarray

slit_angle(x)[source]

Entrance angle relative to the field center for a slit at position x.

Parameters:x (float) – Field position along the dispersion direction in arcseconds relative to the field center.
Returns:Slit entrance angle (should be added to the grating angle to get the grating incident angle).
Return type:float
wavelength_limits(x, y, add_grating_limits=False)[source]

Calculate the wavelength limits for a spectrum at the provided focal-plane position.

Parameters:
  • x (float) – Field position along the dispersion direction in arcseconds relative to the field center.
  • y (float) – Field position along the cross-dispersed direction in arcseconds relative to the field center.
  • add_grating_limits (bool, optional) – The returned limits include any limits set by the grating.
Returns:

Approximate minimum and maximum wavelengths viewable by the camera. There are known differences between these results and those returned by a Zemax model of the instrument.

Return type:

tuple

class enyo.etc.spectrographs.TMTWFOSArm(reflectivity='req', grating=None, cen_wave=None, grating_angle=None)[source]

Bases: enyo.etc.spectrographs.SlitSpectrographArm

Instance of SlitSpectrographArm specific to TMT-WFOS.

Parameters:
  • reflectivity (str, optional) – The reflectivity curve to use. For the ORD requirement or goal, use 'req' or 'goal', respectively.
  • grating (str, optional) – Grating name. Must be one of the gratings with parameters defined by available_gratings. If None, use default_grating defined by each arm.
  • cen_wave (float, optional) – Central wavelength in angstroms for an on-axis slit. Note this is mutually exclusive with grating_angle. If this is provided, the grating angle is set to the Bragg angle. If None and grating_angle is also None, the value is set to the wavelength with the peak efficiency for the selected grating. If None and grating_angle is provided, the central wavelength is set to the Littrow value for the provided grating angle.
  • grating_angle (float, optional) – The angle of the grating normal with respect to the incoming beam in degrees. Note this is mutually exclusive with cen_wave. If provided, the central wavelength is set to the Littrow value. If None, the grating angle is set to the Bragg angle for the central wavelength.
default_grating = None
focal_length_coll = 4500.0
focal_plane_limits = [-90, 90, -249, 249]
class enyo.etc.spectrographs.TMTWFOSBlue(reflectivity='req', grating=None, cen_wave=None, grating_angle=None)[source]

Bases: enyo.etc.spectrographs.TMTWFOSArm

Object used to compute the efficiency of the blue arm of the TMT-WFOS spectrograph. See the base class for the description of the instantiation arguments and methods.

base_file = '/home/docs/.cache/Python-Eggs/fobos_enyo-0.1.0.dev0-py3.7.egg-tmp/enyo/data/efficiency/wfos_blue_efficiency.db'

The file containing tabulated efficiency data for the elements of the spectrograph arm, excluding the grating.

default_grating = 'B1210'

The default grating used when one is not specified at instantiation.

det = <enyo.etc.detector.Detector object>
focal_length_cam = 600.0
max_field_angle_cam = 12.0
class enyo.etc.spectrographs.TMTWFOSRed(reflectivity='req', grating=None, cen_wave=None, grating_angle=None)[source]

Bases: enyo.etc.spectrographs.TMTWFOSArm

Object used to compute the efficiency of the red arm of the TMT-WFOS spectrograph. See the base class for the description of the instantiation arguments and methods.

base_file = '/home/docs/.cache/Python-Eggs/fobos_enyo-0.1.0.dev0-py3.7.egg-tmp/enyo/data/efficiency/wfos_red_efficiency.db'

The file containing tabulated efficiency data for the elements of the spectrograph arm, excluding the grating.

default_grating = 'R680'

The default grating used when one is not specified at instantiation.

det = <enyo.etc.detector.Detector object>
focal_length_cam = 600.0
max_field_angle_cam = 12.0
class enyo.etc.spectrographs.WFOSGrating(grating)[source]

Bases: enyo.etc.vph.VPHGrating

VPHGrating instances available in the current WFOS design.

To list the available gratings:

from enyo.etc.spectrographs import WFOSGrating
print(WFOSGrating.available_gratings.keys())
Parameters:grating (str) – Grating name. Must be one of the gratings with parameters defined by available_gratings.
available_gratings = {'B1210': {'line_density': 1210.0, 'n_bulk': 1.35, 'n_mod': 0.05, 'thickness': 4.0, 'wave_lim': (3100.0, 5600.0)}, 'B2479': {'line_density': 2479.0, 'n_bulk': 1.35, 'n_mod': 0.13, 'thickness': 1.742, 'wave_lim': (3100.0, 5600.0)}, 'B2700': {'line_density': 2700.0, 'n_bulk': 1.17, 'n_mod': 0.17, 'thickness': 3.5, 'wave_lim': (3100.0, 5600.0)}, 'B3600': {'line_density': 3600.0, 'n_bulk': 1.17, 'n_mod': 0.15, 'thickness': 3.03, 'wave_lim': (3100.0, 5600.0)}, 'R1392': {'line_density': 1392.0, 'n_bulk': 1.35, 'n_mod': 0.14, 'thickness': 2.85, 'wave_lim': (5400.0, 10000.0)}, 'R1520': {'line_density': 1520.0, 'n_bulk': 1.17, 'n_mod': 0.23, 'thickness': 4.67, 'wave_lim': (5400.0, 10000.0)}, 'R2052': {'line_density': 2052.0, 'n_bulk': 1.17, 'n_mod': 0.2, 'thickness': 4.01, 'wave_lim': (5400.0, 10000.0)}, 'R680': {'line_density': 680.0, 'n_bulk': 1.35, 'n_mod': 0.07, 'thickness': 5.35, 'wave_lim': (5400.0, 10000.0)}}