Instruments and presets ======================= An :class:`~lfast_etc.Instrument` is a spectrograph configuration: bandpass, resolving power, pixels per resel, optical efficiency, slit loss, and the detector (QE, read noise, dark current, full well, shortest read). Presets are TOML files in ``src/lfast_etc/data/config``. .. code-block:: python from lfast_etc import Instrument, list_instruments list_instruments() ins = Instrument.from_preset("cshell_r43000", slit_throughput=0.6) # override any field ins2 = ins.replace(read_noise=10) # copy with changes ins.describe() Bundled presets --------------- Generated from the TOML files when the documentation is built. .. include:: _generated/presets.rst **WIYN Bench.** ``bench_r1800`` is the reference-notebook configuration (600 l/mm grating at 10.1 deg, order 1). The other ``bench_*`` presets are the rows of the `WIYN Bench configuration table `_ that reach 400 nm, generated by ``scripts/build_bench_presets.py``: R keeps the table's ratio to the anchor row, the spectrograph efficiency scales with the grating's peak efficiency relative to 72%, and everything else is the anchor's placeholder. The table's resolutions are for the WIYN red fiber cable at 2x2 binning, so these are scalings, not LFAST measurements. Wavelength ranges are clipped to the 400-1800 nm throughput curves; ``bench_r1800`` stops at 686 nm because :math:`K_{opt}` drops to 5e-9 at the 687 nm O\ :sub:`2` band. **Bench detector and gain.** The Bench presets describe the WIYN STA1 CCD (`characteristics `_): 2600 x 4000 pixels of 12 um, an 18-bit ADC and three gain modes. The presets assume **medium gain**; switch modes by overriding both ``read_noise`` and ``full_well`` (at high gain the ADC clips before the well fills). ==================================== ======= ============ ============== =========================== gain mode e-/DN read noise ADC limit binding limit ==================================== ======= ============ ============== =========================== high 0.219 3.2 e- 57,400 e- ADC (1% linearity 63,000 e-) medium (preset) 0.438 3.7 e- 114,800 e- full well 87,500 e- low 0.876 4.3 e- 229,600 e- full well 87,500 e- ==================================== ======= ============ ============== =========================== **CSHELL.** Three modes: the bare fiber at R = 18,000 and the 200 um and 100 um slits at R = 21,500 and 43,000. The slit throughputs are placeholders (0.75 and 0.5) until measured. The free spectral range is about :math:`2.5\times10^{-3}\lambda`, so one setting is 27 to 44 A wide; pass ``wavelength_min_nm``/``wavelength_max_nm`` to :class:`~lfast_etc.LFASTETC` for the setting you care about. Reads shorter than 8 s (the Fowler-sampling minimum) are flagged. Preset fields ------------- All under ``[instrument]`` in the TOML file: ==================================== ============================================================= field meaning ==================================== ============================================================= ``name``, ``description`` strings; ``description`` is shown in the web app ``wavelength_min_nm``, ``_max_nm`` bandpass of the configuration. An explicit range passed to ``LFASTETC`` is clipped to it. ``resolving_power`` :math:`R = \lambda/\delta\lambda` ``pixels_per_resel`` pixels spanned by one resel along the dispersion direction ``fiber_image_px`` spatial height of the fiber image in pixels at 1x1 binning; ``None`` means circular (= ``pixels_per_resel``). Howell's :math:`n_{pix}` is the product (:ref:`aperture`) ``profile`` ``"tophat"`` (default), ``"uniform"`` or ``"gaussian"``: the fiber-image shape for the peak-pixel estimate (:ref:`aperture`) ``spectrograph_efficiency`` optical throughput of the spectrograph, excluding QE and slit ``slit_throughput`` extra factor for slit modes (1 for the bare fiber) ``qe`` detector QE, a number in TOML; in Python also a callable ``qe(wavelength_nm)`` for a curve ``dark_current`` e-/s/pixel ``read_noise`` e-/pixel per read ``full_well`` e-/pixel, used only for the saturation flag ``min_exptime`` shortest read [s] for which ``read_noise`` holds (flagged, not enforced) ``free_spectral_range_frac`` FSR / :math:`\lambda` for echelles (informational) ==================================== ============================================================= Efficiencies must lie in (0, 1]; every other field is validated as a positive number. Adding a preset --------------- Copy a TOML file, change the numbers, drop it next to the others; it appears in ``list_instruments()`` without code changes. For a configuration that is not an LFAST instrument, keep the throughput conventions of :doc:`physics` in mind: ``spectrograph_efficiency`` is the spectrograph alone, since the telescope and fiber are in :math:`K_{opt}`. .. plot:: :include-source: True fig, ax = plt.subplots(figsize=(9, 3.6)) LFASTETC("bench_r1800").plot_throughput(ax=ax) ax.set_title("bench_r1800: telescope, fiber, spectrograph x QE, end to end", fontsize=9)