Stellar RV primitive (L2)

The HISPEC DRP supports two cross-correlation based stellar radial-velocity (RV) algorithms dispatched by StellarRVPrimitive:

ccf_stellar_template

Cross-correlate an observed spectrum against a (rest-frame) template spectrum in \(\ln\lambda\) and fit the CCF peak to estimate RV.

ccf_line_mask

Cross-correlate an observed spectrum against a line mask (a weighted list of line locations, optionally with finite widths), producing a mask statistic as a function of trial velocity and fitting its peak to estimate RV.

For line-mask file formats, MaskLines conventions, and template-to-mask generation, see Line masks.

For shared CCF machinery (template and mask-line paths, peak fitting, and deriving RV from a CCF curve in ccf_utils), see Cross-correlation (CCF).

Primitive overview and references

At a high level, StellarRVPrimitive:

  • reads SPEC_FIB*, SPEC_ERR_FIB*, SPEC_DQ_FIB*, and WAVE_FIB* from the input L2 model,

  • runs the selected algorithm per fiber and (optionally) a subset of echelle orders,

  • writes RVCCF_FIB* / RVCCFAVG_FIB* (and optional CCF supplement columns) on the output L2 clone, and

  • optionally writes/opens Plotly previews and overlay-debug HTML via hispecdrp.primitives.stellar_rv.previews.stellar_rv_preview.

The ccf_line_mask implementation is inspired by public mask-line CCF descriptions and open code in the community; HISPEC DRP does not ship Keck KPF pipeline source.

References

Units and conventions

  • Velocities: internally, RVs and CCF velocity axes are in m/s across both algorithms. Some preview surfaces may display km/s for readability (labels/hover text), but stored values and primitive inputs/outputs remain m/s unless explicitly documented otherwise.

  • Wavelengths: wavelength arrays and chunk centers are in micron (µm), and chunk sizing uses window_size_um (µm).

  • Tables: outputs are written to RVCCF_FIB* (per-chunk) and RVCCFAVG_FIB* (fiber summary). Column units follow the table schema (typically RV in m/s and wavelength in µm).

RV tables and data storage (RVCCF)

L2 datamodel formatting (code references)

The RV tables are defined as L2 datamodel extensions in hispecdrp.datamodels.extensions. The helper create_rv_extensions() maps these HDU schemas to the fiber-specific HDU names (e.g. RVCCF_FIB1).

The canonical column definitions are the module-level dictionaries:

  • RVCCF_HDU

  • RVCCFAVG_HDU

The stellar RV primitive writes two main product tables per fiber:

RVCCF_FIB*

Per-chunk measurements. Each row corresponds to a wavelength chunk (or line-window segment when line-by-line chunking is used). The table includes:

  • RV / RV_ERR: per-chunk RV estimate and uncertainty (m/s)

  • ORDER: echelle order number

  • WAVELENGTH: chunk center wavelength (µm)

  • INLIER: robust inlier mask used for aggregation

  • optional CCF supplement columns (velocity axis metadata and CCF arrays) when enabled

RVCCFAVG_FIB*

Aggregate RV and uncertainty for the fiber. The RV combination uses robust outlier rejection (median/MAD) followed by an inverse-variance weighted mean; the reported uncertainty is \(\\max(\\sigma_{\\mathrm{IVW}},\\,\\mathrm{MAD}/\\sqrt{N})\). In the infinite-S/N limit this converges to the empirical MAD/√N floor.

For details of the combination logic, see combine_rv_estimates_median_mad_weighted().

Preview plots

The pipeline provides two preview surfaces:

Unified Plotly preview

The standard stellar-RV preview (RV vs wavelength, CCF + Gaussian fits, residuals) is produced by create_stellar_rv_preview().

Overlay debug HTML

Interactive spectrum + CCF overlay HTML for debugging mask-line (and template) behavior. For ccf_line_mask, the spectrum panel shows the observed spectrum with shifted mask segments, and a dense Lagrange-interpolated spectrum trace using the same interpolation order as the mask CCF.

The overlay debug page is written by write_mask_overlay_debug_pages().

Workflow outline (ccf_line_mask)

