GUIBRUSHR.core.functions.cross_correlation module¶
Cross-correlation and radial velocity utility functions for GUIBRUSHR.
This module contains functions for computing planetary and stellar radial velocities, including support for eccentric orbits and the Rossiter-McLaughlin (Doppler shadow) effect.
- GUIBRUSHR.core.functions.cross_correlation.rv_planet_and_star(eccentricity, target, ecc_retrieval, opi_retrieval, kp_retrieval, night_obj, mode, index_night_in_current_instrument, dVsys_arr, counter_derivative_params, rv_dynamic=0)[source]¶
Compute planetary and stellar radial velocities for a given night.
- Parameters:
eccentricity (bool) – Whether to use eccentric orbit model.
target – Target object with orbital parameters.
ecc_retrieval (float) – Retrieved eccentricity value.
opi_retrieval (float) – Retrieved argument of periastron.
kp_retrieval (float) – Retrieved planetary radial velocity semi-amplitude (km/s).
night_obj – Night object containing phase and barycentric velocity data.
mode (str) – Operating mode (‘CC’, ‘Retrieval’, or synthetic).
index_night_in_current_instrument (int) – Index of the night within the instrument.
dVsys_arr – Array of systemic velocity offsets per night.
counter_derivative_params (int) – Counter for derivative parameter indexing.
rv_dynamic (float, optional) – Extra radial velocity (km/s) folded into the planetary vtot. Used ONLY by the retrieval, where it carries the value of the retrieval rv parameter; it replaces the former convolution-kernel rv shift so that the radial velocity is computed in a single place. Defaults to 0 (synthetic and shuffle pipelines). Forwarded to calculate_rv_planet_and_star.
- Returns:
(vtot, vtot_star, kpph) planetary velocity, stellar velocity, and Kp*phase arrays.
- Return type:
tuple
- GUIBRUSHR.core.functions.cross_correlation.calculate_rv_planet_and_star(hjd0, times_of_observation, eccentricity, period, ecc, opi, kp, ks, phases, coeff_vtot, systemic_velocity, barycentric, dvsys, vsys_offset_ccf=0, rv_dynamic=0)[source]¶
Calculate planetary and stellar radial velocities from orbital parameters.
This is the single place where the planetary total velocity vtot is assembled from all its additive components (orbital kpph, systemic velocity, per-night dvsys, barycentric). Two optional additive terms are kept conceptually distinct:
vsys_offset_ccf: extra systemic-velocity offset used ONLY by the cross-correlation (CCF) pipeline to scan the Kp-Vsys plane. Default 0.
rv_dynamic: extra radial velocity used ONLY by the retrieval, where it carries the retrieval rv parameter. It replaces the former convolution-kernel rv shift, keeping the radial velocity in one calculation. Default 0.
Sign convention: both extra terms sit inside the subtracted group, so with coeff_vtot = 1 (Retrieval/synthetic) a positive rv_dynamic lowers vtot (vtot = vtot_without_rv - rv_dynamic). This reproduces exactly the previous behaviour where the kernel was translated by +rv. In CC mode coeff_vtot = -1, so the CCF offset adds with the opposite sense, unchanged from before.
- Parameters:
vsys_offset_ccf (float, optional) – CCF-only systemic offset (km/s). Default 0.
rv_dynamic (float, optional) – Retrieval-only extra radial velocity (km/s), equal to the retrieval rv parameter. Default 0.
- Returns:
(vtot, vtot_star, kpph) total velocity shift for planet, for star, and Kp*phase.
- Return type:
tuple
- GUIBRUSHR.core.functions.cross_correlation.rv_DopplerShadow(target, phases)[source]¶
Compute the Rossiter-McLaughlin (Doppler shadow) radial velocity anomaly.
Based on Cegla, H. M., et al. 2016, A&A, 588, A127.
- Parameters:
target – Target object with projected_obliquity, a_Rs_ratio, inclination, v_sini, and systemic_velocity attributes.
phases (np.ndarray) – Orbital phase array.
- Returns:
Radial velocity anomaly plus systemic velocity (km/s).
- Return type:
np.ndarray