hispecdrp.primitives.utils.ccf.ccf_spline

Cubic-spline mask CCF utilities (point-sampled delta lines on the spectrum).

Functions

_compute_ccf_spline(wave, spec, spec_err, ...)

Numba core for compute_ccf_spline().

_doppler_shift_scalar(lam, vel, zb)

_interp_var_linear(wave, var, xq)

Linearly interpolate variance at xq; non-positive values yield +inf.

_line_lands_in_spectrum(line_center, ...)

True if the line is a valid CCF contributor at vel.

compute_ccf_spline(wave, spec, spec_err, ...)

Cross-correlation of a spectrum with delta-function mask lines via cubic spline sampling.

compute_ccf_spline(wave, spec, spec_err, spec_dq, line_centers, line_weights, vel_window=None, vel_step=None, zb=0.0, vsys=0.0, use_variance=True, vel_grid=None, line_set_velocity=None)[source]

Cross-correlation of a spectrum with delta-function mask lines via cubic spline sampling.

Each mask line is a rest-frame delta with weight line_weights[j]. At trial velocity v the line center is Doppler-mapped as \(\lambda_{\rm obs} = \lambda_{\rm rest}(1+v/c)/(1+z_b)\) and the spectrum flux is read by not-a-knot cubic spline interpolation on good pixels (dq=0).

When line_set_velocity is finite (the input / prior RV; use 0 when the caller wants rest-frame membership), the contributing line set is frozen there and \(W=\sum_j w_j\) over that set is fixed for the whole velocity grid. Members of the set that fall outside at another trial v contribute \(F=0\) rather than being dropped from W. When line_set_velocity is None, membership and W are recomputed at each trial velocity (needed for broad scout searches before a prior RV exists).

The CCF is \(\sum_j w_j F_j\,/\,W\) (catalog weights; not inverse-variance reweighted), with \(\sigma_{\mathrm{CCF}}=\sqrt{\sum_j w_j^2\sigma_j^2}/W\) when use_variance is True.