eso_sky_calc module

class arte.photometry.eso_sky_calc.EsoSkyCalc(**kwargs)

Bases: object

Interface to EsoSkyCalc

Calling sequence:

sky = EsoSkyCalc(**kwargs)

the full list of keywords parameters and defaults is in the help page


Plot sky radiance for airmass=2 and full moon

>>> sky = EsoSkyCalc(airmass=2, moon_sun_sep=180)
>>> plt.semilogy(sky.lam, sky.flux)

Retrieve dictionary of default values

>>> defdict= EsoSkyCalc.default_values()
>>> defdict['observatory'] == '3060m'
static default_values()

Radiance array in ph / s / m^2 / um / u.arcsec^2


Emission lines of upper atmosphere in ph / s / m^2 / um / u.arcsec^2


Airglow / residual continuum in ph / s / m^2 / um / u.arcsec^2


Scattered moonlight in ph / s / m^2 / um / u.arcsec^2


Scattered starlight in ph / s / m^2 / um / u.arcsec^2


Telescope / Instrument thermal emission in ph / s / m^2 / um / u.arcsec^2


Molecular emission of lower atmosphere in ph / s / m^2 / um / u.arcsec^2


Zodiacal light in ph / s / m^2 / um / u.arcsec^2


Wavelength array in astropy units of nm


Fractional transmission


Molecular Absorption


Mie scattering


Ozone UV / optical absorption


Rayleigh scattering

filters module

class arte.photometry.filters.Filters

Bases: object

ALL = ['bessel_j', 'bessel_h', 'bessel_k', 'cousin_r', 'cousin_i', 'johnson_u', 'johnson_b', 'johnson_v', 'johnson_r', 'johnson_i', 'johnson_j', 'johnson_k', 'eso_etc_u', 'eso_etc_b', 'eso_etc_v', 'eso_etc_r', 'eso_etc_i', 'eso_etc_z', 'eso_etc_y', 'eso_etc_j', 'eso_etc_h', 'eso_etc_k', 'eso_etc_l', 'eso_etc_m', 'eso_etc_n', 'eso_etc_q']
BESSEL_H = 'bessel_h'
BESSEL_J = 'bessel_j'
BESSEL_K = 'bessel_k'
CCD_220 = 'ccd_220'
COUSIN_I = 'cousin_i'
COUSIN_R = 'cousin_r'
C_RED_ONE = 'c_red_one'
ESO_ETC = ['eso_etc_u', 'eso_etc_b', 'eso_etc_v', 'eso_etc_r', 'eso_etc_i', 'eso_etc_z', 'eso_etc_y', 'eso_etc_j', 'eso_etc_h', 'eso_etc_k', 'eso_etc_l', 'eso_etc_m', 'eso_etc_n', 'eso_etc_q']
ESO_ETC_B = 'eso_etc_b'
ESO_ETC_H = 'eso_etc_h'
ESO_ETC_I = 'eso_etc_i'
ESO_ETC_J = 'eso_etc_j'
ESO_ETC_K = 'eso_etc_k'
ESO_ETC_L = 'eso_etc_l'
ESO_ETC_M = 'eso_etc_m'
ESO_ETC_N = 'eso_etc_n'
ESO_ETC_Q = 'eso_etc_q'
ESO_ETC_R = 'eso_etc_r'
ESO_ETC_U = 'eso_etc_u'
ESO_ETC_V = 'eso_etc_v'
ESO_ETC_Y = 'eso_etc_y'
ESO_ETC_Z = 'eso_etc_z'
JOHNSON_B = 'johnson_b'
JOHNSON_I = 'johnson_i'
JOHNSON_J = 'johnson_j'
JOHNSON_K = 'johnson_k'
JOHNSON_R = 'johnson_r'
JOHNSON_U = 'johnson_u'
JOHNSON_V = 'johnson_v'
SYNPHOT = ['bessel_j', 'bessel_h', 'bessel_k', 'cousin_r', 'cousin_i', 'johnson_u', 'johnson_b', 'johnson_v', 'johnson_r', 'johnson_i', 'johnson_j', 'johnson_k']
classmethod get(filter_name)

Return synphot.SpectralElement of the specified filter The list of available filter is accessible via Filters.names()

classmethod names()

spectral_types module

class arte.photometry.spectral_types.PickelsLibrary

Bases: object

classmethod baseUrl()
classmethod filename(spectralType)

Return URL to access Pickels UVKLIB spectra at STScI To be used with synphot.SourceSpectrum.from_file()

normalized_star_spectrum module

arte.photometry.normalized_star_spectrum.get_normalized_star_spectrum(spectral_type, magnitude, filter_name)

spec_data = get_normalized_star_spectrum(spectral_type, magnitude, filter_name)

Returns a structure containing the synthetic spectrum of the star having the spectral type and magnitude in the specified input filter. Magnitude is in VEGAMAG-F(lambda) system. Spectra are from PICKLES, PASP, 110, 863 (1998) Absolute flux spectra, no effect of atmospheric and instrument transmission

  • r0AtZenith (float) – overall r0 at zenith [m]
  • spectral_type (string.) – spectral type and luminosity class (e.g. G2V or M4III) or ‘vega’
  • magnitude (float.) – magnitude in the filter_name filter
  • filter_name (string.) – Name of the filter. See Filters.get() for the list of available filters


