# Configuration ## CalibrationConfig Pipeline-level configuration controlling mode, PWV fitting strategy, and feature flags. **Source:** `cal-core/src/config.rs` ```{eval-rst} .. list-table:: :header-rows: 1 :widths: 22 12 12 54 * - Field - Type - Default - Description * - ``obs_mode`` - ObsMode - Auto - Observation mode (auto-detected if Auto) * - ``pwv_source`` - PwvSource - FitGridRefine - PWV retrieval strategy * - ``pwv_initial_guess`` - f64 - 1.0 - Initial PWV guess for fitting (mm) * - ``pwv_grid_min`` - f64 - 0.001 - Minimum PWV in grid search (mm) * - ``pwv_grid_max`` - f64 - 10.0 - Maximum PWV in grid search (mm) * - ``pwv_grid_steps`` - usize - 100 - Number of grid search points * - ``pwv_per_pixel`` - bool - false - Fit PWV independently per pixel * - ``clip_tsys`` - f64 - 200.0 - Bad channel T_rec threshold multiplier (K) * - ``clip_counts`` - f64 - 0.01 - Minimum hot-cold count ratio * - ``eta_fss`` - f64 - 1.0 - Forward scattering efficiency * - ``eta_mb`` - f64 - 1.0 - Main beam efficiency * - ``gain_el_correction`` - f64 - 1.0 - Elevation-dependent gain correction * - ``n_threads`` - Option - auto - Rayon thread pool size * - ``physics`` - PhysicsConstants - KalibrateCompat - Physics constants precision * - ``dbs_adhesive`` - bool - false - Enable DBS adhesive beam coupling for OtfChopped mode * - ``gain_interpolate`` - u8 - 0 - Gain drift correction level (0=off, 2=correct ON, 3=correct ON+OFF) * - ``skydiff`` - u32 - 0 - SKY-DIFF diagnostic depth (0=off, N=diff against N most recent OFFs) * - ``skychopdiff`` - bool - false - SKYCHOPDIFF diagnostic: chop-phase diffs of the sky in chopped scans ``` ## CalibrationParams Instrument-level calibration parameters that travel with every scan. Groups per-instrument values with per-load thresholds and physics mode, eliminating loose `f64` parameters from pipeline function signatures. Constructed via `CalibrationParams::from_config(config, foeff, gain_image)`. **Source:** `cal-core/src/config.rs` ```{eval-rst} .. list-table:: :header-rows: 1 :widths: 22 12 12 54 * - Field - Type - Default - Description * - ``foeff`` - f64 - 0.97 - Forward efficiency (eta_fss) * - ``gain_image`` - f64 - 0.5 - Image sideband gain ratio (0.0--1.0); signal gain = 1 - gain_image * - ``clip_tsys`` - f64 - 200.0 - T_sys clipping threshold for bad channel detection (K) * - ``clip_counts`` - f64 - 0.01 - Minimum hot-cold count ratio for bad channel detection * - ``physics`` - PhysicsConstants - KalibrateCompat - Physical constants mode ``` `CalibrationLoad` constructors (`new`, `new_with_load_temps`) accept `&CalibrationParams` rather than separate `foeff`/`gain_image`/`physics` arguments. ## ObsMode ```{eval-rst} .. list-table:: :header-rows: 1 :widths: 25 25 50 * - Variant - CLI value - Description * - ``Auto`` - ``auto`` - Auto-detect from data * - ``TotalPower`` - ``totalpower``, ``tp`` - Position-switched ON/OFF * - ``OtfTotalPower`` - ``otf``, ``otf_totalpower`` - On-the-fly scanning * - ``OtfChopped`` - ``otf-chopped`` - OTF with dual beam switch (OTFSWA/OTFSWB) * - ``FrequencySwitch`` - -- - Stubbed: frequency-switched reference * - ``BeamSwitch`` - -- - Stubbed: standalone beam-switched reference ``` ## PwvSource ```{eval-rst} .. list-table:: :header-rows: 1 :widths: 25 75 * - Variant - Description * - ``FitGridRefine`` - Grid search (100 points) + Newton refinement (5 iterations) * - ``FitLM`` - Levenberg-Marquardt least-squares (fallback) * - ``External(f64)`` - Fixed PWV value in mm (no fitting) ``` ## PhysicsConstants ```{eval-rst} .. list-table:: :header-rows: 1 :widths: 25 30 45 * - Variant - :math:`h/k_B` - Notes * - ``Exact`` - SI 2019, f64 - Full precision * - ``KalibrateCompat`` - 0.047995 K/GHz, f32 truncation - **Default** -- legacy parity mode ```