Concepts

Resolution elements

Everything in lfast_etc is computed per resolution element (resel). The wavelength grid has one point per resel, \(\lambda_{j+1} = \lambda_j (1 + 1/R)\), and each bin is one resel wide, \(\delta\lambda_j = \lambda_j/R\). A resel is the image of the fiber face, pixels_per_resel wide along the dispersion direction (2.2 for the Bench, 6 / 5 / 2.5 for the CSHELL modes) and fiber_image_px high (circular by default), \(n_{pix}\) pixels in all.

Three quantities carry units you should keep straight:

  • \(N_*\) [e-/s per resel]: stellar electrons in the whole resel, summed over the array. Not divided by \(n_{pix}\).

  • \(N_{sky}\) [e-/s per pixel]: sky electrons per pixel.

  • \(D\) [e-/s per pixel] and \(RN\) [e- per pixel per read].

Per resel versus per pixel

Survey papers usually quote SNR per pixel. In the photon-limited regime

\[\mathrm{SNR}_{pixel} \approx \mathrm{SNR}_{resel} / \sqrt{n_{pix}},\]

so SNR 30 per resel is about SNR 20 per pixel on the Bench. Convert before comparing with LAMOST, SEGUE or SDSS numbers. Rebinning \(k\) adjacent resels of equal SNR to a lower resolution \(R/k\) raises the SNR by exactly \(\sqrt{k}\) in this noise model, because every variance term scales with the number of pixels (notebooks 04 and 07 use this for classification at R = 300).

The SNR equation

For a total exposure \(t\) split into \(n_{exp}\) reads (Howell 2006):

\[\mathrm{SNR} = \frac{N_* t}{\sqrt{N_* t + n_{pix}\,(N_{sky} + D)\,t + n_{pix}\,n_{exp}\,RN^2}}.\]

exptime inverts this quadratic for \(t\); snr evaluates it. n_exp means the total time is split into this many reads, not “this many exposures of this length”: the read noise is paid n_exp times and the per-read time is exptime / n_exp. Reads shorter than the instrument’s min_exptime are flagged in ETCResult.below_min_exptime.

Where the source throughput is zero (telluric cores in the bundled \(K_{opt}\) curve: any sample below KOPT_EPS = 1e-6, e.g. 687, 761, 1129 nm and the 1336 to 1424 nm water band, plus the interpolation intervals next to those samples) the bin is invalid: ETCResult.valid is False and snr/exptime are NaN rather than an enormous number. Medians and percentiles ignore those bins; at() never interpolates across them; the web API renders them as null.

Method names and result attributes

etc.exptime(source, snr=50) returns an ETCResult whose .exptime array is the answer and whose .snr array is the constant target. etc.snr(source, exptime=600) returns a result whose .snr is the answer and .exptime the constant input. result.solved_for says which one was solved, and result.plot() plots that one by default.

Limiting magnitude and sensitivity maps

Because \(N_* \propto 10^{-0.4 m}\), the SNR at fixed \((t, n_{exp})\) is a closed-form function of magnitude. limiting_magnitude() solves the quadratic for the magnitude that reaches a target SNR, snr_grid() evaluates the SNR on a (magnitude, exposure) grid and exptime_vs_mag() the exposure time along a magnitude axis. All three ignore source.mag (they use the shape only) and all three take the same wavelength selector:

wavelength

meaning

shape of the result

None

median over the whole grid

one number per grid point

float

the bin nearest that wavelength (must be on grid)

one number per grid point

(lo, hi)

median over the window

one number per grid point

"all"

no reduction

an extra wavelength axis

Telescope combination

Two ways the unit telescopes are combined, chosen by the fiber (see Telescope array):

  • combine="fiber" (18 um fibers through the 20-to-1 combiner): \(N_*\) and \(N_{sky}\) scale with \(N\), detector noise is paid once per combiner input. The gain is better than \(\sqrt{N}\) whenever detector noise matters.

  • combine="independent" (50 um fibers, one spectrum per telescope, co-added afterwards): \(\mathrm{SNR} = \sqrt{N}\,\mathrm{SNR}_1\) exactly.

Immutability

A LFASTETC precomputes the throughputs and the sky rate when it is built. Do not assign to etc.instrument, etc.telescope or etc.sky afterwards; build a new calculator. Building one costs a few milliseconds, so loops over array sizes or presets are cheap.