synospec.etc.spectrographs module
Module with defined spectrographs.
Copyright © 2020, Kyle B. Westfall
- class synospec.etc.spectrographs.SlitSpectrographArm(telescope, grating, cen_wave=None, grating_angle=None)[source]
Bases:
objectBase class for spectrograph arms.
Cannot be instantiated as a useful class by itself because constants are undefined.
- Parameters
telescope (
Telescope) – Spectrograph telescope propertiesgrating (
VPHGrating) – The grating object.cen_wave (
float, optional) – Central wavelength in angstroms for an on-axis slit. Note this is mutually exclusive withgrating_angle. If this is provided, the grating angle is set to the Bragg angle. If None,grating_anglemust 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 withcen_wave. If provided, the central wavelength is set to the Littrow value. If None,cen_wavemust 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 havebase_filedefined.
- _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.
- 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 providedwave. If False,wavemust be an array and anEfficiencyobject 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_typeis False andwaveis not an array.ValueError – Raised if
xoryare 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.
- property 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 thatwaveis ignored (and the returned value is a single float) unless angstrom units are requested, whenwaveis 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 matcheswave; 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 synospec.etc.spectrographs.TMTWFOSArm(reflectivity='req', grating=None, cen_wave=None, grating_angle=None)[source]
Bases:
synospec.etc.spectrographs.SlitSpectrographArmInstance of
SlitSpectrographArmspecific 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 byavailable_gratings. If None, usedefault_gratingdefined by each arm.cen_wave (
float, optional) – Central wavelength in angstroms for an on-axis slit. Note this is mutually exclusive withgrating_angle. If this is provided, the grating angle is set to the Bragg angle. If None andgrating_angleis also None, the value is set to the wavelength with the peak efficiency for the selected grating. If None andgrating_angleis 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 withcen_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
Collimator focal length in mm
- focal_plane_limits = [-90, 90, -249, 249]
Upper and lower limits on focal plane coordinates relative to the field center in arcsec.
- class synospec.etc.spectrographs.TMTWFOSBlue(reflectivity='req', grating=None, cen_wave=None, grating_angle=None)[source]
Bases:
synospec.etc.spectrographs.TMTWFOSArmObject 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/checkouts/readthedocs.org/user_builds/synospec/envs/latest/lib/python3.8/site-packages/synospec/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.
- focal_length_cam = 600.0
Camera focal length in mm
- max_field_angle_cam = 12.0
Maximum camera field entrance angle (radius) in deg.
- class synospec.etc.spectrographs.TMTWFOSRed(reflectivity='req', grating=None, cen_wave=None, grating_angle=None)[source]
Bases:
synospec.etc.spectrographs.TMTWFOSArmObject 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/checkouts/readthedocs.org/user_builds/synospec/envs/latest/lib/python3.8/site-packages/synospec/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.
- focal_length_cam = 600.0
Camera focal length in mm
- max_field_angle_cam = 12.0
Maximum camera field entrance angle (radius) in deg.
- class synospec.etc.spectrographs.WFOSGrating(grating)[source]
Bases:
synospec.etc.vph.VPHGratingVPHGratinginstances available in the current WFOS design.To list the available gratings:
from synospec.etc.spectrographs import WFOSGrating print(WFOSGrating.available_gratings.keys())
- Parameters
grating (
str) – Grating name. Must be one of the gratings with parameters defined byavailable_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)}}