Exposure time calculation¶
- class qmostetc.QMostETC(ruleset, airmass, seeing, moon_brightness=None)¶
Set up an ETC for an observation with certain ambient conditions
- Parameters:
- ruleset
Ruleset
Ruleset to use to determine the ETC
- airmass
float
orastropy.units.Quantity
Airmass to use (default 1.0). The airmass may also be given as zenith angle [deg].
- seeing
astropy.units.Quantity
Optical seeing as a single Quantity at zenith [deg].
- moon_brightness
str
orastropy.units.Quantity
Moon brightness. One of
'superbright'
,'bright'
,'gray'
or'dark'
. Alternatively, the moon-target separation [deg] can be given directly here. If not specified here, the sky spectrum must be given later withQMostETC.set_moon_brightness()
or withQMostETC.set_sky()
.
- ruleset
- Attributes:
- ruleset
Ruleset
Ruleset to use to determine the ETC
- observation
dict`(:class:`str
,SimpleObservation
) Dictionary with the rule name as key and the correcsponding observation (limite to the wavelength required for the rule) as value.
- ruleset
- set_moon_brightness(moon_brightness)¶
Set a new moon brightness
- Parameters:
- moon_brightness
str
orastropy.units.Quantity
Moon brightness. One of
'superbright'
,'bright'
,'gray'
or'dark'
. Alternatively, the moon-target separation [deg] can be given directly here.
- moon_brightness
- set_sky(sky)¶
Set the sky brackground
This is an alternative for
QMostObservation.set_moon_brightness()
to set the sky background.- Parameters:
- flux
Spectrum
Photon flux of the sky [ph/(s cm² nm arcsec²].
- flux
- set_target(flux, target_shape, sersic_radius=None, sersic_index=None)¶
Set the target object
- Parameters:
- flux
astropy.units.Quantity
Photon flux of the target [ph/(s cm² nm) for point sources, and ph/(s cm² nm arcsec²) for extended sources].
- target_shape
str
Target shape. One of ‘flat’, ‘point’, ‘sersic’.
- sersic_radius
astropy.units.Quantity
Sersic effective radius (only for Sersic target shape) [arcsec].
- sersic_index
float
Sersic index (only for Sersic target shape).
- flux
- property mean_loss¶
Return the mean atmospheric ans telescope transmission
This is set by the
set_target()
and can be used to calculate a kind of “fiber magnitude”.Note that this is very approximate, as it just averages the average transmission for each individual observation. It also just includes the atmospheric losses and the geometrical fiber fraction, no optical or other losses.
For an example, see
QMostObservation.mean_loss()
.
- get_exptime(maxdit=None, rtol=0.0001, min_time=<Quantity 1. s>, max_time=<Quantity 1. yr>, acquired=None)¶
Calculate the exposure time required for the ruleset.
Since the rules and rulesets usually only return a boolean, this is done by bisecting the possible exposure time range on a logarithmic scale.
- Parameters:
- maxdit
astropy.units.Quantity
Maximum exposure time per exposure [min]. The full exposure is assumed to be split into exposures of with that exposure time as maximum. If not given (default), the maximum exposure time is infinite.
- rtol
float
Relative error acceptable for the exposure time (Default: 1e-4)
- min_time
astropy.units.Quantity
Minimal returned exposure time [s]. Default: 1 sec
- max_time
astropy.units.Quantity
Maximal returned exposure time [s]. Default: 1 year
- acquired
dict
of (str
,float
) Dictionary with the pre-acquired values for each rule’s variable (optional).
- maxdit
- Returns:
astropy.units.Quantity
Calculated exposure time to pass the specified rules [s].
- eval(exptime, nexp=1, acquired=None)¶
Evaluate the ruleset for a given exposure time
- expose(exptime, nexp=1)¶
Create the result table for a defined exposure time.
Note that the table does not contain the full spectrum, but only the values that are required to evaluate the rules. This is a handy method to get the values that have lead to a certain exposure time.
- Parameters:
- exptime
astropy.units.Quantity
Exposure time [s]
- nexp
int
Number of exposures. Defaults to 1.
- exptime
- Returns:
astropy.table.QTable
Resulting table with the following columns:
rule : Name of the rule that uses these values
wavelength: Left borders of wavelenght bins [nm]
binwidth: Wavelength bin width [nm]
efficiency: Spectrograph efficiency [electron/photon]
gain: Spectrograph gain [electron/adu]
target: Target signal count [electron]
sky: Sky background count [electron]
dark: CCD dark current [electron]
ron: CCD readout noise [electron]
noise: Noise count [electron]