This is a high-level outline of what StellarRVPrimitive does when algorithm="ccf_line_mask" for one fiber (the template-CCF algorithm follows a different path).

  1. Entry point

    _run_algorithm_ccf_line_mask() resolves coarse velocity grid defaults (v_min_coarse, v_max_coarse, v_step_coarse), optional centered-window configuration around ccf_input_velocity (v_half_window), loads mask lines once, then calls the fiber driver:

  2. Velocity axis

    The fiber driver constructs a uniform velocity grid:

    • ccf_input_velocity ± v_half_window at v_step_coarse when a center is set.

    When ccf_input_velocity is unset, an auto-center scout runs one pass on the broad uniform grid to estimate the peak, then rebuilds a centered uniform window for the fiber.

  3. Per-order chunking and mask CCF

    For each echelle order in do_orders, the driver computes wavelength chunks:

    The per-order worker calls:

    which runs the Numba kernel over all chunks (parallel prange over chunk index when applicable):

    producing per-chunk arrays CCF(v) and (when requested) ccf_err(v).

  4. Per-chunk RV and uncertainty

    Per-chunk RVs come from a Gaussian fit to the (stored-convention) CCF:

    The reported chunk RV / RV_ERR are the Gaussian centroid and its photon-weighted Gaussian uncertainty (interpolated science-pixel errors, oversampling-corrected). Fiberflat / blaze terms in SPEC_ERR are not used as independent CCF-bin noise. Per-chunk RV_ERR decreases with S/N and converges to a numerical floor in the noiseless limit. A discrete-peak Numba seed may be used only when the Gaussian fit does not succeed.

    CCF sign convention: stored CCF rows (RVCCF / preview slots) follow the negated convention so the absorption-like feature appears as a peak near the true RV (see LINE_MASK_CCF_STORED_NEGATED_FROM_RAW).

  5. Fiber-level aggregation

    Chunk-level estimates are robustly combined into a fiber RV using:

    with fallback to per-chunk MAD rejection + inverse-variance mean when needed.

  6. Previews and RVCCF supplement

    When previews are requested, the driver builds preview slots and runs per-slot Gaussian/refine:

    When requested for table outputs, the primitive may also build RVCCF supplement columns:

Additional notes (primitive behavior and details)

  • Default coarse CCF step: when v_step_coarse is unset, the default coarse step is 50 m/s (ccf_common.V_STEP_DEFAULT_M_S). Very long velocity grids may be subsampled inside fit_ccf_rv() to keep fitting robust and fast.

  • Overlay debug HTML chunking and gating: the mask/template overlay debug pages list wavelength chunks (matching window_size_um chunking, or line-by-line Voronoi bins when window_line_by_line=True) and gate chunk inclusion with ccf_min_good_pixels and data quality flags (e.g. DO_NOT_USE), consistent with the underlying chunk drivers.

  • Overlay embedded array downsampling (display-only): for the overlay debug preview HTML only, embedded arrays (spectrum / CCF / template traces) are downsampled before being written into the page to keep file sizes reasonable. This affects what is plotted in the browser, not the underlying pipeline arrays or RVCCF products. Limits are controlled by the environment variables HISPEC_DRP_MASK_OVERLAY_SPECTRUM_MAX_POINTS, HISPEC_DRP_MASK_OVERLAY_CCF_MAX_POINTS, and HISPEC_DRP_TEMPLATE_OVERLAY_MAX_TEMPLATE_POINTS (see stellar_rv_preview).

  • Dense interpolated spectrum trace in overlay debug HTML: the overlay debug page always includes a dense Lagrange-interpolated spectrum trace using the same interpolation order as the mask CCF (mask_ccf_pixel_interp_order). See “Preview plots” above for the dense grid formula.

  • Overlay initial velocity: the overlay page’s initial velocity matches finite ccf_input_velocity when set; otherwise it defaults to 0 m/s.

Unit tests and command-line overrides

The main integration tests for stellar RV live in tests/stage2/test_stellar_rv_primitive.py.

Useful command-line / environment overrides used by these tests include:

HISPEC_DRP_SHOW_BSPEC_BTSETTL_PREVIEWS=1

Single switch for optional stellar-RV previews in tests/stage2/test_stellar_rv_primitive.py: after BT-Settl BSPEC integration tests, write and open preview HTML (mask-overlay + unified Plotly for ccf_line_mask, and unified Plotly + template-overlay HTML for ccf_stellar_template when that optional leg runs). Also enables the unified Plotly preview in test_stellar_rv_primitive_recovers_rv_per_chunk. Forces HTML-only behavior for the unified Plotly preview (skips Kaleido PNG export when this env is set; see hispecdrp.primitives.stellar_rv.previews.stellar_rv_preview). When unset, those optional preview legs are skipped.

