HECATE.utils
Functions
|
Builds a sparse matrix W that linearly interpolates data from x_old → x_new. |
Classes
Fit a CCF or spectral line profile to observed CCF/spectral line. |
|
Class to compute limb darkening coefficients and specific intensity I(mu) for a given limb darkening law using LDTK. |
|
Collect orbital parameters and information, including orbital phases, mu, transit duration, duration between ingress and egress, array indices of in-transit and out-of-transit, |
|
Spectral line/CCF profile models. |
- class get_limb_darkening[source]
Bases:
objectClass to compute limb darkening coefficients and specific intensity I(mu) for a given limb darkening law using LDTK.
- Parameters:
stellar_params (dict) – dictionary containing the following stellar parameters: effective temperature and error, superficial gravity and error, metallicity and error.
planet_params (dict) – dictionary containing the following planetary parameters: system scale, planet-to-star radius ratio and planetary inclination.
wav_range (list) – list containing the minimum and maximum wavelengths [nm] of the spectrograph.
- compute_I(mu, coeffs, law)[source]
computes the specific intensity I(mu) for a given limb darkening law and coefficients.
- get_weighted_mu(phases_in, law, plot)[source]
computes the brightness weighted mu values for a given set of orbital phases and limb darkening law.
- get_geometric_mu(phases_in)[source]
computes the geometric mu values for a given set of orbital phases.
- ld_coeffs(law: str)[source]
Computes limb darkening coefficients for a given law using LDTK.
- Parameters:
law (str) – limb darkening law. Supported laws: linear, quadratic, square-root, exponential, claret-nonlinear.
- Returns:
coeffs – limb darkening coefficients for the specified law.
- Return type:
numpy array
- compute_I(mu: numpy.array, coeffs: numpy.array, law: str)[source]
Computes the specific intensity I(mu) for a given limb darkening law and coefficients.
- Parameters:
mu (numpy array) – array of mu values (cosine of the angle between the line of sight and the normal to the stellar surface).
coeffs (numpy array) – limb darkening coefficients for the specified law.
law (str) – limb darkening law. Supported laws: linear, quadratic, square-root, exponential, claret-nonlinear.
- Returns:
I – specific intensity I(mu) for the given limb darkening law and coefficients.
- Return type:
numpy array
- get_weighted_mu(phases_in: numpy.array, law: str, plot: bool = False)[source]
Computes the brightness weighted mu values for a given set of orbital phases and limb darkening law.
- Parameters:
phases_in (numpy array) – array of in-transit orbital phases.
law (str) – limb darkening law. Supported laws: linear, quadratic, square-root, exponential, claret-nonlinear.
plot (bool) – whether to plot the intensity map in a given position of the planet.
- Returns:
weighted_mu – array of brightness weighted mu values for the given in-transit orbital phases and limb darkening law.
- Return type:
numpy array
- get_geometric_mu(phases_in: numpy.array)[source]
Computes the geometric mu values for a given set of orbital phases.
- Parameters:
phases_in (numpy array) – array of in-transit orbital phases.
- Returns:
geometric_mu – array of geometric mu values for the given in-transit orbital phases.
- Return type:
numpy array
- class get_phase_mu[source]
Bases:
objectCollect orbital parameters and information, including orbital phases, mu, transit duration, duration between ingress and egress, array indices of in-transit and out-of-transit,
- Parameters:
planet_params (dict) – dictionary containing the following planetary parameters: orbital period, system scale, planet-to-star radius ratio, mid-transit time, eccentricity, argument of periastron, planetary inclination and spin-orbit angle.
time (numpy array) – time of observations in BJD.
- get_phase(planet_params, time)[source]
computes orbital phases, transit duration, time between ingress and egress, array indices in-transit and out-of-transit.
- linear_interpolation_matrix(x_old, x_new)[source]
Builds a sparse matrix W that linearly interpolates data from x_old → x_new. Each row i corresponds to interpolation weights for x_new[i].
- Parameters:
x_old, x_new (numpy array) – original and interpolated arrays.
- Returns:
W – linear interpolation matrix.
- Return type:
numpy array
- class profile_models[source]
Bases:
objectSpectral line/CCF profile models. Models available: modified Gaussian, Gaussian and Lorentzian.
- Parameters:
model (str) – type of profile model to fit.
num_lines (int) – number of lines to fit (1 for single line, 2 for doublet).
- _build_model(model_type, num_lines)[source]
builds the model function for curve fitting based on the specified model type and number of lines.
- class fit_profile[source]
Bases:
objectFit a CCF or spectral line profile to observed CCF/spectral line.
- Parameters:
phase (float) – orbital phase.
data (numpy array) – CCF profile (RV, flux and flux error) or spectral line profile (wavelength, flux and flux error).
data_type (str) – whether it’s a CCF or spectral line profile.
observation_type (str) – whether it’s a local, average out-of-transit or raw profile.
model_type (str) – type of profile model to fit.
- fit_profile(wave_ctr_line, mask_x, print_output)
fits the specified profile model to the observed CCF/spectral line and returns the fitted profile parameters, coefficient of determination, profile data and fitted profile for plotting.