Return type:

synphot.SourceSpectrum object defining the spectrum


Plot the spectrum of a vega, A0V, G2V stars of mag=8 defined on JohnsonR filter

>>> sp= get_normalized_star_spectrum('vega', 8, Filters.JOHNSON_R)
>>> spA0V= get_normalized_star_spectrum('A0V', 8, Filters.JOHNSON_R)
>>> spG2V= get_normalized_star_spectrum('G2V', 8, Filters.JOHNSON_R)
>>> plt.plot(sp.waveset, sp(sp.waveset), label='Vega')
>>> plt.plot(spA0V.waveset, spA0V(spA0V.waveset), label='A0V')
>>> plt.plot(spG2V.waveset, spG2V(spG2V.waveset), label='G2V')
>>> plt.grid(True)
>>> plt.xlabel('nm')
>>> plt.ylabel('FLAM')
>>> plt.xlim(0, 10000)
>>> plt.legend()

mag_estimator module

class arte.photometry.mag_estimator.MagEstimator(telescope, detector_bandname, total_adus=<Quantity 1. adu>, detector_bandwidth=<Quantity 300. nm>, detector_freq=<Quantity 1. Hz>, detector_gain=1, detector_adu_e_ratio=<Quantity 1. electron / adu>, detector_nsubaps=1, wfs_transmission=1.0, detector_qe=<Quantity 1. electron / ph>)

Bases: object

Estimates magnitude from detector counts

  • total_adus (int * u.adu) – total ADUs recorded by the detector in one exposure
  • telescope (class Telescope or equivalent) – a class that defines an area() method with a result in u.m**2
  • detector_bandname (str) – one of the allowed bandnames (use MagEstimator.bandnames() to list)
  • detector_bandwidth (float * u.nm, optional) – bandwidth, defaults to 300 nm
  • detector_gain (int, optional) – detector EM gain, defaults to 1
  • detector_adu_e_ratio (float * u.electron/u.adu) – detector ADU/e- conversion factor, defaults to 1.0
  • detector_nsubaps (int, optional) – number of subapertures, defaults to 1
  • detector_freq (float * u.Hz, optional) – detector frequency, defaults to 1.0 Hz
  • wfs_transmission (float, optional) – overall wfs transmission from telescope aperture to detector, defaults to 1
  • detector_qe (float * u.electron/, optional) – average QE over the considered band, defaults to 1.0

TypeError – if the wrong astropy units are passed in the initializer



(flux for zero mag in Vega system)
Band   Photometric zeropoint in ergs/s/cm2/A
 U     U0 = 4.18023e-09
 B     B0 = 6.60085e-09
 V     V0 = 3.60994e-09
 R     R0 = 2.28665e-09
 I     I0 = 1.22603e-09
 Z     Z0 = 7.76068e-10
 Y     Y0 = 5.973e-10
 J     J0 = 3.12e-10
 H     H0 = 1.14e-10
 K     K0 = 3.94e-11
 L     L0 = 4.83e-12
 M     M0 = 2.04e-12
 N     N0 = 1.23e-13
 Q     Q0 = 6.8e-15

Name of the band used for magnitude estimation


List of supported bandnames


Zero point in photons/sec

help(search='', prefix='')

Interactive help

Prints on stdout a list of methods that match the search substring or all of them if search is left to the default value of an empty string, together with a one-line help taken from the first line of their docstring, if any.

The prefix argument is prepended to the method name and is used for recursive help of every class member.


Estimated magnitude


Photons/sec detected by sensor


Photons/subap/frame detected by sensor

n_phot module

class arte.photometry.n_phot.DefaultModel

Bases: object

Table of magnitudes for each band.

ref.: P.Lena, Astrophysique : methodes physiques de l’observation,
pp.95–96, Coll. Savoirs Actuels, InterEd./CNRS-Ed. (1996)

except Na-band (added)

back_mag_tab = [23.0, 22.0, 21.0, 20.0, 19.5, 14.0, 13.5, 12.5, 3.0, 0.0, 23.0]
band_tab = ['U', 'B', 'V', 'R', 'I', 'J', 'H', 'K', 'L', 'M', 'Na']
e0_tab = [4.35e-08, 7.2e-08, 3.92e-08, 1.7600000000000002e-08, 8.3e-09, 3.4000000000000003e-09, 7.000000000000001e-10, 3.9e-10, 8.1e-11, 2.2e-11, 3.92e-08]
lambda_tab = [3.6e-07, 4.3999999999999997e-07, 5.5e-07, 7e-07, 9e-07, 1.2499999999999999e-06, 1.6499999999999999e-06, 2.2e-06, 3.3999999999999996e-06, 4.9999999999999996e-06, 5.89e-07]
width_tab = [6.8e-08, 9.8e-08, 8.899999999999999e-08, 2.1999999999999998e-07, 2.4e-07, 3e-07, 3.5e-07, 4e-07, 5.5e-07, 3e-07, 1e-08]
class arte.photometry.n_phot.Maory1Model