HISPEC_DRP_MASK_CCF_PIXEL_INTERP_ORDER=<int>

Override the mask CCF interpolation order used by the tests (and reflected in the overlay debug spectrum interpolation trace label).

HISPEC_DRP_BSPEC_BTSETTL_ORDER

Which BSPEC echelle orders the BT-Settl BSPEC tests use. Default when unset is 139 (single order). Set to all to use every BSPEC order from HISPECConfig (same as the former HISPEC_DRP_BSPEC_BTSETTL_ALL_ORDERS=1). Otherwise a comma-separated list of integer echelle orders (e.g. 139,140).

HISPEC_DRP_BSPEC_BTSETTL_WINDOW_UM=<float>

Override the chunk width (µm) used in the BT-Settl BSPEC tests.

HISPEC_DRP_BSPEC_BTSETTL_RELAX_PARALLEL_ASSERTS=1

Relax strict RV recovery / benchmark assertions for exploratory runs (previews still run).

See also

API references

class StellarRVPrimitive(dataset=None, config=None, context=None, log_config=None, parent=None, **kwargs)[source]

Bases: BasePrimitive

Cross-correlate L2 spectra against a template or a line mask to measure RV.

Algorithms

  • ccf_line_mask (default) — mask-shifted CCF using a line mask (SPIROU .mas or two-column center+weight tables; see line_mask_utils). Per-chunk CCFs use Numba Lanczos / linear spectrum sampling (rv_per_chunks_line_mask() / mask_ccf_pixel_interp_order; default Lanczos-3); final RVs are Gaussian centroids from fit_ccf_rv().

  • ccf_stellar_template — weighted CCF in \(\ln\lambda\) against a stellar template; per-chunk RVs; median/MAD rejection; inverse-variance mean (ccf_utils).

All constructor arguments list their default from PARAMETERS; override per run as needed. Order matches the grouped layout in PARAMETERS.

