A StarPlanet class instance represents a star-planet system and acts as an interface for the
core capabilities of the OrbDot package. It combines the data, methods, and attributes needed
to run model fitting routines and interpret the results.
Updates the prior distribution for the specified parameter.
Parameters:
parameter (str) – The parameter name.
new_prior (list) – A list three of values specifying the prior distribution, where the first element is
the type of prior ("uniform", "gaussian", or "log"), and subsequent
elements define the distribution.
Returns:
None – The prior distribution for the specified parameter is updated.
This class enables various computations related to the long-term variations of exoplanet orbits.
It combines model fit results, star-planet system characteristics, and data to compute and
summarize analyses of various physical models, such as the effects of equilibrium tides,
apsidal precession, systemic proper motion, and companion objects.
Interprets the results of an apsidal precession model fit.
This method produces a concise summary of various interpretations of the results of an
apsidal precession model fit, independent of the data type(s) that are fit.
Parameters:
printout (bool, optional) – An option to print the results to the console.
Returns:
None – The results are written to a text file.
Raises:
IndexError – If the results of an apsidal precession model fit are not available.
where \(\log{\mathrm{Z}}\) is the Bayesian evidence. The Bayes factor is then
evaluated against the thresholds established by Kass and Raftery (1995) [1]_.
Parameters:
model_2_results (dict) – The dictionary returned by the alternative model fit.
printout (bool, optional) – An option to print the results to the console.
Interprets the results of an orbital decay model fit.
This method produces a concise summary of various interpretations of the results of an
orbital decay model fit, independent of the data type(s) that are fit.
Parameters:
printout (bool, optional) – An option to print the results to the console.
Returns:
None – The results are written to a text file.
Raises:
IndexError – If the results of an orbital decay model fit are not available.
Estimates the minimum period of an outer companion given a quadratic fit to RV residuals.
This method analyzes the best-fit quadratic radial velocity trend to estimate the minimum
orbital period of an outer companion that could cause such acceleration, assuming that
the orbit is circular. It is designed to work in tandem with the
companion_from_quadratic_rv() method, which uses Equations 1,
3, and 4 of Kipping et al. (2011) [1]_.
Returns:
float – Lower limit for the orbital period of an outer companion in days.
If both \(\dot{\gamma}\) and \(\ddot{\gamma}\) are nonzero, residuals are
quadratic, but if \(\ddot{\gamma} = 0\) they are linear. For the latter case,
this method is not valid.
The minimum orbital period of the companion is loosely constrained by the length of the
baseline of RV observations. Assuming that the companion’s orbit is circular, for which
the signal is sinusoidal, the minimum period is approximated as 4x the span of time
between the vertex of the quadratic trend and furthest edge of the observed baseline:
The user may choose between two packages, Nestle [1]_ or PyMultiNest [2]_. PyMultiNest is
generally faster and more robust, but it can be tricky to install, thus it is not a
requirement to use this code. The desired sampler is specified in the settings file as
"nestle" or "multinest".
This function selects random samples from a given array of weighted posterior samples and
retrieves the corresponding parameter values using the get_vals method.
Parameters:
weighted_samples (array_like) – Array of weighted posterior samples.
num (int, optional) – Number of random samples to generate. Default is 300.
Retrieves the 68% credible intervals on each parameter.
This method returns the 68% credible intervals on each free parameter with a given
array of weighted posterior samples. If a model parameter was not allowed to vary in the
model fit, its default value is recorded for completeness.
Parameters:
samples (array_like) – The weighted posterior samples.
Returns:
dict – A dictionary containing the best-fit parameter values.
Notes
If the user has chosen to fit "ecosw" and "esinw" or "sq_ecosw" and
"sq_esinw", the corresponding "e0" and "w0" values are calculated.
Retrieves the index (order) of the free parameters.
This method iterates through the list of free parameters and determines the index
(order) of each free parameter, storing them in instance variables for later use.
Retrieves and returns values for the full set of OrbDot parameters.
This function combines and returns values for the entire set of OrbDot model parameters,
allowing them to be easily passed to a physical model or log-likelihood function. For any
parameter that is not allowed to vary in the model fit, its default value is recorded.
Parameters:
theta (array_like) – An array containing parameter values, passed from the sampling algorithm.
Returns:
orbital_elements (list) – A list of the orbital element parameters, in the order: "t0", "P0", "e0",
"w0", "i0", "O0".
time_dependent (list) – A list of the time-dependent parameters, in the order: "PdE", "wdE",
"edE", "idE", "OdE".
radial_velocity (list) – A list of the radial velocity parameters, in the order: "K", "v0", "jit",
"dvdt", "ddvdt", K_tide.
Notes
If the user has chosen to fit "ecosw" and "esinw" or "sq_ecosw" and
"sq_esinw", the corresponding "e0" and "w0" values are calculated.
Transforms a parameter from the unit hypercube value to a physical value.
This method transforms the current state of the free parameters from the unit hypercube (
in the range 0 to 1) to their true values based on the specified prior distributions. The
transformed parameters may then be passed to the log-likelihood function by the sampler.
Parameters:
theta (array_like) – Array containing the current state of the free parameters in the unit hypercube.
Returns:
trans (array_like) – Array containing the transformed values of the free parameters.
Runs a model fit with the nested sampling package PyMultiNest.
This method is an overhead function that performs a model fit using the PyMultiNest Python
package [1]_. PyMultiNest is imported within this function, so that it does not need to be
installed if Nestle is preferred.
Parameters:
loglike (callable) – A single-argument function that computes the log-likelihood for the desired model.
free_params (list) – A list of free parameters.
n_points (int) – The number of live points.
tol (int) – The evidence tolerance.
save_dir (str) – The directory to save the PyMultiNest chains.
run_num (int, optional) – Number for tagging the PyMultiNest chains, if the user wishes to resume a run.
resume (bool, optional) – Resumes a run of the sampler (by run number), rather than re-starting it.
Returns:
tuple –
A tuple with the following elements:
A dictionary containing the results of the model fit.
Runs a model fit with the nested sampling package Nestle.
This method is an overhead function that performs a model fit using the Nestle Python
package [1]_. Nestle is imported within this function, so that it does not need to be
installed if PyMultiNest is preferred.
Parameters:
loglike (callable) – A single-argument function that computes the log-likelihood for the desired model.
free_params (list) – A list of free parameters.
method (str) – The Nestle sampling type, which may be “multi” for multiple ellipsoids, “single” for
single ellipsoid, or “classic” for classic MCMC exploration.
n_points (int) – The number of live points.
tol (int) – The evidence tolerance.
Returns:
tuple –
A tuple with the following elements:
A dictionary containing the results of the model fit.
This class utilizes the capabilities of the NestedSampling
class to support joint model fitting of transit/eclipse mid-times, radial velocities,
and transit durations.
Run a model fit on multiple data types simultaneously.
This method executes a model fit for any combination of data types using one of two
nested sampling packages: Nestle [1]_ or PyMultiNest [2]_.
At least two data types must be specified when calling this method. Use the TTV=True
argument to include transit and/or eclipse mid-times, RV=True to include radial
velocities, and TDV=True to include transit durations.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be part of the physical model.
TTV (bool) – If True, the transit and/or eclipse timing data are included in the model fit.
Default is False.
RV (bool) – If True, the radial velocity data are included in the model fit. Default is False.
TDV (bool) – If True, the transit duration data are included in the model fit. Default is False.
model (str, optional) – The timing model, must be "constant", "decay", or "precession". Default is
"constant".
file_suffix (str, optional) – A string appended to the end of the output file names.
make_plot (bool, optional) – If True, relevant plots are generated. Default is True.
sigma_clip (bool, optional) – Option to execute a sigma-clipping routine on the transit mid-times. Default is False.
clip_model (str, optional) – Specifies the model to be used in the sigma-clipping routine. The options are
"linear" or "quadratic", with the default being "linear".
Returns:
res (dict) – A dictionary containing the model fit results and settings.
This method executes a simultaneous model fit of the radial velocity and transit duration
data. It uses one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_. The
physical model is specified by the model argument, which may be equal to
"constant" for an unchanging orbit, "decay" for orbital decay,
or "precession" for apsidal precession.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","i0","PdE","wdE","K","v0","jit","dvdt","ddvdt"]
model (string) – The desired physical model, must be "constant", "decay", or "precession".
Default is "constant".
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, TDV and RV plots are generated. Default is True.
Returns:
res (dict) – A dictionary containing the results of the fit for access within a script
Note
The following output files are generated:
"rv_tdv_<model>_summary.txt": a quick visual summary of the results
"rv_tdv_<model>_results.json": the entire model fitting results dictionary.
"rv_tdv_<model>_corner.png": a corner plot.
"rv_tdv_<model>_weighted_samples.txt": the weighted posterior samples.
"rv_tdv_<model>_random_samples.json": a random set of 300 posterior samples.
This method executes a simultaneous model fit of the transit/eclipse mid-times and radial
velocity data. It uses one of two nested sampling packages, Nestle [1]_ or PyMultiNest [
2]_. The physical model is specified by the model argument, which may be equal to
"constant" for an unchanging orbit, "decay" for orbital decay,
or "precession" for apsidal precession.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","PdE","wdE","K","v0","jit","dvdt","ddvdt"].
model (string) – The desired physical model, must be "constant", "decay", or "precession".
Default is "constant".
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, TTV and RV plots are generated. Default is True.
clip (bool) – Option to execute a sigma-clipping routine on the transit mid-times. Default is False.
clip_method (str) – Specifies the model to be used in the sigma-clipping routine. The options are
"linear" or "quadratic", with the default being "linear".
save (bool) – If False, the output files are not saved.
Returns:
res (dict) – A dictionary containing the results of the fit for access within a script
Note
The following output files are generated:
"ttv_rv_<model>_summary.txt": a quick visual summary of the results
"ttv_rv_<model>_results.json": the entire model fitting results dictionary.
"ttv_rv_<model>_corner.png": a corner plot.
"ttv_rv_<model>_weighted_samples.txt": the weighted posterior samples.
"ttv_rv_<model>_random_samples.json": a random set of 300 posterior samples.
This method executes a simultaneous model fit of the transit/eclipse mid-times,
radial velocity, and transit duration data. It uses one of two nested sampling packages,
Nestle [1]_ or PyMultiNest [2]_. The physical model is specified by the model
argument, which may be equal to "constant" for an unchanging orbit, "decay" for
orbital decay, or "precession" for apsidal precession.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","i0","PdE","wdE","K","v0","jit","dvdt","ddvdt"].
model (string) – The desired physical model, must be "constant", "decay", or "precession".
Default is "constant".
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, the TTV, RV, and TDV plots are generated. Default is True.
clip (bool) – Option to execute a sigma-clipping routine on the transit mid-times. Default is False.
clip_method (str) – Specifies the model to be used in the sigma-clipping routine. The options are
"linear" or "quadratic", with the default being "linear".
save (bool) – If False, the output files are not saved.
Returns:
res (dict) – A dictionary containing the results of the fit for access within a script
Note
The following output files are generated:
"ttv_rv_tdv_<model>_summary.txt": a quick visual summary of the results
"ttv_rv_tdv_<model>_results.json": the entire model fitting results dictionary.
"ttv_rv_tdv_<model>_corner.png": a corner plot.
"ttv_rv_tdv_<model>_weighted_samples.txt": the weighted posterior samples.
"ttv_rv_tdv_<model>_random_samples.json": a random set of 300 posterior samples.
This method executes a simultaneous model fit of the transit/eclipse mid-times and
transit duration data. It uses one of two nested sampling packages, Nestle [1]_ or
PyMultiNest [2]_. The physical model is specified by the model argument, which may be
equal to "constant" for an unchanging orbit, "decay" for orbital decay,
or "precession" for apsidal precession.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","i0","PdE","wdE"].
model (string) – The desired physical model, must be "constant", "decay", or "precession".
Default is "constant".
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, TTV and TDV plots are generated. Default is True.
clip (bool) – Option to execute a sigma-clipping routine on the transit mid-times. Default is False.
clip_method (str) – Specifies the model to be used in the sigma-clipping routine. The options are
"linear" or "quadratic", with the default being "linear".
save (bool) – If False, the output files are not saved.
Returns:
res (dict) – A dictionary containing the results of the fit for access within a script
Note
The following output files are generated:
"ttv_tdv_<model>_summary.txt": a quick visual summary of the results
"ttv_tdv_<model>_results.json": the entire model fitting results dictionary.
"ttv_tdv_<model>_corner.png": a corner plot.
"ttv_tdv_<model>_weighted_samples.txt": the weighted posterior samples.
"ttv_tdv_<model>_random_samples.json": a random set of 300 posterior samples.
This method runs an iterative sigma-clipping routine on the observed transit mid-times,
originally developed in Hagey et al. (2022) [1]_. At every iteration, the best-fit model
(linear or quadratic) is subtracted from the observed mid-times, and any data point that
lies outside of 3 standard deviations from the mean are removed. This process is repeated
until no remaining data points fit this criteria, or until a maximum number of iterations
has been reached.
Parameters:
outfile_cleaned (str) – File path for saving the the cleaned data.
outfile_clipped (str) – File path for saving the the excluded (“clipped”) data.
method (str, optional) – The timing model to be subtracted from the data at every iteration. The options are
"linear" or "quadratic", with the default being "linear".
max_iters (int, optional) – The maximum number of iterations. Default is 20.
This method executes a constant-period model fit of the observed transit and/or eclipse
mid-times using one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw"].
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, a TTV (O-C) plot is generated.
clip (bool) – If True, a sigma-clipping routine is run on the transit mid-times before model fitting.
clip_method (str) – Specifies the model to be used in the sigma-clipping routine, either "linear" or
"quadratic".
save (bool) – If False, the output files are not saved.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"ttv_constant_summary.txt": a quick visual summary of the results
"ttv_constant_results.json": the entire model fitting results dictionary.
"ttv_constant_corner.png": a corner plot.
"ttv_constant_weighted_samples.txt": the weighted posterior samples.
"ttv_constant_random_samples.json": a random set of 300 posterior samples.
This method executes an orbital decay model fit of the observed transit and/or eclipse
mid-times using one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","PdE","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw"].
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, a TTV (O-C) plot is generated.
save (bool) – If False, the output files are not saved.
clip (bool) – If True, a sigma-clipping routine is run on the transit mid-times before model fitting.
clip_method (str) – Specifies the model to be used in the sigma-clipping routine, either "linear" or
"quadratic".
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"ttv_decay_summary.txt": a quick visual summary of the results
"ttv_decay_results.json": the entire model fitting results dictionary.
"ttv_decay_corner.png": a corner plot.
"ttv_decay_weighted_samples.txt": the weighted posterior samples.
"ttv_decay_random_samples.json": a random set of 300 posterior samples.
Run a model fit of the observed transit and/or eclipse mid-times.
This method executes a model fit of the observed transit and/or eclipse mid-times using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must part of the physical model.
model (str, optional) – The timing model, must be "constant", "decay", or "precession". Default is
"constant".
file_suffix (str, optional) – A string appended to the end of the output file names.
make_plot (bool, optional) – If True, a TTV (O-C) plot is generated. Default is True.
sigma_clip (bool, optional) – Option to execute a sigma-clipping routine on the transit mid-times. Default is False.
clip_model (str, optional) – Specifies the model to be used in the sigma-clipping routine. The options are
"linear" or "quadratic", with the default being "linear".
Returns:
res (dict) – A dictionary containing the model fit results and settings.
This method executes an apsidal precession model fit of the observed transit and/or eclipse
mid-times using one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","wdE","ecosw","esinw","sq_ecosw",sq_esinw"].
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, a TTV (O-C) plot is generated.
save (bool) – If False, the output files are not saved.
clip (bool) – If True, a sigma-clipping routine is run on the transit mid-times before model fitting.
clip_method (str) – Specifies the model to be used in the sigma-clipping routine, either "linear" or
"quadratic".
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"ttv_precession_summary.txt": a quick visual summary of the results
"ttv_precession_results.json": the entire model fitting results dictionary.
"ttv_precession_corner.png": a corner plot.
"ttv_precession_weighted_samples.txt": the weighted posterior samples.
"ttv_precession_random_samples.json": a random set of 300 posterior samples.
Run a fit of the constant-period radial velocity model.
This method executes a constant-period model fit of the observed radial velocities using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","K","v0","jit","dvdt","ddvdt"]. If the data are
from multiple sources, the instrument-dependent parameters ("v0" and "jit")
are split into multiple variables before the fit is performed.
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, an RV plot is generated.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"rv_constant_summary.txt": a quick visual summary of the results
"rv_constant_results.json": the entire model fitting results dictionary.
"rv_constant_corner.png": a corner plot.
"rv_constant_weighted_samples.txt": the weighted posterior samples.
"rv_constant_random_samples.json": a random set of 300 posterior samples.
Run a fit of the orbital decay radial velocity model.
This method executes an orbital decay model fit of the observed radial velocities using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","PdE","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","K","v0","jit","dvdt","ddvdt"]. If the
data are from multiple sources, the instrument-dependent parameters ("v0" and
"jit") are split into multiple variables before the fit is performed.
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, an RV plot is generated.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"rv_decay_summary.txt": a quick visual summary of the results
"rv_decay_results.json": the entire model fitting results dictionary.
"rv_decay_corner.png": a corner plot.
"rv_decay_weighted_samples.txt": the weighted posterior samples.
"rv_decay_random_samples.json": a random set of 300 posterior samples.
Run a model fit of the radial velocity measurements.
This method executes a model fit of the observed radial velocities using one of two
nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be part of the physical model. If the data are from
multiple sources, the instrument-dependent parameters ("v0" and "jit") are
split into multiple variables before the fit is performed.
model (str, optional) – The radial velocity model, must be "constant", "decay", or "precession".
Default is "constant".
file_suffix (str, optional) – A string appended to the end of the output file names.
make_plot (bool, optional) – If True, an RV plot is generated. Default is True.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Run a fit of the apsidal precession radial velocity model.
This method executes an apsidal precession model fit of the observed radial velocities using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["t0","P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","wdE","K","v0","jit","dvdt","ddvdt"]. If the
data are from multiple sources, the instrument-dependent parameters ("v0" and
"jit") are split into multiple variables before the fit is performed.
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, an RV plot is generated.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"rv_precession_summary.txt": a quick visual summary of the results
"rv_precession_results.json": the entire model fitting results dictionary.
"rv_precession_corner.png": a corner plot.
"rv_precession_weighted_samples.txt": the weighted posterior samples.
"rv_precession_random_samples.json": a random set of 300 posterior samples.
Run a fit of the constant-period transit duration model.
This method executes a constant-period model fit of the observed transit durations using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","i0"].
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, a TDV plot is generated.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"tdv_constant_summary.txt": a quick visual summary of the results
"tdv_constant_results.json": the entire model fitting results dictionary.
"tdv_constant_corner.png": a corner plot.
"tdv_constant_weighted_samples.txt": the weighted posterior samples.
"tdv_constant_random_samples.json": a random set of 300 posterior samples.
Run a fit of the orbital decay transit duration model.
This method executes an orbital decay model fit of the observed transit durations using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","i0","PdE"].
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, a TDV plot is generated.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"tdv_decay_summary.txt": a quick visual summary of the results
"tdv_decay_results.json": the entire model fitting results dictionary.
"tdv_decay_corner.png": a corner plot.
"tdv_decay_weighted_samples.txt": the weighted posterior samples.
"tdv_decay_random_samples.json": a random set of 300 posterior samples.
Run a model fit of the observed transit durations.
This method executes a model fit of the observed transit durations using one of two
nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be part of the physical model.
model (str, optional) – The transit duration model, must be "constant", "decay",
or "precession". Default is "constant".
file_suffix (str, optional) – A string appended to the end of the output file names.
make_plot (bool, optional) – If True, a TDV plot is generated. Default is True.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Run a fit of the apsidal precession transit duration model.
This method executes an apsidal precession model fit of the observed transit durations using
one of two nested sampling packages, Nestle [1]_ or PyMultiNest [2]_.
Parameters:
free_params (list or tuple) – The list of free parameters for the model fit, in any order. The parameter names are
formatted as strings and must be in the set: ["P0","e0","w0","ecosw","esinw","sq_ecosw",sq_esinw","i0","wdE"].
suffix (str) – A string appended to the end of the output file names.
plot (bool) – If True, a TDV plot is generated.
Returns:
res (dict) – A dictionary containing the model fit results and settings.
Note
The following output files are generated:
"tdv_precession_summary.txt": a quick visual summary of the results
"tdv_precession_results.json": the entire model fitting results dictionary.
"tdv_precession_corner.png": a corner plot.
"tdv_precession_weighted_samples.txt": the weighted posterior samples.
"tdv_precession_random_samples.json": a random set of 300 posterior samples.
This module defines analytical models for investigating the source of long-term variations of
exoplanet orbits. These include equations for assessing the effects of tidal energy dissipation,
apsidal precession, systemic proper motion, and more.
Calculate the apparent variation of an orbital period due to a line-of-sight acceleration.
This method returns the time derivative of the observed orbital period of a transiting
exoplanet due to the Doppler effect induced by an acceleration along the line-of-sight (i.e.
a linear RV trend). It uses equation (6) from Bouma et al. (2020) [1]_, which is derived in
convenient units.
Parameters:
P (float) – The orbital period in days.
dvdt (float) – The first-order radial acceleration term in m/s/day.
Returns:
float – The apparent time derivative of the orbital period in milliseconds per year.
Notes
When radial velocity data of a transiting exoplanet’s host star show a linear trend,
and assuming this trend is a real effect, the Doppler effect can cause the observed period
between transits to vary. Equation (6) from Bouma et al. (2020) [1]_ expresses the expected
period derivative in convenient units:
where \(P\) is the orbital period of the transiting planet, \(\dot{P}_{\mathrm{
RV}}\) is the time derivative of the period, and \(\dot{\gamma}\) is the first-order RV
acceleration term.
Calculate the line-of-sight acceleration given the apparent variation of an orbital period.
This method returns the slope of the linear radial velocity trend (acceleration) that
corresponds to a given time derivative of the observed orbital period, assuming that the
latter is a due to the Doppler effect. It uses equation (6) from Bouma et al. (2020) [1]_,
which is derived in convenient units.
Parameters:
P (float) – The orbital period in days.
dPdt (float) – The apparent time derivative of the orbital period in milliseconds per year (ms/yr).
Returns:
float – The first-order radial acceleration term in m/s/day.
Notes
For a transiting exoplanet, if a variation in the observed period between transits is measured,
it may be due to the Doppler effect induced by a line-of-sight acceleration. Assuming this
trend is a real effect, Equation (6) from Bouma et al. (2020) [1]_ can be used to determine
the corresponding slope of the linear radial velocity trend from the period derivative:
where \(P\) is the orbital period of the transiting planet, \(\dot{P}_{\mathrm{
RV}}\) is the time derivative of the period, and \(\dot{\gamma}\) is the first-order RV
acceleration term.
Constrain properties of the orbit of an outer companion given a quadratic RV trend.
Given the first and second-order acceleration terms that parameterize a long-term, quadratic
radial velocity trend, \(\dot{\gamma}\) and \(\ddot{\gamma}\), this method
follows the derivations of Kipping et al. (2011) [1]_ (equations 1, 3, and 4) to constrain
properties of a possible outer companion.
This method requires an estimate of minimum possible orbital period of the companion,
which is constrained by the timespan of the radial velocity measurements. This is determined
by the rv_trend_quadratic() method from the
Analyzer class.
Parameters:
P_min (float) – The minimum orbital period of the companion in days.
t_pivot (float) – The “pivot” point, defined as the reference mid-time of the transiting planet.
dvdt (float) – First-order acceleration term in m/s/day.
ddvdt (float) – Second-order acceleration term in m/s/day^2.
M_s (float) – The mass of the host star in solar masses.
Returns:
tuple – A tuple with the following elements: 1) the minimum companion period in days,
2) the corresponding lower limit on the RV semi-amplitude, 3) the companion mass in
Earth masses, and 4) the time at which the companion RV signal is at a minimum.
Calculate the mass of a nonresonant companion given a precession rate and orbital period.
Given the orbital period of a nonresonant companion planet in the system, this method returns
the necessary mass for it to be responsible for a measured apsidal precession rate of the
studied orbit. It uses equation (8) from Heyl and Gladman (2007) [1]_, and is appropriate for
a companion planet that is either interior or exterior to the observed (i.e., transiting)
planet. However, it assumes that the companion mass is much less than that of the host star.
Parameters:
P (float) – The orbital period of the transiting planet in days.
P2 (float) – The orbital period of the outer planet in days.
dwdE (float) – The rate of apsidal precession in radians per epoch.
M_s (float) – The mass of the host star in solar masses.
Returns:
float – The mass of the outer companion in earth masses.
Notes
This method applies to the scenario in which a nonresonant companion in the system is driving
apsidal precession of a transiting planet. It assumes that the companion object is on a
circular, coplanar, and nonresonant orbit, and that its mass is far less than the host star.
In the formulation of Heyl and Gladman (2007) [1]_, the mass of the companion planet can be
determined from the measured precession rate by:
where \(\dot{\omega}\) is the observed precession rate, \(\alpha = a/a_2\) is
the semi major axis ratio, and \(\mathcal{K}\) and \(\mathcal{E}\) are the complete
elliptic integrals of the first and second kind, respectively.
Important
The scipy implementation of the complete elliptic integrals \(\mathcal{K}\) and
\(\mathcal{E}\) expect an integrand of the form \((1 - m \sin^2 t)^{-1/2}\).
However, the derivation of the equation above expects an integrand of the form \((1
- m^2 \sin^2 t)^{-1/2}\)[1]_, which can be shown by expanding \(\mathcal{K}\) and
\(\mathcal{E}\). To maintain consistency, the input for the scipy.special.ellipk
and scipy.special.ellipe methods must but squared, ie. such that \(\mathcal{K}(
4 \alpha/( \alpha+1)^2)\) and \(\mathcal{E}(4 \alpha/( \alpha+1)^2)\).
Calculate the minimum mass of an outer companion given the slope of a linear RV trend.
Given a measured linear trend in radial velocity data (acceleration), this method calculates
the minimum mass of an unseen outer companion planet that could cause such an acceleration.
While this approach was originally described in equation (1) of Feng et al. (2015) [1]_,
this method implements a version given by equation (8) in Bouma et al. (2020) [2]_,
which is derived in more convenient units.
Parameters:
tau (float) – The time span of the observations in years.
dvdt (float) – The first-order acceleration term in in m/s/day.
M_s (float) – The mass of the host star in solar masses.
Returns:
float – The companion planet mass in Earth masses.
Notes
Given a measured acceleration in radial velocity measurements and the time span over which
there are RV data available, this method calculates the minimum mass of an outer companion
that could induce such an acceleration, using equation (8) from Bouma et al. (2020) [2]_:
where \(\tau\) is the time span of the observations in years, \(\dot{\gamma}\) is
the first-order acceleration term, and \(M_\star\) is the mass of the host star.
The above equation assumes that the companion’s orbit has an eccentricity of \(e=0.5\),
an argument of pericenter that is exactly \(90\) degrees, and a period that is
\(1.25\times\) the time span of the observations. In this scenario, the observed linear
trend manifests as a segment of the sawtooth-like RV curve of the companion planet (see
Figure 1 of [1]_), for which the semi-amplitude can be approximated as half of the baseline
multiplied by the acceleration, i.e. \(K_c = 0.5 \, \tau \, \dot{\gamma}\).
Calculates the rate of apsidal precession driven by a nonresonant planetary companion.
This method returns the expected rate of apsidal precession due to a nonresonant companion
planet, calculated using equation (8) from Heyl and Gladman (2007) [1]_.
It is valid for a companion planet that is either interior or exterior to the observed (i.e.
transiting) planet, but it assumes that the companion mass is much less than that of the host
star.
Parameters:
P (float) – The orbital period of the transiting planet in days.
M2 (float) – The mass of the outer planet in Earth masses.
P2 (float) – The orbital period of the outer planet in days.
M_s (float) – The mass of the host star in solar masses.
Returns:
float – The precession rate in radians per epoch.
Notes
This method applies to the scenario in which a nonresonant companion in the system is driving
apsidal precession of a transiting planet. It assumes that the companion object is on a
circular, coplanar, and nonresonant orbit, and that its mass is far less than the host star.
In the formulation of Heyl and Gladman (2007) [1]_, the induced precession rate in radians
per orbit:
where \(m_2\) is the mass of the perturbing planet, \(\alpha = a/a_2\) is the
semi major axis ratio, and \(\mathcal{K}\) and \(\mathcal{E}\) are the complete
elliptic integrals of the first and second kind, respectively.
Important
The scipy implementation of the complete elliptic integrals \(\mathcal{K}\) and
\(\mathcal{E}\) expect an integrand of the form \((1 - m \sin^2 t)^{-1/2}\).
However, the derivation of the equation above expects an integrand of the form \((1
- m^2 \sin^2 t)^{-1/2}\)[1]_, which can be shown by expanding \(\mathcal{K}\) and
\(\mathcal{E}\). To maintain consistency, the input for the scipy.special.ellipk
and scipy.special.ellipe methods must but squared, ie. such that \(\mathcal{K}(
4 \alpha/( \alpha+1)^2)\) and \(\mathcal{E}(4 \alpha/( \alpha+1)^2)\).
Calculate the slope of a linear radial velocity trend given an estimate of a companion mass.
This method computes the expected slope of a linear radial velocity trend (acceleration)
induced by an unseen outer companion planet with an orbital period that is far longer than
the observational baseline. It requires an estimate of the companion mass.
While this approach was originally described in equation (1) of Feng et al. (2015) [1]_,
this method implements a version given by equation (8) in Bouma et al. (2020) [ 2]_,
which is derived in more convenient units.
Parameters:
tau (float) – The time span of the observations in years.
M_c (float) – The companion planet mass in earth masses.
M_s (float) – The mass of the host star in solar masses.
Returns:
float – The first-order acceleration term in in m/s/day.
Notes
Given a companion planet’s mass, the time span over which radial velocity measurements have
been taken, and the mass of the host star, this method calculates the slope of the expected
linear trend in the radial velocity data using equation (8) from Bouma et al. (2020) [2]_:
where \(\tau\) is the time span of the observations in years, \(M_c\) is the mass of
the companion planet, and \(M_\star\) is the mass of the host star.
The above equation assumes that the companion’s orbit has an eccentricity of \(e=0.5\),
an argument of pericenter that is exactly \(90\) degrees, and a period that is
\(1.25\times\) the time span of the observations. In this scenario, the observed linear
trend manifests as a segment of the sawtooth-like RV curve of the companion planet (see
Figure 1 of [1]_), for which the semi-amplitude can be approximated as half of the baseline
multiplied by the acceleration, i.e. \(K_c = 0.5 \, \tau \, \dot{\gamma}\).
Calculate the rate of angular momentum loss due to tidal forces causing orbital decay.
This function uses Equation (10) from Yee et al. (2020) [1]_ to compute the rate at which
the angular momentum of a planetary orbit decreases as it decays due to tidal forces.
Parameters:
P (float) – Orbital period in days.
dPdE (float) – Orbital decay rate in days per epoch.
M_s (float) – Host star mass in solar masses.
M_p (float) – Planet mass in earth masses.
Returns:
float – The rate of orbital angular momentum loss in kg m^2 / s^2.
Notes
As a planet’s orbit decays, the orbital energy and angular momentum will decrease over time.
Equation (10) of Yee et al. (2020) [1]_ defines the rate of orbital angular momentum loss as:
where \(G\) is the gravitational constant, \(M_{\star}\) is the host star mass,
\(M_{\mathrm{p}}\) is the planet mass, \(P\) is the orbital period,
and \(\frac{dP}{dt}\) is the orbital decay rate.
Calculate the modified stellar tidal quality factor from an empirical law.
This method calculates the tidal forcing period of a star-planet system and uses it to
estimate the star’s modified tidal quality factor with an empirical law derived by Penev et
al. (2018) [1]_.
Parameters:
P_orb (float) – Orbital period in days.
P_rot_s (float) – Period of the host star’s rotation in days.
Returns:
tuple – The star’s modified tidal quality factor and the tidal forcing period of the system in days.
Notes
The “modified” tidal quality factor is a typical parameterization of the efficiency of tidal
energy dissipation within a body. It is defined as:
where \(Q_\star\) is the tidal quality factor and \(k_{2,\star}\) is the second-order
potential Love number. The theoretical upper limit is \(k_{2,\star}=3/2\), that of a
uniform density sphere, in which case \(Q_\star^{'} = Q_\star\).
This method estimates a value for \(Q_\star^{'}\) using an empirical law derived by
Penev et al. (2018) [1]_:
Calculate the rate of orbit energy loss due to tidal forces causing orbital decay.
This function uses Equation (9) from Yee et al. (2020) [1]_ to compute the rate at which the
energy of a planetary orbit decreases as it decays due to tidal forces.
Parameters:
P (float) – Orbital period in days.
dPdE (float) – Orbital decay rate in days per epoch.
M_s (float) – Mass of the host star in solar masses.
M_p (float) – Mass of the planet in earth masses.
Returns:
float – The rate of orbital energy loss in watts.
Notes
As a planet’s orbit decays, the orbital energy and angular momentum will decrease over time.
Equation (9) of Yee et al. (2020) [1]_ defines the rate of orbital energy loss as:
where \(G\) is the gravitational constant, \(M_{\star}\) is the host star mass,
\(M_{\mathrm{p}}\) is the planet mass, \(P\) is the orbital period,
and \(\frac{dP}{dt}\) is the orbital decay rate.
References
orbdot.models.theory.decay_get_equilibrium_spin_freq(P, e, epsilon_p)[source]
Calculate the equilibrium spin frequency of a planet.
This method returns the equilibrium spin frequency of a planet with nonzero obliquity and/or
orbit eccentricity.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
epsilon_p (float) – The planetary obliquity.
Returns:
float – Equilibrium spin frequency in days^{-1}.
Notes
Planetary rotation periods are typically unconstrained, and it is not always appropriate to
assume that they are tidally locked (synchronous rotation). When the orbit eccentricity
and/or planetary obliquity are nonzero, the rotation state of the planet may be asynchronous.
In this case, a reasonable assumption is that the planet’s spin has tidally evolved toward an
equilibrium rate, given by Equation (12) of [1]_:
\[\dot{\theta}_{eq} \equiv n \frac{g(e)}{h(e)}\frac{2\cos{\varepsilon_p}}{(1 +
\cos^2{\varepsilon_p})}\]
where \(\varepsilon_p\) is the planetary obliquity (defined as the angle between the
planet’s spin and orbital angular momentum vectors), \(n\) is the orbital mean motion,
and \(g(e)\) and \(h(e)\) are eccentricity-dependent functions that are defined in
decay_get_g_e() and decay_get_h_e().
orbdot.models.theory.decay_planet_pdot_from_quality_factor(P, e, M_s, M_p, R_p, Q_planet, epsilon_p=0.0, P_rot_p=None)[source]
Calculate the rate of orbital decay driven by equilibrium tides in the planet.
This method computes the orbital decay rate for a given “modified” planetary tidal quality
factor and, optionally, the planet’s rotation period and obliquity. This expression accounts
for both eccentricity-driven and obliquity-driven tidal dissipation, providing a unified
treatment of planetary tides.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – Host star mass in solar masses.
M_p (float) – Planet mass in earth masses.
R_p (float) – Planet radius in earth radii.
Q_planet (float) – The planet’s modified annual tidal quality factor.
epsilon_p (float, optional) – Planetary obliquity in degrees. Default is zero.
P_rot_p (float, optional) – Planet rotation period in days.
Returns:
float – Orbital decay rate in days per epoch.
Notes
If equilibrium tides are the dominant driver of orbital evolution, the rate of orbital
period decay due to planetary tides is given by:
where \(Q_p^{'}\) is the modified annual tidal quality factor of the planet,
\(\varepsilon_p\) is the planetary obliquity (defined as the angle between the
planet’s spin and orbital angular momentum vectors), \(\dot{\theta}_p\) is the
planet’s spin frequency, \(n\) is the orbital mean motion, \(a\) is the semi major axis,
\(M_p\) is the planet mass, \(M_\star\) is the stellar mass, and \(R_p\) is
the planet’s radius. The eccentricity-dependent functions \(f(e)\) and \(g(e)\) are
defined in the decay_get_f_e() and
decay_get_g_e() methods.
This equation is derived using Equations (2), (5), and (19) from [1]_ and is valid for any
value of \(\dot{\theta}_p\), \(\varepsilon_p\), and \(e\).
If a rotation period is not provided, the planet’s spin frequency is calculated using the
tidally-evolved equilibrium rate defined in
decay_get_equilibrium_spin_freq(), which is dependent on the
eccentricity and planetary obliquity. In this case, the above equation can be expressed as:
We see that if the orbit is circular and aligned, meaning \(e=0\) and
\(\varepsilon_p=0\), the planetary contribution to orbital decay vanishes. In this case,
the functions \(f(e)\), \(g(e)\), and \(h(e)\) approach unity, and the
equilibrium spin rate synchronizes with the mean motion, \(\dot{\theta}_p=n\),
leading to no net tidal energy dissipation in the planet.
orbdot.models.theory.decay_planet_quality_factor_from_pdot(P, e, M_s, M_p, R_p, dPdE, epsilon_p=0.0, P_rot_p=None)[source]
Calculate the planet’s modified planetary quality factor given an orbital decay rate.
Given an orbital decay rate and, optionally, the planet’s rotation period and obliquity,
this method returns the planet’s modified tidal quality factor under the assumption
that the decay is driven by equilibrium tides in the planet. See the
decay_planet_pdot_from_quality_factor() docstring for a more
detailed description of the relevant equations.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – Host star mass in solar masses.
M_p (float) – Planet mass in earth masses.
R_p (float) – Planet radius in earth radii.
dPdE (float) – Orbital decay rate in days per epoch.
epsilon_p (float, optional) – Planetary obliquity in degrees. Default is zero.
P_rot_p (float, optional) – Planet rotation period in days.
Returns:
float – The planet’s modified annual tidal quality factor.
Notes
If a rotation period not provided for the planet, the planet’s spin frequency is calculated
with the decay_get_equilibrium_spin_freq() method.
orbdot.models.theory.decay_star_pdot_from_quality_factor(P, e, M_s, M_p, R_s, Q_star, epsilon_s=0.0, P_rot_s=None)[source]
Calculate the rate of orbital decay driven by equilibrium tides in the host star.
This method computes the orbital decay rate for a given “modified” stellar tidal quality
factor and, optionally, the host star’s rotation period and/or obliquity.
where \(Q_\star^{'}\) is the modified annual tidal quality factor of the star,
\(\varepsilon_\star\) is the stellar obliquity (defined as the angle between the spin
and orbital angular momentum vectors), \(\dot{\theta}_\star\) is the stellar spin
frequency, \(n\) is the orbital mean motion, \(a\) is the semi major axis, \(M_p\) is
the planet mass, \(M_\star\) is the stellar mass, and \(R_\star\) is the stellar
radius. The eccentricity-dependent functions \(f(e)\) and \(g(e)\) are defined in the
decay_get_f_e() and decay_get_g_e()
methods.
This equation is derived using Equations (2), (5), and (19) from [1]_ and is valid for any
value of \(\dot{\theta}_\star\), \(\varepsilon_\star\), and \(e\). We see
that if \(e=0\) and \(\varepsilon_\star=0\), the expression simplifies to:
If the rotation rate of the star is unknown, it is assumed that \(\dot{\theta}_\star
\ll n\), in which case the bracketed term approaches unity, leaving:
orbdot.models.theory.decay_star_quality_factor_from_pdot(P, e, M_s, M_p, R_s, dPdE, epsilon_s=0.0, P_rot_s=None)[source]
Calculate the host star’s modified stellar quality factor given an orbital decay rate.
Given an orbital decay rate and, optionally, the host star’s rotation period and obliquity,
this method returns the host star’s modified tidal quality factor under the assumption
that the decay is driven by equilibrium tides in the host star. See the
decay_star_pdot_from_quality_factor() docstring for a more
detailed description of the relevant equations.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – Host star mass in solar masses.
M_p (float) – Planet mass in earth masses.
R_s (float) – Host star radius in solar radii.
dPdE (float) – Orbital decay rate in days per epoch.
epsilon_s (float, optional) – Host star obliquity in degrees. Default is zero.
P_rot_s (float, optional) – Host star rotation period in days.
Returns:
float – The host star’s modified annual tidal quality factor.
Calculate the remaining lifetime of a planet on a decaying orbit.
Parameters:
P (float) – Orbital period in days.
dPdE (float) – Orbital decay rate in days per epoch.
Returns:
float – The remaining lifetime in millions of years (Myr).
Notes
For a planet on a decaying orbit, its remaining lifetime can be estimated as simply:
\[\tau = \frac{P_0}{|\dot{P}_{\mathrm{decay}}|}\]
where \(\dot{P}_{\mathrm{decay}}\) is the orbital decay rate, and \(P_0\) is the
observed orbital period.
orbdot.models.theory.get_pdot_from_wdot(P, e, w, dwdE)[source]
Calculate the apparent time derivative of the orbital period due to apsidal precession.
This method determines the apparent time derivative of the orbital period due to apsidal
precession in general, independent of the physical mechanism. It uses Equation (17) from
Rafikov (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
w (float) – The argument of pericenter in radians.
dwdE (float) – The precession rate in radians per epoch.
Returns:
float – The time derivative of the orbital period in milliseconds per year (ms/yr).
Notes
For transiting exoplanets, apsidal precession causes the sidereal period, i.e. the length of
time between transits, to vary over time. Because apsidal precession periods are typically
far greater than observational baselines, this effect yields an apparent time derivative
\(\dot{P}\).
Equation (17) of Rafikov (2009) [1]_ expresses this as:
where \(e\) is the orbit eccentricity, \(\omega_p\) is the argument of pericenter,
\(\dot{\omega}\) is the apsidal precession rate, and \(n = 2\pi/P\) is the
orbit mean motion.
Calculate the semi major axis in meters given the orbital period and host star mass.
Parameters:
P (float) – The orbital period in days.
M_s (float) – The mass of the host star in solar masses.
Returns:
float – The semi major axis of the orbit in meters.
orbdot.models.theory.get_tdot_from_wdot(P, e, w, i, T, dwdE, M_s, R_s)[source]
Calculate the expected transit duration variation (TDV) due to apsidal precession.
This method determines the expected TDV signal for apsidal precession in general, independent
of the physical mechanism. It uses Equation (9) from Rafikov (2009) [1]_, assuming there is
no change in the line-of-sight inclination over time.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
w (float) – The argument of pericenter in radians.
i (float) – The line-of-sight inclination in degrees.
T (float) – The transit duration in minutes.
dwdE (float) – The precession rate in radians per epoch.
M_s (float) – The host star mass in solar masses.
R_s (float) – The host star radius in solar radii.
Returns:
float – The time derivative of the transit duration in milliseconds per year (ms/yr).
Notes
For transiting exoplanets, apsidal precession causes the duration of the transits \(T\)
to vary over time. Assuming that the line-of-sight inclination \(i\) of the orbit is
constant, the expected transit duration variation (TDV) is given by [1]_:
and where \(e\) is the orbit eccentricity, \(\omega_p\) is the argument of pericenter,
\(\dot{\omega}\) is the apsidal precession rate, \(b\) is the impact parameter,
\(a\) is the semi major axis, and \(R_\star\) is the radius of the host star.
References
orbdot.models.theory.precession_gr(P, e, M_s)[source]
Calculate the rate of apsidal precession predicted by general relativity.
This method returns the expected apsidal precession rate of the planet’s orbit due to general
relativistic (GR) effects, using Equation (12) from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
Returns:
float – The precession rate in radians per epoch.
Notes
This method applies the lowest order of the relativistic contribution to apsidal precession,
given in Equation (12) of Ragozzine and Wolf (2009) [1]_ as:
\[\dot{\omega}_{\mathrm{GR}} = \frac{3 G M_{\star} n}{a c^2(1 - e^2)}\]
where \(G\) is the gravitational constant, \(c\) is the speed of light in a vacuum,
\(M_{\star}\) is the host star mass, \(a\) is the planet’s semi major axis,
\(e\) is the eccentricity, and \(n = 2\pi/P\) is the mean motion.
References
orbdot.models.theory.precession_rotational_planet(P, e, M_s, M_p, R_p, k2_p, P_rot_p)[source]
Calculates the rate of apsidal precession driven by planetary rotation.
This method returns the expected apsidal precession rate of a planet’s orbit due to its
rotational bulge, calculated using Equations (10) and (11) from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
M_p (float) – The planet mass in earth masses.
R_p (float) – The planet radius in earth radii.
k2_p (float) – The planet’s Love number.
P_rot_p (float) – The period of the planet’s rotation in days.
Returns:
float – The precession rate in radians per epoch.
Notes
The rotation of a fluid body raises an oblate distortion (i.e., flattening) that perturbs the
gravitational potential, driving apsidal precession. The rate of the apsidal precession
induced by a planet’s rotational bulge is given in Equation (10) of Ragozzine and Wolf (2009)
[1]_ as:
\[\dot{\omega}_{\mathrm{rot,p}} = \frac{n {R_p}^5 k_{2,p} {\dot{\theta}_p}^2}{2
a^2 G M_p} g_2(e)\]
where \(\dot{\theta}_p\) is the rotational velocity of the planet, \(k_{2,p}\) is its
second-order potential Love number, \(G\) is the gravitational constant, \(n =
2\pi/P\) is the orbit mean motion, \(a\) is the semi major axis, and \(M_p\) and
\(R_p\) are the planet mass and radius, respectively.
The function \(g_2(e)\) represents an expansion in eccentricity \(e\), defined in
Equation (11) of Ragozzine and Wolf (2009) [1]_ as:
\[g_2(e) = (1-e^2)^{-2}\]
References
orbdot.models.theory.precession_rotational_planet_k2(P, e, M_s, M_p, R_p, P_rot_p, dwdE)[source]
Calculate the Love number given a rate of apsidal precession driven by planetary rotation.
Given an apsidal precession rate for a planetary orbit, this method returns the second-order
potential Love number of the planet \(k_{2,p}\) under the assumption that the precession
is driven entirely by the rotational bulge of the planet. See the
precession_rotational_planet() docstring for a more detailed
description of the relevant equations, which are adopted from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
M_p (float) – The planet mass in earth masses.
R_p (float) – The planet radius in earth radii.
P_rot_p (float) – The period of the planet’s rotation in days.
dwdE (float) – The precession rate in radians per epoch.
Returns:
float – The planet’s potential Love number of the second order.
References
orbdot.models.theory.precession_rotational_star(P, e, M_s, R_s, k2_s, P_rot_s)[source]
Calculate the rate of apsidal precession driven by stellar rotation.
This method returns the expected apsidal precession rate of a planet’s orbit due to the
rotational bulge of the host star, calculated using Equations (10) and (11) from Ragozzine
and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
R_s (float) – The host star radius in solar radii.
k2_s (float) – The host star’s Love number.
P_rot_s (float) – The period of the host star’s rotation in days.
Returns:
float – The precession rate in radians per epoch.
Notes
The rotation of a fluid body raises an oblate distortion (i.e., flattening) that perturbs the
gravitational potential, driving apsidal precession. The rate of the apsidal precession
induced by a star’s rotational bulge is given in Equation (10) of Ragozzine and Wolf (2009)
[1]_ as:
where \(\dot{\theta}_\star\) is the rotational velocity of the star, \(k_{2,
\star}\) is its second-order potential Love number, \(G\) is the gravitational constant,
\(a\) is the semi major axis of the orbit, \(n = 2\pi/P\) is the mean motion,
and \(M_\star\) and \(R_\star\) are the stellar mass and radius, respectively.
The parameter \(g_2(e)\) represents an expansion in eccentricity \(e\), defined in
Equation (11) of Ragozzine and Wolf (2009) [1]_ as:
\[g_2(e) = (1-e^2)^{-2}\]
References
orbdot.models.theory.precession_rotational_star_k2(P, e, M_s, R_s, P_rot_s, dwdE)[source]
Calculate the Love number given a rate of apsidal precession driven by stellar rotation.
Given an apsidal precession rate for a planetary orbit, this method returns the second-order
potential Love number of the host star \(k_{2,\star}\) under the assumption that the
precession is driven entirely by the rotational bulge of the host star. See the
precession_rotational_star() docstring for a more detailed
description of the relevant equations, which are adopted from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
R_s (float) – The host star radius in solar radii.
P_rot_s (float) – The period of the host star’s rotation in days.
dwdE (float) – The precession rate in radians per epoch.
Returns:
float – The host star’s potential Love number of the second order.
References
orbdot.models.theory.precession_tidal_planet(P, e, M_s, M_p, R_p, k2_p)[source]
Calculate the rate of apsidal precession driven by the planet’s tidal bulge.
This method returns the expected apsidal precession rate of the planet’s orbit due to its tidal
bulge, calculated using Equations (6) and (7) from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
M_p (float) – The planet mass in earth masses.
R_p (float) – The planet radius in earth radii.
k2_p (float) – The planet’s Love number.
Returns:
float – The precession rate in radians per epoch.
Notes
The host star of a massive, close-in planet may raise a significant “tidal bulge” on the
planet, an ellipsoidal distortion caused by the varying gravitational force experienced across
the extent of the body, driving apsidal precession. The rate of apsidal precession that is
induced by the planet’s tidal bulge is given in Equation (6) of Ragozzine and Wolf (2009) [1]_
as:
\[\dot{\omega}_{\mathrm{tide,p}} = \frac{15}{2}k_{2,p} n \left(\frac{R_p}{
a}\right)^5\left(\frac{M_\star}{M_p}\right)f_2(e)\]
where \(k_{2,p}\) is the planet’s second-order potential Love number, \(n =
2\pi/P\) is the orbit mean motion, \(a\) is the semi major axis, \(M_\star\) is
the host star mass, and \(M_p\) and \(R_p\) are the planet mass and radius.
The parameter \(f_2(e)\) represents an expansion in eccentricity \(e\), defined in
Equation (7) of Ragozzine and Wolf (2009) [1]_ as:
orbdot.models.theory.precession_tidal_planet_k2(P, e, M_s, M_p, R_p, dwdE)[source]
Calculate a planet’s Love number given a rate of apsidal precession driven by tides.
Given an apsidal precession rate for a planetary orbit, this method returns the second-order
potential Love number of the planet \(k_{2,p}\) under the assumption that the precession
is driven entirely by the tidal bulge of the planet. See the
precession_tidal_planet() docstring for a more detailed
description of the relevant equations, which are adopted from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
M_p (float) – The planet mass in earth masses.
R_p (float) – The planet radius in earth radii.
dwdE (float) – The precession rate in radians per epoch.
Returns:
float – The planet’s potential Love number of the second order.
References
orbdot.models.theory.precession_tidal_star(P, e, M_s, M_p, R_s, k2_s)[source]
Calculate the rate of apsidal precession driven by the star’s tidal bulge.
This method returns the expected apsidal precession rate of the planet’s orbit due to the
star’s tidal bulge, calculated using Equations (6) and (7) from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
M_p (float) – The planet mass in earth masses.
R_s (float) – The host star radius in solar radii.
k2_s (float) – The host star’s Love number.
Returns:
float – The precession rate in radians per epoch.
Notes
A massive, close-in planet may raise a significant “tidal bulge” on the host star,
an ellipsoidal distortion caused by the varying gravitational force experienced across the
extent of the body, driving apsidal precession. The rate of apsidal precession that is
induced by the star’s tidal bulge is given in Equation (6) of Ragozzine and Wolf (2009) [1]_
as:
\[\dot{\omega}_{\mathrm{tide,\star}} = \frac{15}{2}k_{2,\star} n \left(\frac{
R_\star}{a}\right)^5\left(\frac{M_p}{M_\star}\right)f_2(e)\]
where \(k_{2,\star}\) is the star’s second-order potential Love number, \(n =
2\pi/P\) is the orbit mean motion, \(a\) is the semi major axis, \(M_p\) is the
planet mass, and \(M_\star\) and \(R_\star\) are the stellar mass and radius.
The parameter \(f_2(e)\) represents an expansion in eccentricity \(e\), defined in
Equation (7) of Ragozzine and Wolf (2009) [1]_ as:
orbdot.models.theory.precession_tidal_star_k2(P, e, M_s, M_p, R_s, dwdE)[source]
Calculate a host star’s Love number given a rate of apsidal precession driven by tides.
Given an apsidal precession rate for a planetary orbit, this method returns the second-order
potential Love number of the host star \(k_{2,\star}\) under the assumption that the
precession is driven entirely by the tidal bulge of the star. See the
precession_tidal_star() docstring for a more detailed description
of the relevant equations, which are adopted from Ragozzine and Wolf (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
M_s (float) – The host star mass in solar masses.
M_p (float) – The planet mass in earth masses.
R_s (float) – The host star radius in solar radii.
dwdE (float) – The precession rate in radians per epoch.
Returns:
float – The host star’s potential Love number of the second order.
Calculate the apparent rate of change of the inclination due to systemic proper motion.
This method returns the rate of the variation of the line-of-sight inclination of an orbit
due to systemic proper motion, using Equation (3) from Rafikov (2009) [1]_.
Parameters:
mu (float) – The proper motion of the system in mas/yr (milliarcseconds per year).
beta (float) – The angle in radians between the proper motion vector and the angular momentum vector
projected onto the sky-plane.
Returns:
float – The apparent time derivative of the line-of-sight inclination in radians per year.
Notes
The proper motion of a star-planet system alters its appearance on the sky-plane,
which causes an evolution of the line-of-sight inclination \(\dot{i}_\mu\). Rafikov
(2009) [1]_ derives a simple expression for this effect in terms of the magnitude of the
proper motion vector, \(\mu = |\vec{\mu}|\):
\[\dot{i}_\mu = -\mu\cos{\beta}\]
where \(\beta\) is defined as the angle in the sky-plane between the proper motion
vector \(\vec{\mu}\) and the projection of the orbital angular momentum vector
\(\vec{L}\). Thus, the magnitude of the inclination variation \(|\dot{i}_\mu|\) is
maximized when \(\beta = 0^\circ, 180^\circ\).
References
orbdot.models.theory.proper_motion_pdot(P, e, w, mu)[source]
Calculate the apparent time derivative of the orbital period due to systemic proper motion.
This method returns the apparent time derivative of the orbital period that is expected as a
result of the systemic proper motion-induced (apparent) apsidal precession. It uses Equation
(15) from Rafikov (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
w (float) – The argument of pericenter in radians.
mu (float) – The proper motion of the system in milliarcseconds per year (mas/yr).
Returns:
float – The apparent time derivative of the orbital period in milliseconds per year (ms/yr).
Notes
The systemic proper motion of a transiting star-planet system can have a significant
influence on the observed period between transits due to the apparent apsidal precession
\(\dot{\omega}_{\mu}\). This manifests as a constant change in the observed period,
which Rafikov (2009) [1]_ expresses as:
where \(e\) is the orbit eccentricity, \(\omega_p\) is the argument of pericenter,
\(n\) is the orbit mean motion, \(\dot{\omega}_{\mu}\) is the apparent
precession rate, and \(\ddot{\omega}_{\mu}\) is the time derivative of the latter.
Rafikov [1]_ posits that for transiting systems the following approximation is valid:
Calculate the apparent time derivative of observed period due to the Shklovskii effect.
This method returns the apparent rate of change of the period between transits due to the
Shklovskii effect, using Equation (21) from Rafikov (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
mu (float) – The proper motion of the system in mas/yr (milliarcseconds per year).
D (float) – The distance to the system in parsecs.
Returns:
float – The apparent time derivative of the orbital period in milliseconds per year (ms/yr).
Notes
As a star-planet system moves through space, the radial component of its velocity, \(v_r\),
varies in time as a result of the nonzero transverse velocity component:
\[v_t = \mu D\]
where \(D\) is the distance to the system in parsecs and \(\mu = |\vec{\mu}|\) is
the magnitude of the proper motion vector.
Consequently, the radial velocity component is time-dependent, which leads to a secular
variation in the observed period between transits, denoted \(\dot{P}_{ \mathrm{Shk}}\).
This is known as the Shklovskii Effect [1]_, expressed in the following convenient form
by Rafikov (2009) [2]_:
orbdot.models.theory.proper_motion_tdot(P, e, w, i, T, wdot_pm, idot_pm, M_s, R_s)[source]
Calculate the time derivative of the transit duration due to systemic proper motion.
This method returns the time derivative of the transit duration due to systemic proper motion
using Equation (9) from Rafikov (2009) [1]_.
Parameters:
P (float) – The orbital period in days.
e (float) – The eccentricity of the orbit.
w (float) – The argument of pericenter in radians.
i (float) – The line-of-sight inclination of the orbit in degrees.
T (float) – The transit duration in minutes.
wdot_pm (float) – The apparent apsidal precession rate in radians per year.
idot_pm (float) – The apparent time derivative of the line-of-sight inclination in radians per year.
M_s (float) – The host star mass in solar masses.
R_s (float) – The host star radius in solar radii.
Returns:
float – A constant time derivative of the transit duration in milliseconds per year.
Notes
The systemic proper motion of a transiting star-planet system can have a significant
influence on the observed transit duration, \(T\), due to the proper motion-induced
variation of the line-of-sight inclination \(\dot{i}_\mu\) and the apparent apsidal
precession \(\dot{\omega}_{\mu}\). The transit duration variation (TDV) is governed by
the following expression [1]_:
and where \(e\) is the orbit eccentricity, \(\omega_p\) is the argument of pericenter,
\(b\) is the impact parameter, \(a\) is the semi major axis, and \(R_\star\) is
the host star radius.
References
orbdot.models.theory.proper_motion_wdot(mu, i, beta)[source]
Calculate the rate of the apparent apsidal precession due to systemic proper motion.
This method returns the rate of the apparent apsidal precession induced by systemic proper
motion, using Equation (4) from Rafikov (2009) [1]_.
Parameters:
mu (float) – The proper motion of the system in mas/yr (milliarcseconds per year).
i (float) – The line-of-sight inclination of the orbit in degrees.
beta (float) – The angle in radians between the proper motion vector and the angular momentum vector
projected onto the sky-plane.
Returns:
float – The apparent apsidal precession rate in radians per year.
Notes
The proper motion of a star-planet system alters its appearance on the sky-plane,
which causes an apparent precession of the argument of pericenter \(\dot{
\omega}_\mu\). Rafikov (2009) [1]_ derives a simple expression for this effect in terms of
the magnitude of the proper motion vector, \(\mu = |\vec{\mu}|\):
where \(\beta\) is defined as the angle in the sky-plane between the proper motion
vector \(\vec{\mu}\) and the projection of the orbital angular momentum vector
\(\vec{L}\). The magnitude of the apparent precession rate \(|\dot{\omega}_\mu|\)
is maximized when \(\beta = 90^\circ, 270^\circ\).
Calculate the minimum mass of a resolved secondary star given a measured radial acceleration.
This method applies to the case where an acceleration has been observed in radial velocity
observations of a star, and there is a known secondary object for which an angular separation
has been measured.
It uses Equation (6) from Torres (1999) [1]_ to estimate a lower limit for the mass of the
secondary object, under the assumption that the radial velocity trend is due entirely to its
gravitational influence. In the derivation of this equation, the author makes no assumptions
about the mass or brightness of the secondary [1]_.
Parameters:
theta (float) – The angular separation of the binary in arcseconds.
D (float) – The distance to the system in parsecs.
dvdt (float) – The first-order RV acceleration term in m/s/day.
Returns:
float – The mass of the secondary star in solar masses.
Notes
Given the angular separation of a known companion object, the distance to the system, and a
measured acceleration in radial velocity observations, this method uses Equation (6) from
Torres (1999) [1]_ to estimate the minimum mass of the companion:
where \(\rho\) is the angular separation of the binary in arcseconds, \(D\) is the
distance to the system in parsecs, \(\dot{\gamma}\) is the first-order radial
acceleration term in m/s/day, and \(M_B\) is in units of solar masses.
The parameter \(\Phi\) is a function of the eccentricity, longitude of pericenter,
and inclination of the companion’s orbit. Assuming that these parameters are unconstrained,
this method uses the minimum value \(\Phi = \frac{3\sqrt{3}}{2}\) to determine the
minimum companion mass.
Calculate the slope of a linear RV trend given properties of a resolved stellar companion.
This method returns the minimum possible acceleration, induced by a bound stellar companion,
that may be observed in radial velocity observations of the primary. The secondary star must
have been resolved through imaging or astrometric measurements, such that the angular
separation is known. It uses Equation (6) from Torres (1999) [1]_, which makes no assumptions
about the mass or brightness of the secondary [1]_.
Parameters:
theta (float) – The angular separation of the binary in arcseconds.
D (float) – The distance to the system in parsecs.
M_B (float) – The mass of the stellar companion in solar masses.
Returns:
float – The first-order radial acceleration term in m/s/day.
Notes
Given the angular separation of a known companion, the distance to the system, and the mass
of the companion, this method uses Equation (6) from Torres et al. (1999) [1]_ to estimate
the acceleration that could be measured in radial velocity data:
where \(\rho\) is the angular separation of the binary in arcseconds, \(D\) is the
distance to the system in parsecs, and \(M_B\) is the mass of the stellar companion in
solar masses. In the derivation of this equation, the author makes no assumptions about the mass
or brightness of the secondary [1]_.
The parameter \(\Phi\) is a function of the eccentricity, longitude of pericenter,
and inclination of the companion’s orbit. Assuming that these parameters are unconstrained,
this method uses the minimum value \(\Phi = \frac{3\sqrt{3}}{2}\) to determine the
minimum companion mass.
This module defines functions for modelling exoplanet transit and eclipse mid-times.
orbdot.models.ttv_models.ttv_constant(t0, P0, e0, w0, E, primary=True)[source]
Constant-period model for transit and eclipse mid-times.
This method calculates the expected transit or eclipse mid-times for a single planet on an
unchanging orbit.
Parameters:
t0 (float) – Reference transit mid-time in \(\mathrm{BJD}_\mathrm{TDB}\).
P0 (float) – Orbital period in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit in radians.
E (array-like) – The epoch(s) at which to calculate the mid-times.
primary (bool, optional) – If True, returns the transit mid-time. If False, returns the eclipse mid-time. Default is
True.
Returns:
float or array-like – The predicted transit or eclipse times in \(\mathrm{BJD}_\mathrm{TDB}\).
Note
If the orbit is eccentric, an offset of \(\frac{2P}{\pi} e\cos{\omega}\)
is added to the eclipse mid-times.
orbdot.models.ttv_models.ttv_decay(t0, P0, PdE, e0, w0, E, primary=True)[source]
Orbital decay model for transit and eclipse mid-times.
This method calculates the expected transit or eclipse mid-times for a single planet on an
orbit with a constant change in the period. Though the main application of this model is for
orbital decay, a positive period derivative is allowed.
Parameters:
t0 (float) – Reference transit time in \(\mathrm{BJD}_\mathrm{TDB}\).
P0 (float) – Orbital period at the reference mid-time in days.
PdE (float) – Rate of change of the orbital period in days per epoch.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit in radians.
E (array-like) – The epoch(s) at which to calculate the mid-times.
primary (bool, optional) – If True, returns the transit mid-time. If False, returns the eclipse mid-time. Default is
True.
Returns:
float or array-like – The predicted transit or eclipse times in \(\mathrm{BJD}_\mathrm{TDB}\).
Note
If the orbit is eccentric, an offset of \(\frac{2P}{\pi} e\cos{\omega}\)
is added to the eclipse mid-times.
orbdot.models.ttv_models.ttv_precession(t0, P0, e0, w0, wdE, E, primary=True)[source]
Apsidal precession model for transit and eclipse mid-times.
This method calculates the expected transit or eclipse mid-times for an elliptical orbit
undergoing apsidal precession. It uses a numerical approximation for low eccentricities that
is adapted from equation (15) in Giminez and Bastero (1995) [1]_ by Patra et al. (2017) [2]_.
Parameters:
t0 (float) – Reference transit time in \(\mathrm{BJD}_\mathrm{TDB}\).
P0 (float) – The sidereal period in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit at the reference mid-time in radians.
wdE (float) – Apsidal precession rate in radians per epoch.
E (array-like) – The epoch(s) at which to calculate the mid-times.
primary (bool, optional) – If True, returns the transit mid-time. If False, returns the eclipse mid-time. Default is
True.
Returns:
float or array-like – The predicted transit or eclipse times in \(\mathrm{BJD}_\mathrm{TDB}\).
where \(K\) is the semi-amplitude of the planetary signal, \(\gamma_i\) is the
systemic radial velocity, and \(\dot{ \gamma}\) and \(\ddot{\gamma}\) are first
and second-order acceleration terms, respectively.
This method calculates the expected radial velocity signal of a star that hosts a planet
on an orbit with a constant change in the period. Though the main application of this model
is for orbital decay, a positive period derivative is allowed.
Note
This function assumes that the change in the RV semi-amplitude \(K\) is negligible.
Parameters:
t0 (float) – Reference transit mid-time in \(\mathrm{BJD}_\mathrm{TDB}\).
P0 (float) – Orbital period at the reference mid-time, in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit in radians.
K (float) – Radial velocity semi-amplitude in m/s.
v0 (float) – Systemic radial velocity in m/s.
dvdt (float) – First-order acceleration term in m/s/day.
ddvdt (float) – Second-order acceleration term in m/s/day^2.
PdE (float) – Rate of change of the orbital period in days per epoch.
t (float) – Measurement time(s) in \(\mathrm{BJD}_\mathrm{TDB}\).
Returns:
float or array-like – The expected radial velocity signal at the given time(s), including long-term trends.
Notes
Tip
In this model, the eccentricity and argument of pericenter do not evolve, which means that
\(\omega_p=\omega_0\) and \(e=e_0\).
The following steps outline the implementation of this method:
Calculate the orbital period at the given time.
For a decaying orbit, the orbital period is dependant on time. Assuming that the
rate-of-change is constant, the period at any epoch \(E\) is:
\[P\left(E\right) = P_0 + \frac{dP}{dE}\,E\]
where \(E\) is determined by truncating the result of the following equation to an
integer value:
\[E = \frac{(t - t_0)}{P_0}\]
Calculate the latest time of pericenter passage.
As the orbit shrinks, the relative time of pericenter passage will evolve, so it must be
calculated relative to the most recent transit mid-time:
\[t_{\mathrm{I}} = t_0 + PE + \frac{1}{2}\frac{dP}{dE}\,E^2\]
In the OrbDot coordinate system, we know that the true anomaly at the transit center is:
where \(K\) is the semi-amplitude of the planetary signal, \(\gamma_i\) is the
systemic radial velocity, and \(\dot{ \gamma}\) and \(\ddot{\gamma}\) are first
and second-order acceleration terms, respectively.
This method calculates the expected radial velocity signal of a star that hosts a planet
on an elliptical orbit undergoing apsidal precession.
Parameters:
t0 (float) – Reference transit mid-time in \(\mathrm{BJD}_\mathrm{TDB}\).
P0 (float) – The sidereal period in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit at the reference mid-time, in radians.
K (float) – Radial velocity semi-amplitude in m/s.
v0 (float) – Systemic radial velocity in m/s.
dvdt (float) – First-order acceleration term in m/s/day.
ddvdt (float) – Second-order acceleration term in m/s/day^2.
wdE (float) – Apsidal precession rate in radians per epoch.
t (float) – Measurement time(s) in \(\mathrm{BJD}_\mathrm{TDB}\).
Returns:
float or array-like – The expected radial velocity signal at the given time(s), including long-term trends.
Notes
Tip
In this model, the eccentricity and orbital period not evolve, which means that
\(e=e_0\) and \(P_s=P_0\), where \(P_s\) is the sidereal period.
The following steps outline the implementation of this method:
Calculate the anomalistic period and argument of pericenter.
For a precessing orbit, there is a distinction between the sidereal (observed) orbital
period \(P_s\) and the anomalistic orbital period \(P_a\). They are related by:
where \(d\omega/{dE}\) is the apsidal precession rate in radians per epoch. The
argument of pericenter of the planet’s orbit is a function of time, such that for any epoch
\(E\) it is:
and where \(K\) is the semi-amplitude of the planetary signal, \(\gamma_i\) is the
systemic radial velocity, and \(\dot{ \gamma}\) and \(\ddot{\gamma}\) are first
and second-order acceleration terms, respectively.
orbdot.models.rv_models.solve_keplers_equation(M, e, tol=1e-08)[source]
An iterative solver of Kepler’s equation.
Parameters:
M (array-like) – Mean anomalies in radians.
e (float) – Eccentricity of the orbit.
tol (float) – Tolerance for convergence (default: 1e-8).
This module defines functions for modelling exoplanet transit durations.
orbdot.models.tdv_models.tdv_constant(P0, e0, w0, i0, E, M_s, R_s)[source]
Constant-period model for transit durations.
This method returns the expected transit duration for a single planet on an unchanging
orbit using the transit_duration method defined in this module.
Parameters:
P0 (float) – Orbital period in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit in radians.
i0 (float) – Line-of-sight inclination of the orbit in degrees.
E (array-like) – The epoch(s) at which to calculate the transit duration.
M_s (float) – Host star mass in solar masses.
R_s (float) – Host star radius in solar radii.
Returns:
array-like – The predicted transit durations in minutes.
orbdot.models.tdv_models.tdv_decay(P0, e0, w0, i0, PdE, E, M_s, R_s)[source]
Orbital decay model for transit durations.
This method calculates the expected transit duration for a single planet on an orbit with a
constant change in the period, using Equation 58 from Kipping (2010) [1]_. Though the main
application of this model is for orbital decay, a positive period derivative is allowed.
Parameters:
P0 (float) – Orbital period at the reference mid-time in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit in radians.
i0 (float) – Line-of-sight inclination of the orbit in degrees.
PdE (float) – Rate of change of the orbital period in days per epoch.
E (array-like) – The epoch(s) at which to calculate the transit duration.
M_s (float) – Host star mass in solar masses.
R_s (float) – Host star radius in solar radii.
Returns:
array-like – The predicted transit durations in minutes.
References
orbdot.models.tdv_models.tdv_precession(P0, e0, w0, i0, wdE, E, M_s, R_s)[source]
Apsidal precession model for transit durations.
This method calculates the expected transit duration at the given epoch(s) for a single
planet on an elliptical orbit undergoing apsidal precession, using Equation 54 from Kipping
(2010) [1]_.
Parameters:
P0 (float) – Orbital period in days.
e0 (float) – Eccentricity of the orbit.
w0 (float) – Argument of pericenter of the planetary orbit at the reference mid-time in radians.
i0 (float) – Line-of-sight inclination of the orbit in degrees.
wdE (float) – Apsidal precession rate in radians per epoch.
E (array-like) – The epoch(s) at which to calculate the transit duration.
M_s (float) – Host star mass in solar masses.
R_s (float) – Host star radius in solar radii.
Returns:
array-like – The predicted transit durations in minutes.
The methods in this module are designed for the NestedSampling
class, or similar algorithms for which sampling from a unit hypercube is required to explore the
parameter space.
Retrieves the value of a parameter from the unit hypercube given a prior distribution.
Parameters:
hypval (float) – Value in the unit hypercube (from 0 to 1).
prior (list or tuple) –
Tuple that defines the prior distribution for the parameter. The first element specifies
the type of prior ("uniform", "gaussian", or "log"), and the subsequent elements define the
bounds of the distribution. The options are:
Derive uncertainties on "e0" and "w0" from "ecosw" and "esinw".
This method propagates the asymmetric uncertainties on "ecosw" and "esinw" to obtain
upper and lower bounds on "e0" and "w0".
Parameters:
ecosw_results (tuple) – Tuple containing the value, upper error, and lower error of "ecosw".
esinw_results (tuple) – Tuple containing the value, upper error, and lower error of "esinw".
Returns:
tuple – A tuple of tuples, the first being the value "e0" and its upper and lower
bounds, and the second being the value "w0" and its upper and lower bounds.
Derive uncertainties on "e0" and "w0" from "sq_ecosw" and "sq_esinw".
This method propagates the asymmetric uncertainties on "sq_ecosw" and "sq_esinw" to
obtain upper and lower bounds on "e0" and "w0".
Parameters:
sq_ecosw_results (tuple) – Tuple containing the value, upper error, and lower error of "sq_ecosw".
sq_esinw_results (tuple) – Tuple containing the value, upper error, and lower error of "sq_esinw".
Returns:
tuple – A tuple of tuples, the first being the value "e0" and its upper and lower
bounds, and the second being the value "w0" and its upper and lower bounds.
Converts barycentric julian days (BJD) to heliocentric julian days (HJD).
This method uses the Astropy package to convert the time of an observation from
barycentric julian days (BJD_TDB) to heliocentric julian days (HJD_UTC).
Parameters:
bjd (list) – A list of times in barycentric julian days (BJD_TDB)
RA (str) – The right ascension of the object formatted as: 00h00m00.0s.
DEC (str) – The declination of the object formatted as: +00d00m00.0s.
Returns:
list – A list of times converted to heliocentric julian days (HJD).
Converts heliocentric julian days (HJD) to barycentric julian days (BJD).
This method uses the Astropy package to convert the time of an observation from
heliocentric julian days (HJD_UTC) to barycentric julian days (BJD_TDB).
Parameters:
hjd (list) – A list of times in heliocentric julian days (HJD_UTC).
RA (str) – The right ascension of the object in the form 00h00m00.0s.
DEC (str) – The declination of the object in the form +00d00m00.0s.
Returns:
list – The list of times converted to barycentric julian days (BJD_TDB).
Raises an exception if a given set of free parameters are not valid.
This method checks that the given free parameters are valid, ie. that they are a part of the
physical model, and that certain pairs of parameters are not fit together.
Parameters:
requested_params (list) – The requested free parameters.
allowed_params (list) – The parameters that are part of the model.
illegal_params (list) – The parameters that are not relevant to the model.
Reads an RV data file with columns: [Time(BJD),Velocity(m/s),Err(m/s),Source].
Parameters:
filename (str) – The path name of the file that contains the data.
delim (str, optional) – The column delimiter, default is space-delimited.
Returns:
dict – A dictionary containing the RV measurements, times, errors, and sources. Each value is a
list of arrays, with the different arrays corresponding to separate RV data sources.
Raises:
FileNotFoundError – If the specified data file does not exist.
Note
The data are split by the instrument/source so that the instrument-specific parameters
"v0" and "jit" are fit separately.
Reads a timing data file with columns: [Epoch,Time(BJD),Error(BJD),Source].
Parameters:
filename (str) – The path name of the file that contains the data.
delim (str, optional) – The column delimiter, default is space-delimited.
Returns:
dict – A dictionary containing the epochs, mid-times, errors, and sources.
Raises:
FileNotFoundError – If the specified data file does not exist.
ValueError – If the epoch type in the transit data is not recognized.
Note
The epoch (orbit number) of transit observations are integers, and eclipse observations are
differentiated by a half orbit. For example, the eclipse that occurs after the 100th transit
has an epoch equal to 100.5.
Splits instrument-dependent free parameters when there are multiple sources of RV data.
If "jit" and/or "v0" are given as free parameters in a model fit and there is more
than one source of radial velocity data, this method removes them from the list of free
parameters and appends separate variable names for each source.
Parameters:
source_order (list) – Order of the RV sources as read from the data file.
source_tags (list) – Tags identifying the different RV data sources.
free_params (array-like) – The list of free parameters in the model fit.
Splits instrument-dependent parameter results when there are multiple sources of RV data.
If "jit" and/or "v0" are given as free parameters in a model fit and there is more
than one source of radial velocity data, this method splits the relevant results dictionary
entry into separate keys for each source.
Parameters:
free_params (array-like) – The list of free parameters in the model fit.
source_order (list) – Order of the RV sources as read from the data file.
source_tags (list) – Tags identifying the different RV data sources.
results_dic (dict) – The results dictionary returned by the nested sampling methods.
This method creates a 3-part plot of the radial velocity model and data:
1. A plot of the radial velocity measurements vs. time, with an option to plot the
best-fit model. The RV data are shifted by the systemic radial velocity and the
corresponding measurement times are shifted by the reference time.
2. A plot of the residuals of subtracting the best-fit radial velocity model from the
data, including the systemic radial velocity and long-term trends.
3. A plot of the phase-folded RV signal due to the planet, ie. not including the
systemic velocity and long-term trends, and 300 random posterior samples from the model fit.
Parameters:
plot_settings (dict) – A dictionary containing plot settings.
outfile (str) – The file path for saving the plot.
suffix (str, optional) – Optional string for matching model fit results.
model (str, optional) – The RV model that was fit, must be "constant", "decay", or "precession".
Default is "constant".