Bases: object

based on E-SPE-ESO-276-0206 issue 1 and MAORY Tech Notes 19 Dec 2007

back_mag_tab = [21.4, 20.6, 19.7, 16.5, 14.4, 13.0]
band_tab = ['V', 'R', 'I', ' J', 'H', 'K']
e0_tab = [3.68e-08, 1.77e-08, 1.19e-08, 2.86e-09, 1.0800000000000002e-09, 3.7900000000000004e-10]
lambda_tab = [5.4e-07, 6.5e-07, 8e-07, 1.2499999999999999e-06, 1.6499999999999999e-06, 2.2e-06]
width_tab = [9e-08, 1.3e-07, 2e-07, 3e-07, 3.5e-07, 4e-07]

Callable function attribute to get the model’s tables.

arte.photometry.n_phot.n_phot(mag: float, band: str = None, surf: float = 1.0, delta_t: float = 1.0, lambda_: float = None, width: float = None, e0: float = None, back_mag: float = None, model: str = 'default', verbose: bool = False)

This routine computes from a source magnitude the corresponding number of photons for a given band, a given surface and a given time interval. This is returned together with the number of photons from the sky background. The chosen band can be either a Johnson one (from U to M, but also a default Na-band), or a user-defined one (specifying the central wavelength and the bandwidth). The routine can also return the model used for calculations, if the attribute get_model() is called (see examples #4 and #5).

TODO c in the code is approximated as 3e8


mag = magnitude [float]


band = wavelength Johnson band or Na default band [str]. delta_t = integrating time [s] [float], default is 1s. surf = integrating surface [m^2] [float], default is 1m^2. lambda_ = central wavelenght of the choosen band [m] [float]. width = bandwidth of the choosen band [m] [float]. e0 = A0 0-magnitude star brightness in the choosen band,

[J/s/m^2/um] [float].

back_mag = sky background default magnitude [FLOAT]. model = use the specified model instead the the default one (Lena 96).

Available model are: ‘MAORY-1’ (phase A of Maory MCAO-EELT)


Tuple with 2 elements:

nb_of_photons = the computed source number of photons [float] background = the computed sky background nb of photons per arcsec^2 [float]

[1]: compute the number of photons coming from a 5-mag star

observed in V-band, with 8m-diameter telescope and an integration time of 12s:

nb_of_photons, background = n_phot(5.,
band=’V’, surf=math.pi*(8.**2)/4, delta_t=12.)
nb_of_photons = 5.9521160e+10 photons background = 63581.948 photons
[2]: compute the same stuff but with a user-defined sky background

of 19.5-mag:

nb_of_photons, background = n_phot(5.,
band=’V’, surf=math.pi*(8.**2)/4, delta_t=12., back_mag=19.5)
nb_of_photons = 5.9521160e+10 photons background = 100549.18 photons
[3]: compute the same stuff but with a user-defined band of

central wavelength 0.54um and a narrow bandwidth of 0.01um:

nb_of_photons, background = n_phot(5.,
lambda_=5.4E-7, width=1E-8, surf=math.pi*(8.**2)/4, delta_t=12., back_mag=19.5)
nb_of_photons = 6.5661736e+09 photons background = 11092.246 photons

[4]: get the sky background default magnitudes table:

model = n_phot.getmodel() model.back_mag_table

back_mag_table= [22.,21.,20.,19.,17.5,16.,14.,12.,10.,6.,23.5]
[5]: get the bands, central wavelengths, bandwidths, A0 0-mag. star

brightnesses, and sky background default magnitudes tables:

model = n_phot.getmodel()

model.band_table =
[ “U”, “B”, “V”, “R”, “I”, “J”, “H”, “K”, “L”, “M”, “Na”]
model.lambda_table =
[3.6e-7,4.4e-7,5.5e-7, 7e-7, 9e-7,1.3e-6,1.7e-6,2.2e-6,3.4e-6, 5e-06,5.89e-7]
model.width_table =
[6.8e-8,9.8e-8,8.9e-8,2.2e-7,2.4e-7, 3e-7,3.5e-7, 4e-7,5.5e-7, 3e-7, 1e-8]
model.e0_table =
[4.4e-8,7.2e-8,3.9e-8,1.8e-8,8.3e-9,3.4e-9, 7e-10, 4e-10, 8e-11,2.2e-11, 3.9e-8]

[ 23., 22., 21., 20., 19.5, 14., 13.5, 12.5, 3., 0., 23.]

in the case that user-defined bandwidth (keyword width) and wavelength (keyword lambda_) are set, it cannot extend beyond a routine-defined band. otherwise the results (nb_of_photons and background) are wrong.
program written: october 1998,
Marcel Carbillet (OAA) [].
modifications : march 1999,
Marcel Carbillet (OAA) []:
  • help completed.
  • background output stuff added.
august 2015
Guido Agapito (OAA) []
  • added DOUBLE keyword
  • added verbose keyword
  • where and closest like function to find the band/lambda
may 2019
Alfio Puglisi (OAA) []
  • translated to Python
  • removed DOUBLE keyword

Module contents