Parameters:
  • suffix (str) – Default: "stellar_rv". Short label used by the framework for this primitive’s derived products, logging, and file naming together with output_dir.

  • algorithm (str) – Default: "ccf_line_mask". Must be a key of STELLAR_RV_ALGORITHMS. Chooses _run_algorithm_ccf_line_mask (line-mask CCF, no PHOENIX template) or _run_algorithm_ccf_stellar_template (log-λ template CCF).

  • do_fibers (sequence of str or None) – Default: None. Which fiber indices to process (e.g. ["1","2"]). None uses get_do_traces() / recipe defaults for the input model.

  • do_orders (sequence of int or None) – Default: None. Echelle order numbers (not row indices) to include. None selects all orders handled by the same L2 helper as sibling primitives (subject to config / model).

  • template_path (str or None) – Default: None. Path to a stellar template spectrum on disk for ccf_stellar_template. Passed to resolve_stellar_template_to_log_micron() with template_wavelength / template_flux when those are set.

  • template_wavelength (array-like or None) – Default: None. In-memory template wavelength grid (µm). Used with template_flux when you do not load from template_path.

  • template_flux (array-like or None) – Default: None. Template flux samples matching template_wavelength (same length).

  • mask_path (str or None) – Default: None. Path to a SPIROU .mas or KPF-style two-column mask file for ccf_line_mask (delta-line model). None resolves to the packaged lte049 ccfopt delta mask (see packaged_default_line_mask_path()) via resolve_mask_path() when you are not passing mask_wavelength / mask_weight.

  • mask_wavelength (array-like or None) – Default: None. In-memory mask rest wavelengths (µm) for ccf_line_mask. Must be paired with mask_weight; when both are set, mask_path is not required for loading.

  • mask_weight (array-like or None) – Default: None. Weights matching mask_wavelength (same length).

  • mask_ccf_pixel_interp_order (int) – Default: 3. Mask algorithm only: Lanczos parameter a (1 = linear; 3 = Lanczos-3 windowed-sinc in pixel-index space) for sampling flux and the per-pixel gate onto Doppler-shifted mask-line wavelengths in _calc_mask_ccf_chunks_numba(). Values are clamped to [1, ccf_utils.MAX_MASK_CCF_PIXEL_INTERP_ORDER]. Values greater than 1 use Lanczos-a (not historical Lagrange polynomials).

  • window_size_um (float) – Default: 0.25. Approximate wavelength span (µm) of each chunk along an order: spectra are split into contiguous bins of roughly this width for per-chunk RVs (template algorithm) or mask CCF chunking (mask algorithm).

  • outlier_sigma (float) – Default: 3.0. Multiplier for error-aware chunk rejection before the inverse-variance weighted mean: keep chunks with |RV − center| <= outlier_sigma * max(MAD, σ_i) (see combine_stellar_rv_chunk_estimates()).

  • chunk_rv_max_abs_m_s (float) – Default: 120000.0 (120 km s−1). Per-chunk RVs with |RV| above this limit are excluded before aggregation (coarse-grid CCF alias peaks). Set very large to disable. Ignored when ccf_input_velocity is set (prior gate used instead).

  • chunk_rv_prior_half_width_m_s (float or None) – Default: None. When ccf_input_velocity is set, keep only chunks with |RV − ccf_input_velocity| <= half_width before aggregation. None uses max(2000, 0.5 × v_half_window) m/s.

  • window_line_by_line (bool) – Default: True. Line-mask algorithm only (ccf_line_mask). Ignored for ccf_stellar_template (that path always chunks on window_size_um). When False, chunk boundaries follow window_size_um via ccf_order_n_chunks_for_span(). When True, each mask line defines its own wavelength chunk (Voronoi bins in observed λ at ccf_input_velocity, which must be finite — grid center). Spectral pixels per chunk use the intersection of that Voronoi interval with a symmetric window_size_um band; see build_line_mask_chunk_wavelength_intervals_line_by_line().

  • v_min_coarse (float or None) – Default: None. Broad uniform CCF lower bound (m/s) when no center is set (scout / full-range search). None → V_MIN_DEFAULT_M_S.

  • v_max_coarse (float or None) – Default: None. Broad uniform CCF upper bound (m/s). None → V_MAX_DEFAULT_M_S.

  • v_step_coarse (float or None) – Default: 25.0. Uniform velocity sampling (m/s) for both the broad and centered grids. None → V_STEP_DEFAULT_M_S.

  • ccf_input_velocity (float or None) – Default: None. If set (m/s), the CCF uses a uniform window centered here: [ccf_input_velocity − v_half_window, ccf_input_velocity + v_half_window] at v_step_coarse. If None, a scout pass on the broad uniform grid estimates the peak, then the fiber is evaluated on a centered window (v_half_window at v_step_coarse).

  • v_half_window (float) – Default: 15000.0. Half-width (m/s) of the centered uniform velocity window (±this value around ccf_input_velocity or the auto-scout center).

  • ccf_zb (float) – Default: 0.0. Both algorithms: barycentric factor \(z_b\). For ccf_line_mask it enters \(\lambda_{\rm obs} = \lambda_{\rm rest}(1+v/c)/(1+z_b)\) (zb in run_ccf_line_mask_for_fiber() / rv_per_chunks_line_mask()). For ccf_stellar_template it applies the same multiplicative shift in \(\ln\lambda\) template evaluation as in _ccf_chunk_ccf_numba(). Set by the caller or pipeline (e.g. Stage2Pipeline populates this from BARYCORR BERV when not overridden).

  • ccf_min_good_pixels (int) – Default: 9. Both algorithms: minimum unmasked finite spectral pixels per wavelength chunk (chunking from window_size_um via ccf_order_n_chunks_for_span(), or from window_line_by_line Voronoi bins) required to form a CCF and fit an RV. For ccf_line_mask this is min_good_pixels in rv_per_chunks_line_mask(); for ccf_stellar_template it gates the Numba per-chunk CCF and the Python per-chunk fit. Overlay debug HTML uses the same threshold for chunk inclusion.

  • output_model (str) – Default: "L2Model". Datamodel type name passed to get_output_model() when cloning the input to attach RVCCF tables.

  • max_cores (int or None) – Default: None. Upper bound on parallel Numba threads: template path uses it for echelle-order parallelism; mask path passes it to run_ccf_line_mask_for_fiber() / chunk loops. None lets resolve_numba_threads() pick a host-appropriate count; 1 forces single-threaded, reproducible runs.

  • debug_ccf (bool) – Default: False. Extra logging and diagnostics. For ccf_stellar_template, forces the slower non-Numba CCF path instead of the parallel driver.

  • preview_write_png (bool) – Default: True. When save_preview is True, also write a stacked Kaleido PNG alongside the HTML preview. Set False for large line-mask runs (many CCF slots) where PNG export can take minutes or hang in headless Chrome.

  • preview_png_scale (float) – Default: 2.0. Pixel scale multiplier for Kaleido PNG exports when save_preview and preview_write_png are True (see stellar_rv_preview).

  • show_overlay_debug (bool) – Default: False. For ccf_line_mask, open mask-overlay debug HTML in a browser; for ccf_stellar_template, open template-overlay debug HTML. Meaning follows algorithm.

  • save_overlay_debug (bool) – Default: False. For ccf_line_mask, write mask-overlay HTML (_output["mask_overlay_debug"]); for ccf_stellar_template, write template-overlay HTML (_output["template_overlay_debug"]).

