hispecdrp.primitives.utils.ccf.ccf_rv_content

Photon-limited RV content and Doppler wavelength mapping for spectra.

Functions

_gradient(y, x[, edge_order])

Fast equivalent of numpy.gradient(y, x, edge_order=edge_order) for 1D arrays on a (possibly) non-uniform grid.

compute_rv_content(wave, spec, spec_err, spec_dq)

Photon-limited RV content per pixel and combined, following Bouchy, Pepe & Queloz (2001).

doppler_shift_from_barycenter(wave, vel, zb)

Map rest-frame wavelength(s) to the observed frame at trial velocity vel.

compute_rv_content(wave, spec, spec_err, spec_dq)[source]

Photon-limited RV content per pixel and combined, following Bouchy, Pepe & Queloz (2001).

The RV uncertainty contributed by a single pixel is

\[dV_i = c \, \sigma_i / (\lambda_i \, |dA_i/d\lambda|)\]

where \(\sigma_i\) is the flux uncertainty at that pixel.

The combined RV content adds in inverse quadrature over independent pixels:

\[1 / dV_{\rm tot}^2 = \sum_i 1 / dV_i^2\]
Parameters:
  • wave – Wavelength solution (any units; RV content is returned in m/s).

  • spec – Flux spectrum.

  • spec_err – 1-sigma flux uncertainty per pixel.

  • spec_dq – Data quality mask (0 = good, nonzero = bad). Bad pixels are excluded.

Returns:
  • rvc_per_pix – Per-pixel RV content \(dV_i\) (m/s); NaN where the pixel is unusable.

  • rvc_tot – Combined photon-limited RV uncertainty (m/s).

doppler_shift_from_barycenter(wave, vel, zb)[source]

Map rest-frame wavelength(s) to the observed frame at trial velocity vel.

Applies \(\lambda_{\rm obs} = \lambda_{\rm rest} (1 + v/c) / (1 + z_b)\).

wave must be a 1-D float64 array. Non-finite zb or 1 + z_b = 0 are treated as z_b = 0. The element loop uses prange so callers can compose this inside other parallel Numba kernels.