API reference

Top-level objects

lfast_etc.LFASTETC

Exposure time calculator for one instrument on the LFAST array.

lfast_etc.ETCResult

Per-resolution-element output of an ETC calculation.

lfast_etc.Source

A point source with a known SED shape and a magnitude.

lfast_etc.Telescope

An array of identical LFAST unit telescopes feeding one spectrograph.

lfast_etc.Instrument

A spectrograph configuration.

lfast_etc.Sky

Sky radiance and transmission from a SkyCalc FITS table.

lfast_etc.list_instruments

Names of the bundled instrument presets.

Plot helpers

Plot helpers: sensitivity maps, noise budgets, throughput, sky, simulated spectra.

Every function takes an optional ax and returns it, so the plots compose with plt.subplots. The ETCResult, LFASTETC and Source classes expose the relevant ones as methods (res.plot_noise_budget() etc.).

Importing this module applies the package matplotlib style (STYLE, data/lfast.mplstyle): STIX serif, inward ticks, a light grid and a six-colour palette. plt.style.use('default') afterwards restores matplotlib’s.

lfast_etc.plotting.plot_noise_budget(res, ax=None)[source]

Stacked fractions of the noise variance (star, sky, dark, read) per resel.

Uses the exposure time stored in res (per bin), so it answers “what limits me at this wavelength for this observation”.

lfast_etc.plotting.plot_spectrum(res, ax=None, seed=0, show_noiseless=True)[source]

One noisy realisation of the extracted spectrum (electrons per resel).

The realisation is N_* t (1 + g / SNR) with g standard normal, i.e. the per-resel SNR of res applied to the noiseless signal.

lfast_etc.plotting.plot_throughput(etc, ax=None)[source]

Telescope K_opt, fiber injection, instrument (S_opt x QE) and the end-to-end product.

lfast_etc.plotting.sky_surface_brightness_ab(etc, per='resel')[source]

Sky surface brightness per resolution element (or per detector pixel, per="pixel", on etc.pixel_wavelength) [AB mag / arcsec^2], as the spectrograph sees it (LSF-convolved with an lsf, see LFASTETC.sky_radiance).

lfast_etc.plotting.plot_sky(etc, ax=None)[source]

Sky surface brightness per resel (AB mag/arcsec^2) and the fiber’s sky electron rate per pixel.

lfast_etc.plotting.plot_source(source, wavelength_nm=None, ax=None, photon=False)[source]

The source SED (F_lambda or photon flux) with the normalising band shaded.

lfast_etc.plotting.equivalent_diameter_axis(ax, diameter_m=0.726, ticks=(1, 2, 3, 5, 10, 20, 30))[source]

Top axis in single-telescope equivalent diameter for an x axis in number of telescopes.

lfast_etc.plotting.plot_vs_n_telescopes(make_etc, source, ns, exptimes, snr, wavelength=None, ax=None, nominal=20, label_fmt='{t:g} s')[source]

Limiting magnitude versus number of telescopes for several exposure times.

make_etc(n) must return the LFASTETC for n telescopes (so the caller decides fiber, combiner and bandpass).

lfast_etc.plotting.plot_snr_map(mags, exptimes, snr, ax=None, levels=(5, 10, 30, 100), band='V', cmap='viridis', title=None)[source]

Colour map of SNR over (exposure time, magnitude) with labelled SNR contours.

snr has shape (len(mags), len(exptimes)) as returned by snr_grid().

lfast_etc.plotting.plot_limiting_magnitude(etc, source, exptimes, snr, ax=None, label_fmt='{t:g} s')[source]

Limiting magnitude versus wavelength for several exposure times.

lfast_etc.plotting.plot_profile(instrument, ax=None)[source]

Pixelated fiber image of one resel on the detector (#19) with the peak fraction.

lfast_etc.plotting.plot_fiber_coupling(telescope, ax=None, seeing=None)[source]

Geometric fraction of a point source inside the fiber versus seeing FWHM at 500 nm (#14), for both PSF shapes, with the reference and current seeing marked.

lfast_etc.plotting.plot_throughput_cascade(etc, ax=None, path='star')[source]

Cumulative throughput after each stage of the Choi et al. (2026) budget, then the spectrograph and detector, like their Figure 11 (path="sky" drops the fiber injection).

Constants and data

Physical constants (SI) and package data paths.

lfast_etc.constants.positive(name, value, allow_zero=False)[source]

Validate a scalar parameter at the public boundary; returns it as float.

lfast_etc.source.BANDS holds the box bands (centre nm, width nm, Vega zero point Jy); lfast_etc.telescope.FIBERS the two fiber options.

Web application

Browser front-end for lfast_etc (Flask + Bokeh).

Run with lfast-etc-web [--host H] [--port P] or python -m lfast_etc.web.app.

lfast_etc.web.app.build(form)[source]

Parse a form/query mapping, run the ETC and return (etc, src, res, params).