Submodule to query the ESO ETC

This module is somehow specialized and limited to compare the results of the 4FS ETC. So, the parameters are those which can be adjusted in the 4FS ETC as well.

Examples

>>> from qmostetc.eso.etc import run, config
>>> tbl = run(config(resolution='lrs', template='Pickles_A0V',
...                  mag=16*u.ABmag, magband='Johnson.V',
...                  airmass=1.05, brightness='gray',
...                  exptime=1200*u.s))
>>> print(tbl)
    wavelength     arm  ...      obstotal             snr
        nm              ...      electron
------------------ ---- ... ------------------ ------------------
367.13015535029183 blue ... 14.434174356930033 1.2302376902218464
 367.1618925465504 blue ...  33.06028990938677  2.373722811294969
               ...  ... ...                ...                ...
 952.3939453903644  red ... 238.91791947776417 11.391395508981308
  952.433732234933  red ... 160.00225915920493  8.663402389156937
Length = 18432 rows
qmostetc.eso.etc.cached(cachedir=None)
Decorator to cache a function that takes two strings string and returns

a JSON compatible dict

Parameters:
cachedirstr

Base directory for the cache. If None, caching is switched off.

qmostetc.eso.etc.run(cfg, url=None)

Call the ESO ETC with a given configuration

To not overload the ESO ETC, it will cache the results and re-use them on repeated queries.

If the environment variable ESO_CACHE is set, its path is used to cache the ESO queries.

Parameters:
cfgdict

ESO configuration as a nested dictionary. This may be created with the function config().

urlstr or None

URL of the ETC API. May also be None (default; for the standard ESO ETC URL) or "test" (Shortcut for the ESO ETC test server URL).

Returns:
astropy.table.Table

Result table. The table has the following columns:

wavelength

Wavelength [nm]

arm

Spectrograph arm (‘blue’, ‘green’, or ‘red’)

dispersion

Spectral dispersion [mm]

sky

Sky SED spectrum [J / (arcsec² m² nm s)]

target

Target SED spectrum [J / (m² nm s)]

obstarget

Observed target signal [electron]

obssky

Observed sky signal [electron]

obstotal

Total observed signal [electron]

snr

S/N over the spacial aperture, per spectral pixel

qmostetc.eso.etc.config(resolution, template, airmass, mag, magband='sdss_r', brightness='gray', exptime=<Quantity 1200. s>, shape='point', sersic_radius=None, sersic_index=None)

Generate an ESO ETC configuration from the parameters

Parameters:
resolutionstr

Desired spectrograph for this target. One of ‘lrs’ or ‘hrs’.

templatestr

SEDTemplate name. One of ‘pickels’, ‘elliptical’, ‘sa’, ‘starb3’.

airmassfloat

Target airmass

magastropy.units.Quantity

Apparent magnitude for the target already band defined in the reddened. [ABmag or VEGAmag]

magbandstr

Magnitude band. One of ‘U’, ‘B’, ‘V’, ‘GAIA_GBP’, ‘sdss_u’, ‘sdss_g’, ‘sdss_r’, ‘sdss_i’.

brightnessstr float or astropy.units.Quantity

Sky brightness. One of “dark”, “gray”, “bright”. May be also given as FLI or as moon-sun separation value [deg].

exptimeastropy.units.Quantity

Exposure time [s]

shapestr

Source morphology. One of “point”, ‘flat’ or “sersic”. If “sersic”, the additional parameters “sersic_radius” and “sersic_index” need to be given.