antaress.ANTARESS_corrections.ANTARESS_detrend module#
- detrend_prof(detrend_prof_dic, data_dic, coord_dic, inst, vis, CCF_dic, data_prop, gen_dic, plot_dic)[source]#
Detrending: main routine.
Corrects disk-integrated line profiles for abnormal variations
variations in line contrast, FWHM, and RV should first be fitted within the plot_dic[‘prop_DI’] routine to derive their model. Model coefficients can then be set in the detrending module.
better results are obtained by correcting first for the constrast, before the RV. FWHM must be corrected after RVs, so that line profiles are aligned FWHM corrections can only be applied to single lines
the detrending module is called before the analysis module so that corrected profiles can then be re-analyzed
the detrending module requires that aligned profiles have already been calculated, as the RV model has been fitted to profiles corrected for the star motion. After correction the routine resets the path of current (and aligned) disk-integrated data to corrected profiles, which will not go through the alignment module again
for modulations the coefficient of degree 0 is not required, as models are normalized to the mean
- Parameters:
TBD
- Returns:
TBD
- detrend_init_data(exp_path, data_type, line_trans, iord_line)[source]#
Detrending: exposure uploading.
- Parameters:
TBD
- Returns:
TBD
- detrend_save_data(exp_path, data_exp, data_corr, data_type, line_trans, iord_line)[source]#
Detrending: exposure saving.
- Parameters:
TBD
- Returns:
TBD
- detrend_prof_gen_mul(coord, corr_coeffs, var, corr_in, args)[source]#
Detrending: multiplicative model.
Multiplies detrending models.
- Parameters:
TBD
- Returns:
TBD
- detrend_prof_gen_add(coord, corr_coeffs, var, corr_in, args)[source]#
Detrending: additive model.
Adds detrending models.
- Parameters:
TBD
- Returns:
TBD
- pulsation_model(coeffs, var, var_ref)[source]#
Detrending: pulsation model.
Defines model for stellar pulsation as seen in RV, contrast, or FWHM. The model is composed of a high-frequency sine, with amplitude and frequency modulated by a common low-frequency sine.
\[F(x) = A_\mathrm{HF} (1 + A_\mathrm{LF} \sin( 2 \pi \nu_\mathrm{LF}(x) - \phi_\mathrm{LF} ) ) \sin( 2 \pi \nu_\mathrm{HF}(x) - \phi_\mathrm{HF} )\]Where
\[\begin{split}\nu_\mathrm{LF}(x) &= ( x - x^\mathrm{ref} ) \mathrm{fr}_\mathrm{LF} \\ \nu_\mathrm{HF}(x) &= ( x - x^\mathrm{ref} ) \mathrm{fr}_\mathrm{HF}(x)\end{split}\]The reference coordinate \(x^\mathrm{ref}\) is necessary to ensure a good fit convergence.
The frequency of the high-frequency sine is modulated by the same low-frequency sine as the amplitude, with a different amplification factor and offset by pi. Indeed the increase in period of the pulsations occurs at the same time as their decrease in amplitude. Note that if \(P = P^\mathrm{ref}( 1 + f \sin(x+\pi))\) with f>0 then \(\mathrm{fr} \sim (1/P^\mathrm{ref})( 1 - f \sin(x+\pi))\) which we model as
\[\mathrm{fr}_\mathrm{HF}(x) = \mathrm{fr}_\mathrm{HF}^\mathrm{ref} (1 + f \sin( 2 \pi \nu_\mathrm{LF}(x)))\]- Parameters:
coeffs (list) – \([A_\mathrm{HF},\phi_\mathrm{HF},\mathrm{fr}_\mathrm{HF}^\mathrm{ref},A_\mathrm{LF},\phi_\mathrm{LF},\mathrm{fr}_\mathrm{LF},f]\)
var (float, array) – variable on which the model depends, typically time or stellar phase
- Returns:
TBD
- detrend_prof_ctrst(data_corr, single_l, nord_eff, nspec, glob_corr_ctrst_exp, cond_cont_com, cont_func_dic, rv_star_stelCDM, rv_stelCDM_solCDM, scaled_DI_data_paths_exp, t_dur_exp)[source]#
Detrending: contrast model.
Corrects line profile for contrast variations.
Line profile is temporarily set to a null continuum so that its contrast can be ‘stretched’ by the correction factor \(\alpha\)
\[\begin{split}C_\mathrm{corr} &= ( ((F/F_\mathrm{cont})-1)/\alpha + 1) F_\mathrm{cont} \\ &= (F-F_\mathrm{cont})/\alpha + F_\mathrm{cont} \\ &= (F/\alpha) + F_\mathrm{cont} (1 - (1/\alpha))\end{split}\]We assume that the contrast variation arises from a modification of the measured profile akin to a change in LSF. All profiles (including in-transit) are thus set to a common vertical scale in which the line contrast is equivalent, by normalizing them with the stellar continuum x the profile global flux level. Both continuum and level must have been defined from a first processing of the data.
- Parameters:
TBD
- Returns:
TBD
- detrend_prof_FWHM(data_corr, FWHM_corr, RV_star_solCDM, resamp_mode, comm_sp_tab=False)[source]#
Detrending: FWHM model.
Corrects line profile for FWHM variations.
Performs a stretch of the spectral tables in rv space. Modifying the width of a line profile to get FWHM/corr is equivalent to redefining the line profile on its rv table divided by the FWHM correction. Corrected profiles are resampled on the common visit table if relevant (if a common table is used then all original tables point toward this common table). This operation must be performed on velocity tables symmetrical with respect to the line center, ie for lines that have been aligned on the null velocity. This means the RV correction must be performed first, to determine and fix the correct systemic rv.
- Parameters:
TBD
- Returns:
TBD
- pc_analysis(gen_dic, data_dic, inst, vis, data_prop, coord_dic)[source]#
PC: main routine.
Applies Principal Components Analysis.
We define the perturbed profiles as
\[F(w,t,v) = F_{\star}(w,v) + F_\mathrm{pert}(w,t,v)\]Where \(F_\mathrm{pert}\) is the physical perturbation from the star, assumed to be roughly uniform over the stellar disk
\[\begin{split}F_\mathrm{pert}(w,t,v) &\sim \sum_{k} I_\mathrm{pert}(w,t,v) LD_{k}(band) S_{k} \\ &= I_\mathrm{pert}(w,t,v) \sum_{k} LD_{k}(band) S_{k} \\ &= I_\mathrm{pert}(w,t,v) S_{\star,LD}(band)\end{split}\]The perturbation can be described as a linear combination of principal components PC, as
\[F_\mathrm{pert}(w,t,v) = \sum_{k} a(t,v) PC(k,w)\]We apply the correction to the raw disk-integrated profiles \(F(w,t,v) C_\mathrm{ref}(band,v) F_\mathrm{glob}(v,t)\) in detrend_prof(), so that the correction model is
\[F_\mathrm{corr}^\mathrm{pca}(w,t,v) = F_\mathrm{pert}(w,t,v) C_\mathrm{ref}(band,v) F_\mathrm{glob}(v,t)\]Differential profiles are calculated from the scaled spectra \(F_\mathrm{sc}(w,t) = F(w,t,v) C_\mathrm{ref}(w,v)\). Out-of-transit they are defined as
\[\begin{split}F_\mathrm{diff}(w,t,v) &= F_{\star,sc}(w,v) - F_\mathrm{sc}(w,t,v) \\ &= - F_\mathrm{pert}(w,t,v) C_\mathrm{ref}(band,v)\end{split}\]To which we fit \(F_\mathrm{diff}(w,t,v) F_\mathrm{glob}(v,t)\)
In-transit, outside of the planetary lines (see proc_intr_data()), they are defined as
\[\begin{split}F_\mathrm{intr}(w,t,v) &= F_\mathrm{diff}(w,t,v)/(1 - LC_\mathrm{theo}(band,t)) \\ &= ( F_{\star,sc}(w,v) - F_\mathrm{sc}(w,t,v) )/(1 - LC_\mathrm{theo}(band,t)) \\ &= ( \sum_{k}(I_{k}(w,t,v) LD_{k}(band) S_{k}) - ( \sum_{k_\mathrm{unocc}}(I_{k}(w,t,v) LD_{k}(band) S_{k}) + \sum_{k_\mathrm{unocc}}(I_\mathrm{pert}(w,t,v) LD_{k}(band) S_{k}))) C_\mathrm{ref}(band,v)/(1 - LC_\mathrm{theo}(band,t)) \\ &= F_\mathrm{intr,pl}(w,t,v) - I_\mathrm{pert}(w,t,v) \sum_{k_\mathrm{unocc}}(LD_{k}(band) S_{k}) C_\mathrm{ref}(band,v)/(1 - LC_\mathrm{theo}(band,t)) \\ &= F_\mathrm{intr,pl}(w,t,v) - (F_\mathrm{pert}(w,t,v)/S_{\star,LD}(band)) (S_{\star,LD}(band) - LD(band,t) S_{p}(band,t)) C_\mathrm{ref}(band,v)/(1 - LC_\mathrm{theo}(band,t)) \\ &= F_\mathrm{intr,pl}(w,t,v) - F_\mathrm{pert}(w,t,v) (1 - (LD(band,t) S_{p}(band,t)/S_{\star,LD}(band))) C_\mathrm{ref}(band,v)/(1 - LC_\mathrm{theo}(band,t)) \\ &= F_\mathrm{intr,pl}(w,t,v) - F_\mathrm{pert}(w,t,v) LC_\mathrm{theo}(band,t) C_\mathrm{ref}(band,v)/(1 - LC_\mathrm{theo}(band,t))\end{split}\]Outside of the planet-occulted stellar lines the continuum of \(F_\mathrm{intr,pl}\) is constant, and the continuum of \(F_\mathrm{pert}\) is assumed to be null, so that
\[F_\mathrm{intr}(w,t,v) - F_\mathrm{intr}(cont,t,v) = - F_\mathrm{pert}(w,t,v) LC_\mathrm{theo}(band,t) C_\mathrm{ref}(band,v)/(1 - LC_\mathrm{theo}(band,t))\]We thus fit
\[(F_\mathrm{intr}(w,t,v) - F_\mathrm{intr}(cont,t,v)) F_\mathrm{glob}(v,t) (1 - LC_\mathrm{theo}(band,t))/LC_\mathrm{theo}(band,t)\]- Parameters:
TBD
- Returns:
TBD
- pc_model(params, x, args=None)[source]#
PC: model.
Calculates linear combination of Principal Components.
- Parameters:
TBD
- Returns:
TBD
- corr_length_determination(Diff_data_vis, data_vis, scr_search, inst, vis, gen_dic)[source]#
Correlation length.
Determine the spectral correlation length from out-of-transit differential profiles (so that values are spread around zero). See method in Pont et al. 2006 and Bourrier et al. 2015 (tomography).
- Parameters:
TBD
- Returns:
TBD