lfast_etc.Instrument

class lfast_etc.Instrument(name: str, wavelength_min_nm: float, wavelength_max_nm: float, resolving_power: float, pixels_per_resel: float, spectrograph_efficiency: float, qe: object = 0.8, slit_throughput: float = 1.0, dark_current: float = 0.0, read_noise: float = 0.0, full_well: float | None = inf, min_exptime: float = 0.0, free_spectral_range_frac: float | None = None, description: str = '', fiber_image_px: float | None = None, profile: str = 'tophat')[source]

A spectrograph configuration.

All parameters are held constant with wavelength; qe may be a scalar or a callable qe(wavelength_nm) for a wavelength-dependent curve.

Parameters:
  • name (str)

  • wavelength_min_nm (float) – Bandpass covered by this configuration.

  • wavelength_max_nm (float) – Bandpass covered by this configuration.

  • resolving_power (float) – R = lambda / delta_lambda.

  • pixels_per_resel (float) – Pixels spanned by one resolution element along the dispersion direction (the width of the fiber image, or of the slit, in pixels).

  • fiber_image_px (float or None) – Spatial height of the fiber image on the detector in pixels at 1x1 binning. None (default) assumes a circular fiber image, i.e. pixels_per_resel; slit modes that narrow the dispersion direction only should set the native fiber-image height explicitly. Howell’s extraction aperture is n_pix = pixels_per_resel * fiber_image_px (#13); 1.0 reproduces the reference notebook’s dispersion-only count.

  • profile ({"tophat", "uniform", "gaussian"}) – Shape of the fiber image on the detector, used for the peak-pixel (saturation) estimate only (#19). "tophat" (default) is the image of the fiber face with a small camera blur; "uniform" is the pre-#19 convention (peak = 1 / n_pix); "gaussian" has the same FWHMs. Seeing does not enter: the fiber scrambles the input.

  • spectrograph_efficiency (float) – Spectrograph optical throughput (S_opt), excluding slit losses and QE.

  • slit_throughput (float) – Extra multiplicative throughput for slit modes (1 for the bare fiber). Applied to the sky as well as the source: the slit clips the uniformly illuminated fiber face, so both lose the same fraction.

  • qe (float or callable) – Detector quantum efficiency.

  • dark_current (float) – e-/s/pixel.

  • read_noise (float) – e-/pixel per read.

  • full_well (float) – e-/pixel saturation level (used for the saturation flag only). inf or None means unknown: nothing is flagged and ETCResult.summary()["saturated_fraction"] is None.

  • min_exptime (float) – Shortest exposure [s] for which read_noise applies (e.g. the Fowler-sampling minimum). Results flag reads shorter than this in ETCResult.below_min_exptime.

  • free_spectral_range_frac (float or None) – FSR / lambda for echelle instruments; a single setting covers only lambda * free_spectral_range_frac. Informational.

__init__(name: str, wavelength_min_nm: float, wavelength_max_nm: float, resolving_power: float, pixels_per_resel: float, spectrograph_efficiency: float, qe: object = 0.8, slit_throughput: float = 1.0, dark_current: float = 0.0, read_noise: float = 0.0, full_well: float | None = inf, min_exptime: float = 0.0, free_spectral_range_frac: float | None = None, description: str = '', fiber_image_px: float | None = None, profile: str = 'tophat') → None

Methods

__init__(name, wavelength_min_nm, ...[, qe, ...])

describe()

from_preset(preset, **overrides)

Load a bundled preset (see list_instruments()), optionally overriding any field (name included).

pixel_image()

Fiber image as per-pixel fractions of the resel's light (see pixel_image()).

plot_profile([ax])

Draw the pixelated fiber image with the peak fraction and n_pix.

qe_at(wavelength_nm)

replace(**changes)

Copy with some fields changed (dataclasses.replace).

setting_window(center_nm)

(lo, hi) [nm] covered by one setting centred on center_nm.

Attributes

dark_current

description

efficiency

Spectrograph efficiency including slit losses (S_opt * slit_throughput).

fiber_image_px

free_spectral_range_frac

full_well

min_exptime

n_pix

pixels_per_resel * spatial_px pixels per resel.

peak_fraction

Fraction of a resel's light in its brightest pixel for this profile.

profile

qe

read_noise

slit_throughput

spatial_px

pixels_per_resel).

name

wavelength_min_nm

wavelength_max_nm

resolving_power

pixels_per_resel

spectrograph_efficiency