dynamics#
This is the API for the dynamics module.
- class obscurae.dynamics.Dynamics#
Orbital dynamics.
Class to calculate the orbital dynamics of the planet, i.e., the position of the planet on the stellar disk.
- static keplersEq(mean_anomaly, ecc, tolerance=1.48e-08, iter_max=300, sci=True)#
Solves Kepler’s equation.
Function that solves Kepler’s equation:
\[M = E - \sin (E),\]where \(M\) is the mean anomaly and \(E\) the eccentric anomaly.
This is done following the Newton-Raphson method as described in Murray and Correia (2010).
- Parameters:
mean_anomaly (array) – The mean anomaly.
ecc (float) – Eccentricity.
tolerance (float, optional) – The tolerance for convergence. Defaults to 1.e-5.
iter_max (int, optional) – Maximum number of iterations. Defaults to 300.
sci (bool, optional) – Use the scipy implementation of the Newton-Raphson method. Defaults to True.
- Returns:
The new eccentric anomaly.
- Return type:
array
- static trueAnomaly(time, Tw, ecc, per)#
Function that returns the true anomaly.
The approach follows Murray and Correia (2010).
- Parameters:
time (array) – Times of observations.
Tw (float) – Time of periastron.
ecc (float) – Eccentricity.
per (float) – Orbital period.
ww (float) – Argument of periastron in radians.
- Returns:
cosine, sine of the true anomaly.
- Return type:
(array, array)
- static xyPos(cos_f, sin_f, ecc, ww, ar, inc, lam)#
Position of planet on stellar disk.
Function to calculate the position on the stellar disk. Stellar disk goes from 0 to 1 in x and y.
- Parameters:
cos_f (array) – cosine of the true anomaly
sin_f (array) – sine of the true anomaly
ecc (float) – Eccentricity.
ww (float) – Argument of periastron in radians.
ar (float) – Semi-major axis in stellar radii.
inc (float) – Inclination in radians.
lam (float) – Projected obliquity in radians.
- Returns:
x,y position of planet on stellar disk.
- Return type:
(array, array)
- class obscurae.dynamics.SpotOn#
Spot position.
Class to calculate the position of a spot on the stellar disk.
- static spotPos(time, theta, phi, per, t_ref=0.0)#
Position of spot on stellar surface.
Function to calculate the position of a spot at a given (\(\phi\),:math:` heta`) on the stellar surface, where \(\phi\) is the colatitude (\(0^\circ\) at north pole and \(180^\circ\) at the south pole) and :math:` heta` the longitude.
- Parameters:
time (array) – Times of observations in days.
phi (float) – Latitude of spot in radians.
theta (float) – Longitude of spot in radians.
per (float) – Period of spot crossing/rotation period in days.
t_ref (float, optional) – Reference time in days. Defaults to 0.0.
- Returns:
x, y position of spot on stellar surface.
- Return type:
(array, array)