hispecdrp.primitives.utils.ccf.ccf_fitting
Functions
|
Estimate the 1-sigma uncertainty on a CCF-derived radial velocity from the Fisher information: |
|
Fit a Gaussian to a CCF and (by default) run full bisector analysis. |
Classes
|
Results of a CCF Gaussian fit plus bisector analysis. |
- class CCFMetrics(contrast, contrast_err, rv, rv_err, fwhm, fwhm_err, offset, offset_err, bis_rv, bis_rv_err, bis=None, bis_err=None, bis_shallow=None, bis_shallow_err=None, bis_core=None, bis_core_err=None, bis_levels=None, bisector=None, bis_quant_shallow=None, bis_quant_core=None, bisector_diagnostics=None)[source]
Bases:
objectResults of a CCF Gaussian fit plus bisector analysis.
rv/rv_errcome from the Gaussian line fit (peak location, width, and amplitude) and are the pipeline chunk / aggregate RV.bis_rv/bis_rv_errare the absolute bisector radial velocity from NEID-style weighted percentile cuts (diagnostic only).bis/bis_errare the Queloz et al. (2001) bisector-inverse-slope (v_shallow - v_core) and its uncertainty.bis_shallow/bis_core(andbisector/bis_levels) come from the same Queloz construction.- to_row()[source]
- calc_ccf_metrics(vel_grid, ccf, ccf_err=None, pix_size=None, absorption=False, calc_bis=True, n_levels_bis=100, bis_quant_shallow=(0.1, 0.4), bis_quant_core=(0.55, 0.9), override_rv_err_fisher=True, mu_guess=None)[source]
Fit a Gaussian to a CCF and (by default) run full bisector analysis.
Always computes the Gaussian peak (
rv,fwhm,contrast,offset) so the CCF width and amplitude are available;rv/rv_errare the pipeline chunk RV. Whencalc_bisis True, also:Queloz BIS construction →
bis/bis_err(slopev_shallow - v_core), plusbis_shallow/bis_core/bisector/bis_levels.NEID-style weighted-percentile bisector RV →
bis_rv/bis_rv_err(absolute bisector RV diagnostic; not used as the pipeline final RV).
- Parameters:
vel_grid (ndarray) – Array of velocity trial values for the CCF.
ccf (ndarray) – Array of CCF values corresponding to vel_grid.
ccf_err (ndarray, optional) – Array of 1-sigma uncertainties on the CCF values.
absorption (bool, optional) – Whether to fit an absorption line (True) or emission line (False). Default False.
pix_size (float, optional) – Size of a pixel in the velocity grid (m/s) to account for oversampling the CCF.
calc_bis (bool, optional) – Whether to run Queloz BIS diagnostics and the absolute bisector RV refine. Default True.
n_levels_bis (int, optional) – Number of levels to use for the Queloz bisector curve. Default 100.
bis_quant_shallow (tuple[float, float], optional) – Lower/upper depth fractions (0-1, measured from the continuum) bounding the shallow (near-continuum) region used for
v_shallow. Defaults to (0.10, 0.40).bis_quant_core (tuple[float, float], optional) – Lower/upper depth fractions (0-1, measured from the continuum) bounding the core (near-core) region used for
v_core. Defaults to (0.55, 0.90).override_rv_err_fisher (bool, optional) – Whether to override the RV error from the Gaussian fit with the Fisher information estimate. Default True.
mu_guess (float or None, optional) – Velocity seed (m/s) for the Gaussian fit. When omitted, uses the discrete argmax/argmin of
ccf. Pass the scout / prominence center on multi-line mask CCFs so a secondary extremum in a wide window does not steal the seed.
- Returns:
result (CCFMetrics) – Fully populated Gaussian + bisector metrics when
calc_bisis True.