_combine_chunk_rvs(all_rvs, all_rv_errs, *, fiber)[source]

Robust per-fiber aggregate from chunk RV arrays (sanity gate + MAD + weighted mean).

Returns (inlier_mask, rv_mean_m_s, rv_std_m_s).

_create_preview()[source]
static _get_spectrograph(input_model)[source]

Return spectrograph name from model metadata.

Parameters:

input_model (DataModel) – Input data model with meta.spectrograph.

Returns:

str – “BSPEC” or “RSPEC” if present in metadata; otherwise “BSPEC”.

_process_fiber(input_model, output_model, fiber, spectrograph, do_orders, order_vec, template_ln, template_flux)[source]

Run the configured stellar RV algorithm for one fiber and write RVCCF/RVCCFAVG.

Dispatches to the algorithm named in self.algorithm (see STELLAR_RV_ALGORITHMS). The algorithm returns per-chunk arrays, aggregate RV, and optional per-chunk CCF supplement columns; this method writes RVCCF_FIB{fiber} (merged RV + CCF) and RVCCFAVG_FIB{fiber} to the output model.

Parameters:
  • input_model (DataModel) – Open L2 (or compatible) model with per-fiber SPEC_FIB* / WAVE_FIB* (and optional ERR/DQ). Used to read science data for the chosen fiber.

  • output_model (DataModel) – Cloned L2 output; receives Astropy tables on attributes rvccf_fib* / rvccfavg_fib* (framework naming).

  • fiber (str) – Fiber id string, e.g. "1", matching attribute suffixes _FIB1.

  • spectrograph (str) – "BSPEC" or "RSPEC" from metadata; stored in RV tables for downstream.

  • do_orders (list of int) – Echelle order numbers to include in the CCF (subset of order_vec).

  • order_vec (list of int) – Map from echelle row index to physical order number (one entry per spectral row).

  • template_ln (np.ndarray) – Natural log of template wavelength in microns; used by template algorithm. For ccf_line_mask this is an empty placeholder array.

  • template_flux (np.ndarray) – Template flux aligned with template_ln; empty for mask-only algorithm.

_process_fiber_orders(order_tasks, wave, spec, err, dq, do_not_use, template_ln, template_flux, fiber, *, mode, max_cores=None, want_preview=False, v_min_m_s=-500000.0, v_max_m_s=500000.0, v_step_m_s=50.0, ccf_center_m_s=None, ccf_half_window_m_s=20000.0)[source]

Single driver for per-order chunk RVs: mode is debug (Python masked_ccf_rv per chunk) or parallel (Numba). When want_preview is True, the parallel path reuses the flat CCF stack for the preview dict; debug + preview uses build_ccf_preview_dict() with kind="spectra_orders".

Parameters:
  • order_tasks (list of tuple) – (row_index, order_number) for each echelle row to process (already filtered by do_orders).

  • wave (np.ndarray) – 2D echelle data for the fiber: wavelength, flux, error, and DQ (same shape).

  • spec (np.ndarray) – 2D echelle data for the fiber: wavelength, flux, error, and DQ (same shape).

  • err (np.ndarray) – 2D echelle data for the fiber: wavelength, flux, error, and DQ (same shape).

  • dq (np.ndarray) – 2D echelle data for the fiber: wavelength, flux, error, and DQ (same shape).

  • do_not_use (int) – DQ bitmask for pixels to exclude from CCF (typically DQ_FLAGS["DO_NOT_USE"]).

  • template_ln (np.ndarray) – Template in log(µm) and flux for CCF (same length).

  • template_flux (np.ndarray) – Template in log(µm) and flux for CCF (same length).

  • fiber (str) – Fiber id for logging.

  • mode (str) – "debug" (verbose diagnostics) or "parallel" (Numba).

  • max_cores (int or None, optional) – Effective thread count for parallel mode (already resolved/capped).

  • want_preview (bool, optional) – Whether to build the mean + per-order CCF preview structure for Plotly.

  • v_min_m_s (float, optional) – Uniform CCF velocity axis (m/s): broad search from the primitive’s v_min_coarse / v_max_coarse / v_step_coarse (after defaults). When ccf_center_m_s is set, v_step_m_s samples the centered window.

  • v_max_m_s (float, optional) – Uniform CCF velocity axis (m/s): broad search from the primitive’s v_min_coarse / v_max_coarse / v_step_coarse (after defaults). When ccf_center_m_s is set, v_step_m_s samples the centered window.

  • v_step_m_s (float, optional) – Uniform CCF velocity axis (m/s): broad search from the primitive’s v_min_coarse / v_max_coarse / v_step_coarse (after defaults). When ccf_center_m_s is set, v_step_m_s samples the centered window.

  • ccf_center_m_s – When ccf_center_m_s is not None, build a uniform window via build_centered_uniform_velocity_grid() (ccf_input_velocity, v_half_window, v_step_coarse on the primitive).

  • ccf_half_window_m_s – When ccf_center_m_s is not None, build a uniform window via build_centered_uniform_velocity_grid() (ccf_input_velocity, v_half_window, v_step_coarse on the primitive).

