Reference/API

twobody Package

A package for computing orbits and astronomical observables for binary stars, exoplanets, and other gravitational two-body systems.

Functions

P_m_to_a(P, m)

Compute the semi-major axis given the orbital period and total mass.

a_P_to_m(a, P)

Compute the total mass given the semi-major axis and period.

a_m_to_P(a, m)

Compute the orbital period given the semi-major axis and total mass.

eccentric_anomaly_from_mean_anomaly(M, e[, ...])

Parameters

eccentric_anomaly_from_true_anomaly(f, e)

Parameters

get_m2_min(m1, mf)

Compute the minimum companion mass given the primary mass and the binary mass function.

mean_anomaly_from_eccentric_anomaly(E, e)

Parameters

test(**kwargs)

Run the tests for the package.

true_anomaly_from_eccentric_anomaly(E, e)

Parameters

Classes

Barycenter([origin, t0, radial_velocity])

The location of the barycenter at the specified epoch.

KeplerElements(*[, P, a, K, e, omega, i, ...])

Keplerian orbital elements for a single orbit.

KeplerOrbit([elements, elements_type, ...])

Represents a bound Kepler orbit.

OrbitalElements(units)

Subclasses must define the class attribute .default_units to be a UnitSystem instance.

PolynomialRVTrend([coeffs, t0])

Specify a polynomial trend in radial velocities by specifying the polynomial coefficients and optionally a reference time.

RVTrend()

ReferencePlaneFrame(*args, **kwargs)

A coordinate frame aligned with the reference plane coordinates of a Kepler orbit, centered on the barycenter or reference point of the orbit.

TwoBodyKeplerElements(*[, P, a, m1, m2, e, ...])

Keplerian orbital elements for a two-body system.

UnitSystem(units, *args)

Represents a system of units.

UnsupportedPythonError