GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background module¶
Background cross-correlation computation module.
This script is launched as a subprocess by Frame_run_CC.py to perform the cross-correlation analysis without blocking the GUI. It reads parameters from exchange_cc.pkl, runs the computation, and writes results to result_cc.pkl or errors to error_cc.pkl.
- Usage:
python3 run_cc_background.py <exchange_path> <path_default>
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.gaussian(x, cont, p, c, sg)[source]¶
Gaussian absorption profile: continuum minus Gaussian peak.
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.gaussian_fixed(x, p, c, sg)[source]¶
Gaussian emission profile without continuum offset.
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.bigaussian(x, cont, p1, c1, sg1, p2, c2, sg2)[source]¶
Double Gaussian profile on a continuum, used for Doppler shadow fitting.
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.shiftRV(pfn_data, rv_array, rv_shifted, rv_bin=1)[source]¶
Shift cross-correlation profiles to a common RV frame using spline interpolation.
- Parameters:
pfn_data – 2D array of cross-correlation profiles (n_observations x n_rv)
rv_array – Original radial velocity array
rv_shifted – RV shifts to apply per observation
rv_bin – RV bin size for the output grid
- Returns:
(pfn_shifted, rv_shift) - shifted profiles and new RV grid
- Return type:
tuple
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.bin_averaging(data, phases, kp_phases, kp_extra_phases, bin_size)[source]¶
Bin cross-correlation profiles by orbital phase.
- Parameters:
data – 2D array of profiles (n_observations x n_rv)
phases – Orbital phase for each observation
kp_phases – Kp velocity component for each observation
kp_extra_phases – Extra Kp velocity component for each observation
bin_size – Phase bin width
- Returns:
(binned_profiles, binned_phases, binned_kp, binned_kp_extra)
- Return type:
tuple
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.plot_and_save_cor(ccor_new, rv_array, transit_phase, night_obj, base_dir)[source]¶
Generate a PDF with cross-correlation plots for each spectral order.
- Parameters:
ccor_new – 3D array of cross-correlation data (rv x phases x orders)
rv_array – Radial velocity array
transit_phase – Orbital phase array
night_obj – Night object with order information
base_dir – Directory to save the output PDF
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.plot_ccf_grid(sss_new, rv_array, filepdf)[source]¶
Generate a text-based CCF values grid plot saved as PDF.
Each cell displays the numerical CCF value colored by magnitude.
- Parameters:
sss_new – 2D cross-correlation map (phases x rv)
rv_array – Radial velocity array
filepdf – Base PDF path; grid is saved as
*_ccf_grid.pdf
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.plot_run_cc_bg(rv_array, transit_phase, title, rad_mode, mode, sss_new, rv_planet, target_information, selected_cmap_name, extra_rv_trace=None, doppler_shadow_step=False, rv_DS=None, pdf_total=None, filepdf=None, filepng=None, plot_cc_grid=False, phase_gaps=array([], dtype=float64))[source]¶
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.doppler_shadow_bg(doppler_shadow_bool, target_information, night_obj, rv_planet, rv_array, sss_new, transit_phase, title_plot, rad_mode, mode, rv_planet_retrieval, selected_cmap_name, ds_width=20.0, pdf_total=None, base_dir=None, type_transit='Full', maxfev=5000, rv_start=-150, rv_end=150, rv_bin=1)[source]¶
Apply Doppler shadow correction to cross-correlation data.
Plots the original CC map, then optionally fits and removes the Doppler shadow signal using a double-Gaussian model in the stellar rest frame.
- Parameters:
doppler_shadow_bool – Whether to apply Doppler shadow correction
target_information – Target information object
night_obj – Night object with phase and velocity data
rv_planet – Planetary RV trace
rv_array – Radial velocity array
sss_new – 2D cross-correlation map
transit_phase – Orbital phase array
title_plot – Base title for plots
rad_mode – Radiation mode (‘Transmission’ or ‘Emission’)
mode – Processing mode (0=retrieval, 1=manual)
rv_planet_retrieval – Retrieval RV trace for overplotting
selected_cmap_name – Name of the colormap to use
ds_width – Width for overlap detection between planet and DS traces
pdf_total – PdfPages object for multi-page output
base_dir – Output directory path
type_transit – Transit selection (‘Full’, ‘Up-Mid transit’, ‘Down-Mid transit’)
maxfev – Maximum function evaluations for curve fitting
rv_start – Minimum RV for output grid
rv_end – Maximum RV for output grid
rv_bin – RV bin size
- Returns:
Cross-correlation data after Doppler shadow correction
- Return type:
np.ndarray
- GUIBRUSHR.GUI.Input_Output_Panels.Input_Panels.Frame_Cross_Correlation.run_cc_background.run_cc_func_bg(params, path_default)[source]¶
Background version of run_cc_func.
Reads all parameters from the exchange dictionary and performs the cross-correlation analysis. Returns the path to the output PDF file.