enyo.etc.efficiency module¶
Provides Efficiency object, primarily just a linear interpolator for efficiency data.
Copyright © 2020, Kyle B. Westfall
#.. _pypi https://pypi.org/project/sdss-mangadap/
-
class
enyo.etc.efficiency.AtmosphericThroughput(airmass=1.0, location='maunakea')[source]¶ Bases:
enyo.etc.efficiency.EfficiencyAtmospheric throughput.
Parameters: - airmass (
float, optional) – Airmass of the observation. - location (
str, optional) – Location of the observations. Currently this can only be'maunakea'.
- airmass (
-
class
enyo.etc.efficiency.CombinedEfficiency(efficiencies, wave=None)[source]¶ Bases:
enyo.etc.efficiency.EfficiencyA class that combines multiple efficiencies that can be accessed separately or act as a single efficiency.
Accessing this object as you would an
Efficiencyobject always returns the total efficiency.Parameters: - efficiencies (
list,dict) – The set of efficiencies to combine. Nominally this should be a dictionary that gives the efficiencies and a keyword identifier for each. A list can be entered, meaning that the efficiencies can only be access by their index, not a keyword. Each list element or dictionary value must be anEfficiencyobject. - wave (array-like, optional) – Wavelengths of/for efficiency measurements.
-
efficiencies¶ The efficiencies combined. Access to individual efficiencies is by keyword; if keywords are not provided, access is by single integer index.
Type: dict
Raises: TypeError– Raised ifefficienciesis not a list or dictionary, or if the elements of either are notEfficiencyobjects.-
classmethod
from_total(total, wave=None)[source]¶ Construct the combined efficiency object from the total efficiency only. This is virtually identical to a single
Efficiencyobject.Parameters: - total (
float, array-like) – Constant or 1D total efficiency data. - wave (array-like, optional) – 1D array with wavelengths in angstroms. If not
provided,
etamust be a constant; if provided,etamust be an array.
- total (
- efficiencies (
-
class
enyo.etc.efficiency.Efficiency(eta, wave=None)[source]¶ Bases:
objectBase class for efficiency data.
Provided a wavelength independent efficiency value (\(\eta\);
eta), or a sampled vector of \(\eta\) vs. wavelength (\(\lambda\);wave), this class mainly just allows for access and interpolation of those data. When provided as a function of wavelength, the efficiency is assumed to be 0 outside the bounds of the provided wavelength vector.Parameters: - eta (
float, array-like) – Constant or 1D efficiency data. - wave (array-like, optional) – 1D array with wavelengths in angstroms. If not provided,
etamust be a constant; if provided,etamust be an array.
-
interpolator¶ Linear interpolator used to sample efficiency at any wavelength, if vectors are provided.
Type: scipy.interpolate.interp1d
Raises: TypeError– Raised ifwaveis not provided andetahas alenattribute.ValueError– Raised ifwaveis provided andetais not a vector or ifwaveandetahave different shapes.
-
eta¶ The effeciency vector.
-
classmethod
from_file(data_file, wave_units='angstrom')[source]¶ Read from an ascii file.
The format of the file must be columnated data with the first column providing the wavelength and the second column providing the efficiency. The data is read using numpy.genfromtxt.
Parameters: - data_file (
str) – Ascii file with the data. - wave_units (
str, optional) – Units of the wavelength in the file. Must be interpretable by astropy.units and convertable to angstroms.
- data_file (
-
rescale(scale)[source]¶ Rescale the efficiency data.
The internal attributes are directly modified.
Parameters: scale (scalar-like, array-like) – Factor for the efficiency. No check is performed to make sure this doesn’t result in a value larger than 1! Value must be broadcastable to the shape of the efficiency vector.
-
wave¶ The wavelength vector with direct efficiency values.
- eta (
-
class
enyo.etc.efficiency.FiberThroughput(fiber='polymicro')[source]¶ Bases:
enyo.etc.efficiency.EfficiencyFiber efficiency object.
Currently this only returns efficiencies based on pre-computed data. See $ENYO_DIR/data/efficiency/fibers/.
Parameters: fiber ( str, optional) – The fiber vendor. Currently this can only be ‘polymicro’.
-
class
enyo.etc.efficiency.FilterResponse(band='g')[source]¶ Bases:
enyo.etc.efficiency.EfficiencyThe efficiency of a broad-band filter.
Parameters: band ( str, optional) – The band to use. Options are for the response functions in the $ENYO_DIR/data/broadband_filters directory.Raises: FileNotFoundError– Raised if the default file for the given band is not available.
-
class
enyo.etc.efficiency.SpectrographThroughput(wave=None, coupling=None, fibers=None, grating=None, camera=None, detector=None, other=None)[source]¶ Bases:
enyo.etc.efficiency.CombinedEfficiencyDefine the spectrograph throughput from the telescope focal plane to the detector.
Parameters: - wave (array-like, optional) – Wavelength vector at which to define the total efficiency.
- coupling (
Efficiency, optional) – Focal-plain coupling efficiency. - fibers (
Efficiency, optional) – Fiber efficiency. - grating (
Efficiency, optional) – Grating efficiency - camera (
Efficiency, optional) – Camera efficiency - detector (
Efficiency, optional) – Detector efficiency - other (
Efficiency, optional) – Other efficiency terms
-
class
enyo.etc.efficiency.SystemThroughput(wave=None, spectrograph=None, telescope=None)[source]¶ Bases:
enyo.etc.efficiency.CombinedEfficiencyDefine the full system throughput from the top of the telescope to the detector; i.e., ratio of detected-to-incident photons.
Parameters: - wave (array-like, optional) – Wavelength vector at which to define the total efficiency.
- spectrograph (
Efficiency, optional) – Spectrograph efficiency - telescope (
Efficiency, optional) – Telescope efficiency