antaress.ANTARESS_process.ANTARESS_data_process module#
- align_profiles(data_type_gen, data_dic, inst, vis, gen_dic, coord_dic)[source]#
Main alignment routine.
Aligns time-series of disk-integrated, intrinsic, and planetary profiles. Profiles used as weights throughout the workflow are shifted in the same way as their associated profiles.
- Parameters:
TBD
- Returns:
None
- rescale_profiles(data_inst, inst, vis, data_dic, coord_dic, exp_dur_d, gen_dic, plot_dic, system_param, theo_dic, ar_dic={})[source]#
Main flux scaling routine.
Scales profiles to the correct relative broadband flux level.
Spectra \(F_\mathrm{corr}(\lambda,t,v)\) should have been set to the same flux balance as a reference spectrum at low resolution using corr_Fbal().
\[F_\mathrm{corr}(\lambda,t,v) = F_{\star}(\lambda,v) C_\mathrm{ref}(\lambda,v) L(t)\]Where \(C_\mathrm{ref}(\mathrm{\lambda \, in \, band \, B},v) \sim C_\mathrm{ref}(B,v)\) represents a possible low-frequency deviation from the true stellar spectrum, and L(t) represents the global flux deviation from the true stellar spectrum, not corrected for in previous modules.
We first convert all spectra from flux to (temporal) flux density units, so that they are equivalent except for flux variations.
We then correct for L(t) by dividing the profiles by
\[\begin{split}F^\mathrm{glob}(v,t) &= \frac{\mathrm{TF}_\mathrm{corr}(v,t)}{\mathrm{median}(t_k, \mathrm{TF}_\mathrm{corr}(v,t_k) )} \\ \mathrm{or}& \\ F^\mathrm{glob}(v,t) &= \frac{\mathrm{TF}_\mathrm{corr}(v,t)}{F_\mathrm{sc} \int_{\mathrm{\lambda \, in \, full \, B}}{d\lambda }}\end{split}\]Where
\[\begin{split}\mathrm{TF}_\mathrm{corr}(v,t) &= \int_{\mathrm{\lambda \, in \, full \, B}}{F_\mathrm{corr}(\lambda,t,v) d\lambda } \\ &= L(t) C\end{split}\]The exact value of the (unocculted) global flux level does not matter within a visit and is set to the median flux of all spectra, unless the user choses to impose a common flux density for all visits (in case disk-integrated data needs to be combined between visits).
We then need to rescale spectrally the data so that
\[\begin{split}F_\mathrm{sc}(\lambda,t) &= c(\lambda,t) F_\mathrm{corr}(\lambda,t) \\ &= F(\lambda,t)\end{split}\]To do so we use broadband spectral light curves, which by definition correspond to the ratio of in- and out-of-transit flux integrated over the band
\[\begin{split}LC(B,v,t) &= \frac{ \int_{\mathrm{\lambda \, in \, B}}{F(\lambda,t) d\lambda }}{\int_{\mathrm{\lambda \, in \, B}}{F_{\star}(\lambda,v) d\lambda } } \\ &= \frac{ \mathrm{TF}(B,t) }{ \mathrm{TF}_{\star}(B,v) }\end{split}\]We assume that \(c(\lambda,t)\) has low-frequency variations (which should be the case, since the difference between \(F_\mathrm{corr}\) and F comes from the changes in color balance). The correction thus implies
\[\begin{split}& \int_{\mathrm{\lambda \, in \, B}}{c(\lambda,t) F_\mathrm{corr}(\lambda,t) } = \int_{\mathrm{\lambda \, in \, B}}{ F(\lambda,t) } \\ & c(B,t) \int_{\mathrm{\lambda \, in \, B}}{F_\mathrm{corr}(\lambda,t) } = \mathrm{TF}(B,t) \\ & c(B,t) = \frac{ \mathrm{TF}_{\star}(B,v) \mathrm{LC}(B,v,t) }{ \int_{\mathrm{\lambda \, in \, B}}{F_{\star}(\lambda,v) C_\mathrm{ref}(B,v) } } \\ & c(B,t) = \frac{ \mathrm{TF}_{\star}(B,v) \mathrm{LC}(B,v,t)}{ \mathrm{TF}_{\star}(B,v) C_\mathrm{ref}(B,v) } \\ & c(B,t) = \frac{ \mathrm{LC}(B,v,t) }{ C_\mathrm{ref}(B,v) }\end{split}\]We set \(c(B,t) = \mathrm{LC}_\mathrm{theo}(B,t)\) and interpolate the chromatic c(B,t) at all wavelengths in the spectrum to define \(c(\lambda,t)\)
\[\begin{split}F_\mathrm{sc}(\lambda,t,v) &= \frac{ \mathrm{LC}_\mathrm{theo}(\lambda,t) F_\mathrm{corr}(\lambda,t)}{F^\mathrm{glob}(v,t) } \\ &= F(\lambda,t,v) C_\mathrm{ref}(B,v)\end{split}\]Care must be taken about \(C_\mathrm{ref}(B,v)\) when several visits are exploited
if the stellar emission remains the same in all visits, then we can use a single theoretical spectrum / master as reference, and a constant normalized light curve
\[F_\mathrm{sc}(\lambda,t,v) = F(\lambda,t,v) C_\mathrm{ref}(B)\]if the stellar emission changes in amplitude uniformly over the star, the normalized light curve remains the same, and the stellar spectrum keeps the same profile
\[\begin{split}&F_\mathrm{sc}(\lambda,t,v) = \frac{F(\lambda,t,v) C_\mathrm{ref}(B)}{F_r(v)} \\ &\mathrm{where \,} F_r(v) = \frac{F_{\star}(\lambda,v)}{F_{\star}(\lambda,v_\mathrm{ref})}\end{split}\]The stellar spectrum of one of the visit \(F_{\star}(\lambda,v_\mathrm{ref})\) is taken as reference, with
\[\begin{split}\mathrm{LC}_\mathrm{theo}(\lambda,t) &= \frac{F(\lambda,v_\mathrm{ref},t)}{F_{\star}(\lambda,v_\mathrm{ref})} \\ &= \frac{F(\lambda,t,v)}{F_{\star}(\lambda,v)}\end{split}\]Thus
\[\begin{split}F_\mathrm{sc}(\lambda,t,v) &= \frac{F(\lambda,t,v) C_\mathrm{ref}(B) F_{\star}(\lambda,v_\mathrm{ref})}{F_{\star}(\lambda,v) } \\ &= \frac{F(\lambda,v_\mathrm{ref},t) C_\mathrm{ref}(B) F_{\star}(\lambda,v_\mathrm{ref})}{F_{\star}(\lambda,v_\mathrm{ref}) } \\ &= F(\lambda,v_\mathrm{ref},t) C_\mathrm{ref}(B)\end{split}\]Scaled spectra thus keep the same profile, deviating from the true profile by a common \(C_\mathrm{ref}(B)\) in all visits.
if the stellar emission changes in amplitude and shape uniformely over the star, the normalized light curve remains the same but the stellar spectrum has not the same profile
\[\begin{split}F_\mathrm{sc}(\lambda,t,v) &= \mathrm{LC}_\mathrm{theo}(\lambda,t) F(\lambda,v) C_\mathrm{ref}(\lambda,v) \\ &= (F(\lambda,v,t)/F_{\star}(\lambda,v)) F_{\star}(\lambda,t) C_\mathrm{ref}(B,v) \\ &= F(\lambda,t,v) C_\mathrm{ref}(B,v)\end{split}\]By using a reference spectrum specific to each visit when correcting the color balance, with the correct shape and relative flux, we would get
\[F_\mathrm{sc}(\lambda,t,v) = F(\lambda,t,v) C_\mathrm{ref}\]Where \(C_\mathrm{ref}\) is the deviation from the absolute flux level, common to all visits.
if local stellar spectra in specific regions of the star change between visits, eg due to (un)occulted spots, then the normalized light curve changes as well. Both a reference spectrum and a light curve specific to each visit must be used to remove the stellar contribution \(F_{\star}(\lambda,v)\) and avoid introducing a different balance to the planet-occulted spectra.
If there is emission/reflection from the planet, then the true flux writes as
\[\begin{split}F(\lambda,v,t) &= F_{\star}(\lambda,v) \mathrm{LC}^\mathrm{tr}(\lambda,v,t) + F_{\star}(\lambda,v) \mathrm{LC}^\mathrm{refl}(\lambda,v,t) + F_\mathrm{p}^\mathrm{thermal}(\lambda,v,t) \\ &= F_{\star}(\lambda,v) ( \delta_p^\mathrm{tr}(\lambda,v,t) + \delta_p^\mathrm{refl}(\lambda,v,t) + \delta_p^\mathrm{thermal}(\lambda,v,t) ) \\ &= F_{\star}(\lambda,v) \delta_p(\lambda,v,t)\end{split}\]The correction should still ensure that
\[\begin{split}c(B,t) &= \frac{ \mathrm{TF}(B,v,t) }{ \mathrm{TF}_{\star}(B,v) C_\mathrm{ref}(B) } \\ &= \frac{ \mathrm{LC}(B,v,t) \mathrm{TF}_{\star}(B,v) }{ \mathrm{TF}_{\star}(B,v) C_\mathrm{ref}(B) } \\ &= \frac{ \mathrm{LC}(B,v,t) }{ C_\mathrm{ref}(B) }\end{split}\]But broadband spectral light curves correspond to
\[\begin{split}\mathrm{LC}(B,v,t) &= \frac{ \mathrm{TF}(B,v,t) }{ \mathrm{TF}_{\star}(B,v) } \\ &= \frac{ \int_{\mathrm{\lambda \, in \, B}}, F_{\star}(\lambda,v) \delta_p(\lambda,v,t) d\lambda ) }{ \mathrm{TF}_{\star}(B,v) }\end{split}\]So that care must be taken to use light curves that integrate the different spectral contributions and are then normalized by the integrated stellar flux, rather than integrating the pure planet contribution.
For spectra, we can use the flux integrated over bands including the planetary absorption, as we can match it with the same band over which the light curve was measured. Ideally the input light curves should be defined with a fine enough resolution to sample the low-frequency variations of the planetary atmosphere and stellar limb-darkening
For CCFs, a light curve does not match the cumulated flux of the different spectral regions used to calculate the CCF. If we assume that the signature of the planet and of the RM effect is similar in all lines used to calculate the CCF, and that the light curve is achromatic, then it is similar to the scaling of a spectrum with a single line. Thus, as with spectra, CCFs should be scaled using the flux of their full profile and not just the continuum (although there will always be a bias in using CCFs at this stage and the use of spectra should be preferred).
Since the scaling is imposed by a light curve independent of the spectra, bin by bin, it does not need to be applied to the full spectra like the flux balance color correction, and can be applied to any spectral range.
Note that the measured light curve corresponds to
\[\begin{split}\mathrm{LC}(B,t) &= \frac{ \int_{\lambda \, in \, B}{ F_\mathrm{in}(\lambda,t) d\lambda } }{ \int_{\lambda \, in \, B}{ F_{\star}(\lambda,v) d\lambda }} \\ &= 1 - \frac{\int_{ \lambda \, in \, B}{ f_p(\lambda) ( S_\mathrm{thick}(B,t) + S_\mathrm{thin}(\lambda,t) ) d\lambda} }{ <F_{\star}(\mathrm{\lambda \, in \, B},v)> }\end{split}\]The theoretical light curves fitted to the measured one assume a constant, uniform stellar intensity I and limb-darkening law, and a constant average radius over the band
\[\begin{split}\mathrm{LC}^\mathrm{theo}(B,t) &= \frac{ \mathrm{TF}^\mathrm{theo}(B,t) }{ \mathrm{TF}_{\star}^\mathrm{theo}(B) } \\ &= \frac{ F^\mathrm{theo}(B,t) }{ F_{\star}^\mathrm{theo}(B) } \\ &= 1 - \frac{ I^\mathrm{theo}(B) \mathrm{LD}(B,t) S_p(B,t)}{\sum_{k}{ I^\mathrm{theo}(B) \mathrm{LD}_k(B) S_k } } \\ &= 1 - \frac{ \mathrm{LD}(B,t) S_p(B,t)}{\sum_{k}{ \mathrm{LD}_k(B) S_k} } \\ &= 1 - \frac{ \mathrm{LD}(B,t) S_p(B,t)}{S_{\star}^\mathrm{LD}(B) }\end{split}\]The fact that this is an approximation does not matter as long as the measured light curve is correctly reproduced, in which case the rescaling with the theoretical light curve is correct. In the following we assume that the theoretical LD matches the true LD.
Out-of-transit data is rescaled as well, to account for possible variations of stellar origin in the disk-integrated flux.
- Parameters:
TBD
- Returns:
None
- extract_diff_profiles(gen_dic, data_dic, inst, vis, data_prop, coord_dic)[source]#
Main differential profile routine.
Extracts differential profiles in the stellar rest frame.
The real measured spectrum can be written as
\[F(\lambda,t,v) = F_{\star}(\lambda,t,v) \delta_p(\lambda,t,v)\]It can also be decomposed spatially as
\[\begin{split}F(\lambda,t,v) &= (\sum_\mathrm{i \, not \, occulted}{F_i(\lambda,t,v)}) + f_p(\lambda,v) (S_\mathrm{occ}(t) - S_\mathrm{thick}(B,t) - S_\mathrm{thin}(\lambda,t) ) + F_p(\lambda,t) \\ &= F_{\star}(\lambda,t,v) - f_p(\lambda,v) ( S_\mathrm{thick}(B,t) + S_\mathrm{thin}(\lambda,t) ) + F_p(\lambda,t)\end{split}\]With
\(\lambda\) the absolute wavelength in the stellar rest frame, within a given spectral band.
F the flux received from the star - planet system \([erg \, s^{-1} \, A^{-1} \, cm^{-2}]\) at a given distance \(F_i(\lambda,v) = f_i(\lambda,v) S_i\) is the flux emitted by the region i of surface \(S_i\).
the surface density flux can be written as \(f_i(\lambda,v) = I_i(\lambda) \mathrm{LD}_i(\lambda) \mathrm{GD}_i(\lambda)\).
\(I_i(\lambda)\) is the specific intensity in the direction of the LOS \([erg \, s^{-1} \, A^{-1} \, cm^{-2} \, sr^{-1}]\) which can be written as \(I_0(\lambda-\lambda_{\star}(t))\) if the local stellar emission is constant over the stellar disk, and simply shifted by \(\lambda_{\star}(t)\) because of surface velocity.
\(\mathrm{LD}_i(\lambda)\) is the spectral limb-darkening law.
\(\mathrm{GD}_i(\lambda)\) the gravity-darkening law.
\(F_p(\lambda,t)\) is the flux emitted or reflected by the planet. The planet and its atmosphere occult a surface \(S_\mathrm{occ}(t)\), time-dependent because of partial occultation at ingress/egress.
\(S_\mathrm{thick}(B,t)\) is the equivalent surface of the planet disk opaque to light in the local spectral band.
\(S_\mathrm{thin}(\lambda,t)\) is the equivalent surface of the atmospheric annulus optically thin to light in the band, varying at high frequency and null outside of narrow absorption lines.
\(F_p(\lambda,t)\) and \(S_\mathrm{thin}(\lambda,t)\) are sensitive to the planet orbital motion, and shifted in the star rest frame by \(\lambda_\mathrm{pl}(t)\).
The measured profiles are now defined in the most general case as (see rescale_profiles())
\[F_\mathrm{sc}(\lambda,t,v) = F(\lambda,t,v) C_\mathrm{ref}(\lambda_\mathrm{B},v)\]With \(F(\lambda,t,v)\) the true spectrum. Since all spectra were set to the same balance, corresponding to the stellar spectrum times a low-frequency coefficient, the master out corresponds in a given visit to
\[F^\mathrm{mast}_{\star}(\lambda,v) = F_{\star}(\lambda,v) C_\mathrm{ref}(\lambda_\mathrm{B},v)\]Note that the unknown scaling of the flux due to the distance to the star is implicitely included in \(C_\mathrm{ref}\). We can decompose \(F_{\star}\) as:
\[F_{\star}(\lambda,v) = (\sum_\mathrm{i \, not \, occulted}{F_i(\lambda,v)}) + f_p(\lambda,v) S_\mathrm{occ}(t)\]The local differential profiles are calculated as
\[\begin{split}F_\mathrm{diff}(\lambda,t,v) &= F^\mathrm{mast}_{\star}(\lambda,v) - F_\mathrm{sc}(\lambda,t,v) \\ &= F_{\star}(\lambda,v) C_\mathrm{ref}(\lambda_\mathrm{B},v) - F(\lambda,t,v) C_\mathrm{ref}(\lambda_\mathrm{B},v) \\ &= ( F_{\star}(\lambda,v) - F(\lambda,t,v) ) C_\mathrm{ref}(\lambda_\mathrm{B},v) \\ &= ( F_{\star}(\lambda,v) - F_{\star}(\lambda,t,v) + f_p(\lambda,v) ( S_\mathrm{thick}(B,t) + S_\mathrm{thin}(\lambda,t) ) - F_p(\lambda,t) ) C_\mathrm{ref}(\lambda_\mathrm{B},v)\end{split}\]Here we make the assumption that \(F_{\star}(\lambda,t,v) \sim F_{\star}(\lambda,v)\), but care must be taken not to neglect uncertainties on \(F_{\star}(\lambda,t,v)\) when propagating errors, even if uncertainties on the reference \(F_{\star}(\lambda,v)\) can be neglected.
\[\begin{split}F_\mathrm{diff}(\lambda,t,v) &= ( f_p(\lambda,v) ( S_\mathrm{thick}(B,t) + S_\mathrm{thin}(\lambda,t) ) - F_p(\lambda,t) ) C_\mathrm{ref}(\lambda_\mathrm{B},v) \\ &= ( f_p(\lambda,v) S_p(\lambda,t) - F_p(\lambda,t) ) C_\mathrm{ref}(\lambda_\mathrm{B},v)\end{split}\]Where \(S_p(\lambda,t)\) represents the equivalent surface occulted by the opaque planetary disk and its optically thin atmosphere, at each wavelength.
If there is no contribution from the atmosphere, or its contamination is excluded
\[F_\mathrm{diff}(\lambda,t,v) = f_p(\lambda,v) S_\mathrm{thick}(B,t) C_\mathrm{ref}(\lambda_\mathrm{B},v)\]CCFs computed on these \(F_\mathrm{diff}\) have the same contrast, FWHM, and RV between visits, as long as the intrinsic lines are comparable.
It is possible that \(F_{\star}(\lambda,v)\) varies with time, during or outside of the transit, eg if a spot/plage is present on the star and changes during the observations (in particular with the star’s rotation). In that case, rather than \(F^\mathrm{mast}_{\star}(\lambda,v)\) we would need to use a \(F_{\star}(\lambda,t,v)\) representative of the star at the time of each exposure.
Binned disk-integrated profiles are calculated from spectra resampled directly on the table of each exposure, to avoid blurring spectral features, losing resolution, and introducing spurious features when doing differences and ratio between the master and individual spectra (which we found to be the case if using a single master calculated on a common table and then resampled on the table of each exposure).
If a bin is undefined in the master and/or the exposure, it will be undefined in the local profile.
- Parameters:
TBD
- Returns:
None
- sub_extract_diff_profiles(iexp_proc, proc_DI_data_paths, proc_gen_data_paths_new, idx_to_bin_mast, n_in_bin_mast, dx_ov_mast, idx_bin2orig, idx_bin2vis, nord, dim_exp, nspec, data_to_bin_gen, resamp_mode, scaled_data_paths_vis, inst, iexp_no_plrange_vis, exclu_rangestar_vis, vis_type, gen_type, corr_Fbal, corr_FbalOrd, save_data_dir, resamp_cond, resamp_cond_all, calc_cond)[source]#
Differential profile extraction.
Calculates differential profiles.
- Parameters:
TBD
- Returns:
None
- extract_intr_profiles(data_dic, gen_dic, inst, vis, star_params, coord_dic, theo_dic, plot_dic)[source]#
Main intrinsic profile routine.
Extracts intrinsic profiles in the stellar rest frame.
The in-transit differential spectra, at wavelengths where planetary contamination was masked, correspond to
\[\begin{split}F_\mathrm{diff}(\mathrm{\lambda \, in \, B},t,v) &= ( f_p(\lambda,v) S(\lambda,t) - F_p(\lambda,t) ) C_\mathrm{ref}(B,v) \\ &= f_p(\lambda,v) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v)\end{split}\]With
\(f_p\) the surface density flux spectrum, assumed spatially constant over the region occulted by the planet, known to a scaling factor \(C_\mathrm{ref}(B,v)\), assumed to be constant over the band, and accounting for the absolute flux level and deviations from the stellar SED.
\(S_\mathrm{thick}(B,p)\) the effective planet surface occulting the star in the band, assumed spectrally constant over the band, varying spatially during ingress/egress, and set by our choice of light curve.
The above expression consider only wavelengths \(\lambda\) where there are no narrow absorption lines from the planetary atmosphere (absorbed wavelengths have been masked).
We scale back differential spectra to get back to the intrinsic stellar profiles (ie, without broadband planetary absorption and limb/grav-darkening), assuming that
\[f_p(\mathrm{\lambda \, in \, B},v) = I(\mathrm{\lambda \, in \, B},t) \mathrm{LD}(B,t)\]i.e. that the limb-darkening has low-frequency variations and does not affect the shape of the local intrinsic spectra. The theoretical light curve used to rescale the data writes as (see rescale_profiles()) :
\[1 - \mathrm{LC}_\mathrm{theo}(B,t) = \mathrm{LC}_p(B,t) \frac{S_p(B,t)}{S_{\star}^\mathrm{LD}(B) }\]Where the fluxes are constant and spatially uniform over the band and stellar disk, and the planet is described by a constant, mean radius over the band. If we normalize the local spectra by this factor, we obtain the intrinsic spectra as
\[\begin{split}F_\mathrm{intr}(\lambda,t,v) &= \frac{F_\mathrm{diff}(\mathrm{\lambda \, in \, B},t,v)}{1 - \mathrm{LC}_\mathrm{theo}(B,t)} \\ &= \frac{f_p(\lambda,v) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v)}{1 - \mathrm{LC}_\mathrm{theo}(B,t)} \\ &= \frac{I(\lambda,t) \mathrm{LD}(B,t) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v) S_{\star}^\mathrm{LD}(B)}{LD(B,t) S_p(B,t)} \\ &= \frac{I(\lambda,t) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v) S_{\star}^\mathrm{LD}(B)}{Sp(B,t) }\end{split}\]During the full transit, the ratio \(S_r(B) = S_\mathrm{thick}(B,t)/S_p(B,t)\) is constant over time. During ingress/egress, we assume that the ratio remains the same, so that
\[F_\mathrm{intr}(\lambda,t,v) = I(\lambda,t) F^\mathrm{norm}_\mathrm{ref}(B)\]With
\[F^\mathrm{norm}_\mathrm{ref} = S_r(B) C_\mathrm{ref}(B,v) S_{\star}^\mathrm{LD}(B)\]Only dependent on the band. The normalized local spectra then allow comparing the shape of the intrinsic spectra along the transit chord in a given band.
The continuum of the differential profiles is
\[\begin{split}F_\mathrm{diff}(B_\mathrm{cont},t,v) &= \sum_{\lambda \, in \, B_\mathrm{cont}}(I_p(\lambda,t) \mathrm{LD}_p(B,t) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v) d\lambda(\lambda,v)) \\ &= \sum_{\lambda \, in \, B_\mathrm{cont}}(I_p(\lambda,t) d\lambda(\lambda,v)) \mathrm{LD}_p(B,t) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v) \\ &= I_p(B_\mathrm{cont},v) \mathrm{LD}_p(B,t) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v)\end{split}\]If we define the continuum as a spectral range where the flux only varies due to broadband limb-darkening, we have \(I_p(B_\mathrm{cont},v) = I(B_\mathrm{cont},v)\)
\[\begin{split}F_{\star}(B_\mathrm{cont},v) &= \sum_{ x }(\sum_{\lambda \, in \, B_\mathrm{cont}}(I_x(\lambda,v) d\lambda(\lambda,v)) \mathrm{LD}_x(B,v) S_x ) \\ &= I(B_\mathrm{cont},v) S_{\star}^\mathrm{LD}(B)\end{split}\]Thus the intrinsic continuum writes as
\[\begin{split}F_\mathrm{intr}(B_\mathrm{cont},t,v) &= I(B_\mathrm{cont},v) S_r(B) C_\mathrm{ref}(B,v) S_{\star}^\mathrm{LD}(B) \\ &= F_{\star}(B_\mathrm{cont},v) S_r(B) C_\mathrm{ref}(B,v)\end{split}\]And the differential continuum writes as
\[\begin{split}F_\mathrm{diff}(B_\mathrm{cont},t,v) &= \frac{F_{\star}(B_\mathrm{cont},v) \mathrm{LD}_p(B,t) S_\mathrm{thick}(B,t) C_\mathrm{ref}(B,v)}{S_{\star}^\mathrm{LD}(B) } \\ &= F_{\star}(B_\mathrm{cont},v) ( 1 - \mathrm{LC}_\mathrm{theo}(B,t) ) S_r(B,t) C_\mathrm{ref}(B,v)\end{split}\]If \(S_r \sim 1\) the intrinsic profiles have the same flux as the disk-integrated spectra before the relative broadband flux scaling.
\[\begin{split}\sum_{\lambda \, in \, B_\mathrm{cont}}( \frac{F_\mathrm{sc}(\lambda,t,v) d\lambda(\lambda,t,v)}{\mathrm{LC}_\mathrm{theo}(B,t)} ) &= \sum_{\lambda \, in \, B_\mathrm{cont}}( \frac{ F_\mathrm{sc}(\lambda,t,v) d\lambda(\lambda,t,v) }{ \mathrm{LC}_\mathrm{theo}(B,t) } ) \\ &= \sum_{\lambda \, in \, B_\mathrm{cont}}( F_{\star}(\lambda,v) C_\mathrm{ref}(B,v) d\lambda(\lambda,t,v)) \\ &= F_{\star}(B_\mathrm{cont},v) C_\mathrm{ref}(B,v)\end{split}\]Intrinsic profiles thus have the same continuum as the scaled out-of-transit and master disk-integrated profiles, within a range controlled by broadband flux variations (ie, outside of planetary and stellar lines) but this continuum may not be exactly unity.
Bins affected by the planet absorption must be included in the scaling band (rescale_profiles())), but after this operation is done we set all bins affected by the planetary atmosphere to nan so that the final profiles are purely stellar.
Here we do not shift the intrinsic stellar profiles to a common rest wavelength, as they can be later used to derive the velocity of the stellar surface.
The approach is the same with CCFs, except that everything is performed with a single band, and the scaling can be carried out in the CCF continuum (thus avoiding potential variations in the line shape)
when CCFs are given as input or calculated before the flux scaling, their continuum is normalized to unity outside of the transit
when CCFs are calculated from differential spectra the continuum is unknown a priori, as it depends on the reference spectrum to which each DI spectrum corresponds to, times the spectral flux scaling during transit. The differential spectra write as \(F_\mathrm{diff}(\lambda,t,v) = F_\mathrm{intr}(\lambda,t,v) (1 - \mathrm{LC}_\mathrm{theo}(B,t))\) when converting them into \(CCF_\mathrm{diff}\), we also compute the equivalent \(CCF_\mathrm{sc}\) of \((1 - \mathrm{LC}_\mathrm{theo}(B,t))\) \(CCF_\mathrm{diff}\) are then converted into \(CCF_\mathrm{intr}\) in this routine by dividing their continuum using \(CCF_\mathrm{sc}\) this is an approximation, since the spectral scaling cannot be isolated from \(F_\mathrm{intr}(\lambda,t,v)\) when computing \(CCF_\mathrm{diff}\), but it is the same approximation we do when scaling DI CCFs with a white light transit we take this approach rather than first calculate \(F_\mathrm{intr}\) and then its CCF because we need \(CCF_\mathrm{diff}\) to later derive the atmospheric CCFs ideally though, one should keep processing spectra rather than convert differential profiles into CCFs
- Parameters:
TBD
- Returns:
None
- calc_Intr_mean_cont(idx_in_tr, nord, nspec, proc_Intr_data_paths, data_type, cont_range, inst, cont_norm, flag_err, loc_type)[source]#
Intrinsic continuum calculation.
Calculates common continuum level for intrinsic profiles.
The continuum level is defined as a weighted mean because local CCFs at the limbs can be very poorly defined due to the partial occultation and limb-darkening.
If intrinsic CCFs were calculated from input CCF profiles, their continuum flux should match that of the out-of-transit CCFs (beware however that the scaling of disk-integrated profiles is done over their full range, not just the continuum). If differential or intrinsic profiles were converted from spectra, then their continuum is not know a priori. As a general approach we thus calculate the continuum value here
- Parameters:
TBD
- Returns:
None