antaress.ANTARESS_analysis.ANTARESS_model_prof module#
- dispatch_func_prof(line_func)[source]#
Line profile model dispatching
Returns the chosen line profile function.
- Parameters:
line_func (str) – name of the chosen function
- Returns:
func (function) – chosen function
- comm_voigt_line(temp_sp, mass_sp, vsini, Vmac, Vmic, wline_rest, delta_line, rv_gas_star, wav_star_tab)[source]#
Line model: common Voigt terms
- Parameters:
TBD
- Returns:
TBD
- voigt_abs_line(wline_rest, temp_sp, mass_sp, vsini, Vmac, Vmic, delta_line, rv_gas_star, wav_star_tab, s_vu0_line, logN_sp)[source]#
Line model: Voigt absorption line
Calculates stellar or interstellar absorption line as Voigt profile.
- Parameters:
TBD
- Returns:
TBD
- voigt_em_line(wline_rest, temp_sp, mass_sp, vsini, Vmac, Vmic, delta_line, rv_gas_star, wav_star_tab, Ftot_line)[source]#
Line model: Voigt emission line
Calculates stellar or telluric emission line as Voigt profile.
- Parameters:
TBD
- Returns:
TBD
- voigt(param, x, args=None)[source]#
Line model: Voigt
Calculates Voigt profile, expressed in terms of the Faddeeva function (factorless)
\[V(rv) = Real(w(x))\]As a function of
\[\begin{split}x &= ((rv-rv_0) + i \gamma)/(\sqrt{2} \sigma) \\ &= (rv-rv_0)/(\sqrt{2} \sigma) + i a \\ &= 2 \sqrt{\ln{2}} (rv-rv_0)/\mathrm{FWHM}_\mathrm{gauss} + i a\end{split}\]Where a is the damping coefficient
\[\begin{split}a &= \gamma/(\sqrt{2} \sigma) \\ &= 2 \gamma \sqrt{\ln{2}}/\mathrm{FWHM}_\mathrm{gauss} \\ &= \sqrt{\ln{2}} \mathrm{FWHM}_\mathrm{lor}/\mathrm{FWHM}_\mathrm{gauss}\end{split}\]The \(\mathrm{FWHM}_\mathrm{gauss}\) parameter is that of the Gaussian component (factorless)
\[\begin{split}G(rv) &= \exp(- (rv-rv_0)^2/ ( \mathrm{FWHM}_\mathrm{gauss}/(2 \sqrt{\ln{2}}) )^2 ) \\ &= \exp(- (rv-rv_0)^2/ 2 ( \mathrm{FWHM}_\mathrm{gauss}/(2 \sqrt{2 \ln{2}}) )^2 ) \\ &= \exp(- (rv-rv_0)^2/ 2 \sigma^2 )\end{split}\]With \(\sigma = \mathrm{FWHM}_\mathrm{gauss}/(2 \sqrt{\ln{2}})\) and \(\mathrm{FWHM}_\mathrm{lor} = 2 \gamma\)
The full-width at half maximum of the Voigt profile approximates as
\[\mathrm{FWHM}_\mathrm{voigt} = 0.5436 \mathrm{FWHM}_\mathrm{lor}+ \sqrt{0.2166 \mathrm{FWHM}_\mathrm{lor}^2 + \mathrm{FWHM}_\mathrm{gauss}^2}\]From J.J.Olivero and R.L. Longbothum in Empirical fits to the Voigt line width: A brief review, JQSRT 17, P233
- Parameters:
TBD
- Returns:
TBD
- voigt_em(params, x)[source]#
Line model: Emission Voigt.
Returns Voigt profile in emission.
- Parameters:
x (array) – Spectral table over which Voigt is computed, in wave number (cm-1)
params['HWHM'] (float) – HWHM of the Voigt.
params['gamma'] (float) – Damping coefficient of the Voigt.
params['center'] (float) – Central value of the Voigt over x.
- Returns:
ymodel (array) – Voigt profile.
- max_voigt_em(HWHM, gamma)[source]#
Line model properties: Emission Voigt maximum.
Returns Voigt profile in emission at line center
- Parameters:
HWHM (float) – HWHM of the Voigt.
gamma (float) – Damping coefficient of the Voigt.
- Returns:
max_prof (array) – Voigt profile maximum.
- dvoigt(param, x, args=None)[source]#
Line model: Double Voigt
Calculates Double-Voigt profile.
Typically used to model deep stellar line with Voigt-like wings and Gaussian core.
The two profiles parameters are defined through their ratio or difference.
- Parameters:
TBD
- Returns:
TBD
- lor_em(param, x, args=None)[source]#
Line model: Emission Lorentzian
Calculates Lorentzian profile in emission.
- Parameters:
x (array) – Spectral grid over which Lorentzian is computed, in wave number (cm-1)
param['HWHM'] (float) – Half-width at half-maximum.
param['center'] (float) – Central value of the Lorentzian over x.
- Returns:
ymodel (array) – Lorentzian profile.
- max_lor_em(HWHM)[source]#
Line model properties: Emission Lorentzian maximum.
Returns Lorentzian profile in emission at line center.
- Parameters:
HWHM (float) – Lorentzian of the Voigt.
- Returns:
max_prof (array) – Maximum of Lorentzian profile.
- gauss_intr_prof(param, x, args=None)[source]#
Line model: Gaussian
Calculates Gaussian profile.
- Parameters:
TBD
- Returns:
TBD
- gauss_herm_lin(param, x, args=None)[source]#
Line model: Skewed Gaussian
Calculates Gaussian profile with hermitian polynom term for skewness/kurtosis.
- Parameters:
TBD
- Returns:
TBD
- gauss_poly(param, x, args=None)[source]#
Line model: Sidelobed Gaussian
Calculates Gaussian profile with flat continuum and polynomial for sidelobes.
- Parameters:
TBD
- Returns:
TBD
- dgauss(param, x, args=None)[source]#
Line model: Double Gaussian
Calculates Double-Gaussian profile.
Typically used to model sidelobed CCFs, with Gaussian in absorption co-added with a Gaussian in emission at the core.
The Gaussian profiles are centered but their amplitude and width can be fixed or independant. The model is defined as
\[\begin{split}F &= F_\mathrm{cont} + A_\mathrm{core} \exp(f_1) + A_\mathrm{lobe} \exp(f_2) \\ F &= F_\mathrm{cont} + A_\mathrm{core} ( \exp(f_1) - A_\mathrm{l2c} \exp(f_2) )\end{split}\]We define a contrast parameter as the relative flux between the continuum and the CCF minimum
\[\begin{split}C &= (F_\mathrm{cont} - (F_\mathrm{cont} + A_\mathrm{core} - A_\mathrm{core} A_\mathrm{l2c}) ) / F_\mathrm{cont} \\ C &= -A_\mathrm{core} ( 1 - A_\mathrm{l2c}) / F_\mathrm{cont} \\ A_\mathrm{core} &= -C F_\mathrm{cont}/( 1 - A_\mathrm{l2c}) \\ A_\mathrm{lobe} &= -A_\mathrm{l2c} A_\mathrm{core} = A_\mathrm{l2c} C F_\mathrm{cont}/( 1 - A_\mathrm{l2c})\end{split}\]Thus the model can be expressed as
\[\begin{split}F &= F_\mathrm{cont} - C F_\mathrm{cont} ( \exp(f_1) - A_\mathrm{l2c} \exp(f_2) )/( 1 - A_\mathrm{l2c}) \\ F &= F_\mathrm{cont} ( 1 - C ( \exp(f_1) - A_\mathrm{l2c} \exp(f_2) )/( 1 - A_\mathrm{l2c}) )\end{split}\]- Parameters:
TBD
- Returns:
TBD
- ana_abs_star_spec_model(outputs_dic, cen_bins, lines_list, lines_prop, lines_prof, species_prop, star_params, param, p2i, ep_suff)[source]#
Analytical spectrum: absorption
Calculates an analytical spectrum of the stellar absorption lines with continuum unity.
The model can be used for the full stellar disk or local regions. See ANTARESS_settings for details about the profiles.
- Parameters:
TBD
- Returns:
TBD
- ana_em_star_spec_model(outputs_dic, cen_bins, dcen_bins, lines_list, lines_prop, lines_prof, species_prop, star_params, param, p2i, ep_suff)[source]#
Analytical spectrum: absorption
Calculates an analytical spectrum of the stellar emission lines with continuum unity.
The model can be used for the full stellar disk or local regions. See ANTARESS_settings for details about the profiles.
- Parameters:
TBD
- Returns:
TBD
- prof_cont_model(x_polref, coeff_pol, x)[source]#
Line model: continuum
Calculates spectral profile polynomial continuum.
- Parameters:
TBD
- Returns:
TBD
- calc_macro_ker_rt(rv_mac_kernel, param, cos_th, sin_th)[source]#
Macroturbulence broadening: anisotropic Gaussian
Calculates broadening kernel for local macroturbulence, based on formulation with anisotropic gaussian (Takeda & UeNo 2017)
- Parameters:
TBD
- Returns:
TBD
- calc_macro_ker_anigauss(rv_mac_kernel, param, cos_th, sin_th)[source]#
Macroturbulence broadening: radial-tangential
Calculates broadening kernel for local macroturbulence, based on radial-tangential model (Gray 1975, 2005)
- Parameters:
TBD
- Returns:
TBD
- dopp_width(temp_sp, mass_sp, vsini, Vmac, Vmic, wline)[source]#
Doppler broadening
Calculates spectral line broadening from thermal and non-thermal broadening.
- Parameters:
TBD
- Returns:
None
- autom_ranges(data_type_gen, data_dic, inst, vis, gen_dic, coord_dic, star_params, mock_dic, txt_shift='')[source]#
Automatic definition of continuum and fit ranges
Defines the velocity or wavelength range(s) for the continuum or the fit of spectral line profiles.
- Parameters:
TBD
- Returns:
None
- calc_linevar_coord_grid(coord, grid)[source]#
Line profile coordinate dispatching
Returns the relevant coordinate for calculation of line properties variations.
- Parameters:
TBD
- Returns:
TBD
- calc_polymodu(pol_mode, coeff_pol, x_val)[source]#
Line profile coordinate models
Calculates absolute or modulated polynomial
The list of polynomial coefficient ‘coeff_pol’ has been defined in increasing powers, as expected by Polynomial, using input coefficient defined through their power value (see polycoeff_def())
- Parameters:
TBD
- Returns:
TBD
- polycoeff_def(param, coeff_ord2name_polpar)[source]#
Line profile coordinate coefficients
Defines polynomial coefficients from the Parameter() format through their power value
- Parameters:
TBD
- Returns:
TBD
- calc_biss(Fnorm_in, RV_tab_in, RV_min, max_rv_range, dF_grid, resamp_mode, Cspan)[source]#
Bissector.
Calculates bissector for a line profile provided in RV space as input.
- Parameters:
TBD
- Returns:
TBD
- gauss_intr_prop(ctrst_intr, FWHM_intr, FWHM_inst)[source]#
Intrinsic > Measured Gaussian properties.
Estimates the FWHM and contrast of a measured-like Gaussian profile, defined as the convolution of a Gaussian intrinsic model profile and a Gaussian instrumental response.
The FWHM can be expressed as
\[\begin{split}\mathrm{FWHM} &= \sqrt{\mathrm{FWHM}_\mathrm{intr}^2 + \mathrm{FWHM}_\mathrm{inst}^2 } \\ \mathrm{with}\,\sigma &= \frac{\mathrm{FWHM}}{2 \sqrt{\ln{2}}} = \sqrt{\sigma_\mathrm{intr}^2 + \sigma_\mathrm{inst}^2 }\end{split}\]The area of the measured convolution profile is equal to the product of the area of the intrinsic and instrumental convolved profiles, providing an analytical expression for the contrast. The instrumental kernel, with area = 1, is expressed as
\[\begin{split}f_\mathrm{kern}(rv) &= \frac{1}{\sqrt{2 \pi} \sigma_\mathrm{inst} } \exp^{ -\frac{rv^2}{2 \sigma_\mathrm{inst}^2} } \\ \mathrm{where}\,\sigma_\mathrm{inst} &= \frac{\mathrm{FWHM}_\mathrm{inst}}{ 2 \sqrt{2 \log{2}} }\end{split}\]The intrinsic profile, with area = \(\mathrm{A}_\mathrm{intr}\), is expressed as
\[\begin{split}f_\mathrm{intr}(rv) &= \frac{\mathrm{A}_\mathrm{intr}}{\sqrt{2 \pi} \sigma_\mathrm{intr} } \exp^{ -\frac{rv^2}{2 \sigma_\mathrm{intr}^2} } \\ \mathrm{where}\,\sigma_\mathrm{intr} &= \frac{\mathrm{FWHM}_\mathrm{intr}}{ 2 \sqrt{2 \ln{2}} }\end{split}\]The contrast C of the measured profile relates to its area A as
\[\begin{split}C &= \frac{A}{\sqrt{2 \pi} \sigma } \\ &= \frac{1 \times \mathrm{A}_\mathrm{intr} }{ \sqrt{2 \pi (\sigma_\mathrm{intr}^2 + \sigma_\mathrm{inst}^2 ) }} \\ &= \frac{\mathrm{C}_\mathrm{intr} \sqrt{2 \pi} \sigma_\mathrm{intr} }{\sqrt{2 \pi (\sigma_\mathrm{intr}^2 + \sigma_\mathrm{inst}^2 ) }} \\ &= \frac{\mathrm{C}_\mathrm{intr} \sigma_\mathrm{intr} }{\sqrt{\sigma_\mathrm{intr}^2 + \sigma_\mathrm{inst}^2}} \\ &= \frac{\mathrm{C}_\mathrm{intr} \mathrm{FWHM}_\mathrm{intr} }{\sqrt{\mathrm{FWHM}_\mathrm{intr}^2 + \mathrm{FWHM}_\mathrm{inst}^2}}\end{split}\]This is only valid for analytical profiles. For numerical profiles, the model is the sum of intrinsic profiles over the planet-occulted surface that may have non-Gaussian shape, and which are further broadened by the local surface rv field. In that case, use cust_mod_true_prop().
- Parameters:
TBD
- Returns:
TBD
- cust_mod_true_prop(param, velccf_HR, args)[source]#
Intrinsic > Measured line properties.
Estimates the FWHM and contrast of a measured-like line profile with custom shape. This is done numerically, calculating the model profile at high resolution.
Contrast is counted from the estimated continuum. For double-gaussian profiles, the peaks of the lobes are considered as the closest estimate to the true stellar continuum.
FWHM is calculated by finding the points on the blue side at half-maximum, and on the red side.
- Parameters:
TBD
- Returns:
TBD
- proc_cust_mod_true_prop(merged_chain_proc, args, param_loc)[source]#
Wrap-up of cust_mod_true_prop().
Estimates the FWHM and contrast of a measured-like line profile with custom shape, for a sample of properties.
- Parameters:
TBD
- Returns:
TBD
- para_cust_mod_true_prop(func_input, nthreads, n_elem, y_inputs, common_args)[source]#
Multithreading routine for proc_cust_mod_true_prop().
- Parameters:
func_input (function) – multi-threaded function
nthreads (int) – number of threads
n_elem (int) – number of elements to thread
y_inputs (list) – threadable function inputs
common_args (tuple) – common function inputs
- Returns:
y_output (None or specific to func_input) – function outputs