hispecdrp.primitives.utils.ccf.ccf_common
Shared CCF constants and small helpers used across mask / fit / grid modules.
Functions
|
Iterative sigma-clipped median — robust CCF continuum / background level. |
Continuum level with trapezoid-Δv weights. |
|
|
Minimum positive RV uncertainty (m/s) for numerical stability only. |
|
Trapezoid Δv weights (m/s) for a sorted velocity grid. |
|
Weighted median of |
|
Uniform RV trial grid in m/s (matches Numba chunk CCF grid spacing). |
|
Uniform RV trial grid spanning |
|
Number of CCF velocity samples per independent detector pixel. |
|
Finest positive velocity spacing (m/s) on |
|
Broad uniform CCF velocity grid (m/s); |
|
Per-pixel σ for centroiding blaze-corrected (or native) flux. |
- _ccf_background_sigma_clipped_median(y, *, n_sigma=3.0, max_iter=8, min_keep=5)[source]
Iterative sigma-clipped median — robust CCF continuum / background level.
- _ccf_background_sigma_clipped_median_dv_weighted(v_m_s, y, *, n_sigma=3.0, max_iter=8, min_keep=5)[source]
Continuum level with trapezoid-Δv weights.
Weighting by Δv restores a wing-dominated baseline on non-uniform grids and matches uniform-grid behaviour when spacing is constant.
- _ccf_rv_err_numeric_floor(v_step_m_s)[source]
Minimum positive RV uncertainty (m/s) for numerical stability only.
- _make_velocity_grid(v_min, v_max, v_step)[source]
Uniform RV trial grid in m/s (matches Numba chunk CCF grid spacing).
- _velocity_grid_from_window(vel_window, vel_step, vsys=0.0)[source]
Uniform RV trial grid spanning
vel_window(m/s) centered onvsys.
- ccf_oversample_nsp(pix_size_m_s, v_step_m_s)[source]
Number of CCF velocity samples per independent detector pixel.
Interpolated
CCF(v)on a grid finer thanΔv_pixreuses the same pixels, so Fisher / LM covariances that treat bins as i.i.d. must inflateσ_μby√nspwithnsp = max(Δv_pix / Δv_grid, 1).
- effective_ccf_v_step_for_fit(v_grid)[source]
Finest positive velocity spacing (m/s) on
v_gridfor CCF RV fits.
- resolve_ccf_broad_grid_m_s(v_min=None, v_max=None, v_step=None)[source]
Broad uniform CCF velocity grid (m/s);
Noneuses module defaults.
- science_centroid_spec_err(spec, spec_err, spec_uncal=None, spec_uncal_err=None)[source]
Per-pixel σ for centroiding blaze-corrected (or native) flux.
A multiplicative fiberflat / blaze error is almost entirely amplitude, not line centroid. When L1
spec_uncal/spec_uncal_errare present, map the science-extract relative error ontospec:σ = |spec| · |spec_uncal_err / spec_uncal|(equivalent to
σ_uncal / blaze). Fall back tospec_errwhere those arrays are missing or invalid.