Exposure time calculation

class qmostetc.QMostETC(ruleset, airmass, seeing, moon_brightness=None)

Set up an ETC for an observation with certain ambient conditions

Parameters:
rulesetRuleset

Ruleset to use to determine the ETC

airmassfloat or astropy.units.Quantity

Airmass to use (default 1.0). The airmass may also be given as zenith angle [deg].

seeingastropy.units.Quantity

Optical seeing as a single Quantity at zenith [deg].

moon_brightnessstr or astropy.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 with QMostETC.set_moon_brightness() or with QMostETC.set_sky().

Attributes:
rulesetRuleset

Ruleset to use to determine the ETC

observationdict`(:class:`str, SimpleObservation)

Dictionary with the rule name as key and the correcsponding observation (limite to the wavelength required for the rule) as value.

set_moon_brightness(moon_brightness)

Set a new moon brightness

Parameters:
moon_brightnessstr or astropy.units.Quantity

Moon brightness. One of 'superbright', 'bright', 'gray' or 'dark'. Alternatively, the moon-target separation [deg] can be given directly here.

set_sky(sky)

Set the sky brackground

This is an alternative for QMostObservation.set_moon_brightness() to set the sky background.

Parameters:
fluxSpectrum

Photon flux of the sky [ph/(s cm² nm arcsec²].

set_target(flux, target_shape, sersic_radius=None, sersic_index=None)

Set the target object

Parameters:
fluxastropy.units.Quantity

Photon flux of the target [ph/(s cm² nm) for point sources, and ph/(s cm² nm arcsec²) for extended sources].

target_shapestr

Target shape. One of ‘flat’, ‘point’, ‘sersic’.

sersic_radiusastropy.units.Quantity

Sersic effective radius (only for Sersic target shape) [arcsec].

sersic_indexfloat

Sersic index (only for Sersic target shape).

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:
maxditastropy.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.

rtolfloat

Relative error acceptable for the exposure time (Default: 1e-4)

min_timeastropy.units.Quantity

Minimal returned exposure time [s]. Default: 1 sec

max_timeastropy.units.Quantity

Maximal returned exposure time [s]. Default: 1 year

acquireddict of (str, float)

Dictionary with the pre-acquired values for each rule’s variable (optional).

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

Parameters:
exptimeastropy.units.Quantity

Exposure time [s]

nexpint

Number of exposures. Defaults to 1.

acquireddict of (str, float)

Dictionary with the pre-acquired values for each rule’s variable (optional).

Returns:
bool

True if the exposure would pass the ruleset, False if not.

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:
exptimeastropy.units.Quantity

Exposure time [s]

nexpint

Number of exposures. Defaults to 1.

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]