pint.orbital package

Orbital models

Submodules

pint.orbital.kepler module

Functions for working with Keplerian orbits

All times are in days, distances in light-seconds, and masses in solar masses.

class pint.orbital.kepler.Kepler2DParameters[source]

Bases: pint.orbital.kepler.Kepler2DParameters

Parameters to describe a one-object 2D Keplerian orbit.

a - semimajor axis pb - binary period eps1, eps2 - eccentricity parameters t0 - time of the ascending node

Create new instance of Kepler2DParameters(a, pb, eps1, eps2, t0)

class pint.orbital.kepler.Kepler3DParameters[source]

Bases: pint.orbital.kepler.Kepler3DParameters

Parameters to describe a one-object 3D Keplerian orbit.

a - semimajor axis pb - binary period eps1, eps2 - eccentricity parameters i - inclination angle lan - longitude of the ascending node t0 - time of the ascending node

Create new instance of Kepler3DParameters(a, pb, eps1, eps2, i, lan, t0)

class pint.orbital.kepler.KeplerTwoBodyParameters[source]

Bases: pint.orbital.kepler.KeplerTwoBodyParameters

Parameters to describe a one-object 3D Keplerian orbit.

a - semimajor axis pb - binary period eps1, eps2 - eccentricity parameters i - inclination angle lan - longitude of the ascending node q - mass ratio of bodies (companion over primary) x_cm, y_cm, z_cm - position of the center of mass vx_cm, vy_cm, vz_cm - velocity of the center of mass tasc - time of the ascending node

Create new instance of KeplerTwoBodyParameters(a, pb, eps1, eps2, i, lan, q, x_cm, y_cm, z_cm, vx_cm, vy_cm, vz_cm, tasc)

pint.orbital.kepler.btx_parameters(asini, pb, eps1, eps2, tasc)[source]

Attempt to convert parameters from ELL1 to BTX.

pint.orbital.kepler.eccentric_from_mean(e, mean_anomaly)[source]

Compute the eccentric anomaly from the mean anomaly.

Inputs:
e - the eccentricity mean_anomaly - the mean anomaly
Outputs:
eccentric_anomaly - the true anomaly derivatives - pair of derivatives with respect to the two inputs
pint.orbital.kepler.inverse_kepler_2d(xv, m, t)[source]

Compute the Keplerian parameters for the osculating orbit.

No partial derivatives are computed (even though it would be much easier) because you can use the partials for kepler_2d and invert the matrix.

The value of t0 computed is the value within one half-period of t.

pint.orbital.kepler.inverse_kepler_3d(xyv, m, t)[source]

Inverse Kepler one-body calculation.

pint.orbital.kepler.inverse_kepler_two_body(total_state, t)[source]
pint.orbital.kepler.kepler_2d(params, t)[source]

Position and velocity of a particle in a Kepler orbit.

The orbit has semimajor axis a, period pb, and eccentricity paramerized by eps1=e*sin(om) and eps2=e*cos(om), and the particle is on the x axis at time t0, while the values are computed for time t.

The function returns a pair (xv, p), where xv is of length four and consists of (x,y,v_x,v_y), and p is of shape (4,5) and cell (i,j) contains the the partial derivative of the ith element of xv with respect to the jth orbital parameter.

The zero of time is when the particle is on the positive x axis. (Which will be the ascending node in a three-dimensional model.)

pint.orbital.kepler.kepler_3d(params, t)[source]

One-body Kepler problem in 3D.

This function simply uses kepler_2d and rotates it into 3D.

pint.orbital.kepler.kepler_two_body(params, t)[source]

Set up two bodies in a Keplerian orbit

Most orbital parameters describe the orbit of the primary; the secondary’s parameters are inferred from the fact that its mass is q times that of the primary. x_cm and v_cm are the position and velocity of the center of mass of the system.

The system is observed at time t, and tasc is the the time of the ascending node.

Includes derivatives.

pint.orbital.kepler.mass(a, pb)[source]

Compute the mass of a particle in a Kepler orbit.

The units are a in light seconds, binary period in seconds, and mass in solar masses.

pint.orbital.kepler.mass_partials(a, pb)[source]

Compute the mass of a particle in a Kepler orbit, with partials.

The units are a in light seconds, binary period in seconds, and mass in solar masses.

pint.orbital.kepler.true_from_eccentric(e, eccentric_anomaly)[source]

Compute the true anomaly from the eccentric anomaly.

Inputs:
e - the eccentricity eccentric_anomaly - the eccentric anomaly
Outputs:

true_anomaly - the true anomaly true_anomaly_de - derivative of true anomaly with respect to e true_anomaly_prime - derivative of true anomaly with respect to

eccentric anomaly