Returns:

tuple – (all_rvs, all_rv_errs, all_wavelengths, all_orders, preview_detail, rvccf_chunk_supplement) — lists of per-chunk quantities (same length), optional preview dict, and optional CCF supplement table (merged into RVCCF_FIB* by _write_rv_tables).

_resolve_chunk_rv_prior_half_width_m_s()[source]

Half-width (m/s) for prior-gated chunk aggregation when a CCF center is set.

_run_algorithm_ccf_line_mask(input_model, output_model, fiber, spectrograph, do_orders, order_vec, template_ln, template_flux)[source]

Line-mask CCF (SPIROU/KPF-inspired) + Gaussian RV fit.

Minimal delegation to run_ccf_line_mask_for_fiber().

_run_algorithm_ccf_stellar_template(input_model, output_model, fiber, spectrograph, do_orders, order_vec, template_ln, template_flux)[source]

Stellar-template cross-correlation + median/MAD + inverse-variance weighted mean.

Cross-correlates the stellar template spectrum to the input spectrum in log(wavelength), producing per-chunk RVs (debug Python or Numba-parallel). Chunk RVs are combined with median/MAD outlier rejection and a weighted mean; CCF curves may be stored for the preview. Returns the standard 6-tuple for _write_rv_tables.

Returns:
  • all_wavelengths (np.ndarray) – Chunk center wavelengths (µm).

  • all_rvs (np.ndarray) – Per-chunk RV (m/s).

  • all_rv_errs (np.ndarray) – Per-chunk RV uncertainty (m/s).

  • inlier (np.ndarray) – Boolean mask of chunks used for the aggregate.

  • rv_mean (float) – Aggregated RV (m/s).

  • rv_std (float) – Uncertainty of the aggregated RV (m/s).

_write_rv_tables(output_model, fiber, spectrograph, wavelengths, rvs, rv_errs, rv_agg, rv_agg_err, inlier=None, orders=None, *, rvccf_chunk_supplement=None)[source]

Write RVCCF_FIB{fiber} (per-chunk RV plus optional CCF columns) and RVCCFAVG_FIB{fiber}.

Creates table extensions on the output L2 model with per-chunk RVs and the aggregated RV (mean and std). All velocities are in m/s.

Parameters:
  • output_model (DataModel) – L2 output model to update.

  • fiber (str) – Fiber number (e.g. “1”).

  • spectrograph (str) – “BSPEC” or “RSPEC”.

  • wavelengths (np.ndarray) – Chunk center wavelengths (µm).

  • rvs (np.ndarray) – Per-chunk radial velocity (m/s).

  • rv_errs (np.ndarray) – Per-chunk RV uncertainty (m/s).

  • rv_agg (float) – Aggregated RV (e.g. weighted mean) in m/s.

  • rv_agg_err (float) – Uncertainty of the aggregated RV in m/s.

  • inlier (np.ndarray, optional) – Boolean mask of chunks used for the aggregate; used for table only.

  • orders (np.ndarray, optional) – Echelle order number per chunk (same length as rvs). -1 if unknown.

static resolve_ccf_zb_for_fiber(primitive, input_model, fiber)[source]

Return the uniform CCF \(z_b\) for previews and overlays.

fiber is accepted for API compatibility; all fibers share primitive.ccf_zb.