Orbit

class ssapy.orbit.Orbit(r, v, t, mu=398600441800000.0, propkw=None)[source][source]

Bases: object

Orbital state of one or more objects.

This class represents one or more instantaneous (osculating) states of orbiting bodies. Representations in Cartesian, Keplerian, and equinoctial elements are available. The default initializer requires Cartesian elements, though class methods are also available to initialize with Keplerian or equinoctial elements.

Note that generally this class can represent either a single scalar orbit, in which case attributes will generally be scalar floats, or a vector of orbits, in which case attributes will be ndarrays of floats. For attributes that are intrinsically vectors even for a single orbit (position, velocity, …), a 2d array will be used for a “vector of orbits”, with the first dimension representing the different orbits.

For simplicity, we will only indicate the “single scalar Orbit” dimensions in docstrings. For a vector-Orbit, most scalar input arguments can be supplied as broadcastable arrays, and scalar attributes become array attributes. When a multi-dimensional array is required, the first dimension is the one over different orbits.

Parameters:
  • r ((3,) array_like) – Position of orbiting object in meters.

  • v ((3,) array_like) – Velocity of orbiting objects in meters per second.

  • t (float or astropy.time.Time) – If float or array of float, then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC

  • mu (float, optional) – Gravitational constant of central body in m^3/s^2. (Default: Earth’s gravitational constant in WGS84).

r[source]

Position of orbiting object in meters.

Type:

(3,) array_like

v[source]

Velocity of orbiting object in meters per second.

Type:

(3,) array_like

t[source]

GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC

Type:

float

mu[source]

Gravitational constant of central body in m^3/s^2

Type:

float

a[source]

Semimajor axis in meters.

Type:

float

hx, hy

Components of the equinoctial inclination vector.

Type:

float

ex, ey

Components of the equinoctial eccentricity vector.

Type:

float

lv[source]

True longitude in radians.

Type:

float

lE[source]

Eccentric longitude in radians.

Type:

float

lM[source]

Mean longitude in radians.

Type:

float

e[source]

Keplerian eccentricity.

Type:

float

i[source]

Keplerian inclination in radians.

Type:

float

pa[source]

Keplerian periapsis argument in radians.

Type:

float

raan[source]

Keplerian right ascension of the ascending node in radians.

Type:

float

trueAnomaly[source]

Keplerian true anomaly in radians.

Type:

float

eccentricAnomaly[source]

Keplerian eccentric anomaly in radians.

Type:

float

meanAnomaly[source]

Keplerian mean anomaly in radians.

Type:

float

period[source]

Orbital period in seconds.

Type:

float

meanMotion[source]

Keplerian mean motion in radians per second.

Type:

float

p[source]

Semi-latus rectum in meters.

Type:

float

angularMomentum[source]

(Specific) angular momentum in m^2/s.

Type:

(3,) array_like

energy[source]

(Specific) orbital energy in m^2/s^2.

Type:

float

LRL[source]

Laplace-Runge-Lenz vector in m^3/s^2.

Type:

(3,) array_like

periapsis[source]

Periapsis coordinate of orbit in meters.

Type:

(3,) array_like

apoapsis[source]

Apoapsis coordinate of orbit in meters.

Type:

(3,) array_like

equinoctialElements[source]
keplerianElements[source]
fromKeplerianElements(a, e, i, pa, raan, trueAnomaly, t, mu)[source][source]

Construct an Orbit from Keplerian elements.

fromEquinoctialElements(a, hx, hy, ex, ey, lv, t, mu)[source][source]

Construct an Orbit from Equinoctial elements.

at(t, propagator)[source][source]

Propagate orbit to time t and return new Orbit.

Notes

Although much of the Orbit class here is agnostic with respect to the coordinate reference frame, we strongly recommend that positions and velocities be specified in the GCRF frame. Some other classes in this module do insist on this frame, (e.g., EarthObserver). We will try to indicate where the GCRF frame is required, but make no guarantees that we don’t miss any such instances.

Attributes Summary

LRL

meant to be used for lazy evaluation of an object attribute.

a

meant to be used for lazy evaluation of an object attribute.

angularMomentum

meant to be used for lazy evaluation of an object attribute.

apoapsis

meant to be used for lazy evaluation of an object attribute.

e

meant to be used for lazy evaluation of an object attribute.

eccentricAnomaly

meant to be used for lazy evaluation of an object attribute.

energy

meant to be used for lazy evaluation of an object attribute.

equinoctialElements

Equinoctial elements (a, hx, hy, ex, ey, lv).

ex

meant to be used for lazy evaluation of an object attribute.

ey

meant to be used for lazy evaluation of an object attribute.

hx

meant to be used for lazy evaluation of an object attribute.

hy

meant to be used for lazy evaluation of an object attribute.

i

meant to be used for lazy evaluation of an object attribute.

keplerianElements

Keplerian elements (a, e, i, pa, raan, trueAnomaly).

kozaiMeanKeplerianElements

meant to be used for lazy evaluation of an object attribute.

lE

meant to be used for lazy evaluation of an object attribute.

lM

meant to be used for lazy evaluation of an object attribute.

lonPa

meant to be used for lazy evaluation of an object attribute.

lv

meant to be used for lazy evaluation of an object attribute.

meanAnomaly

meant to be used for lazy evaluation of an object attribute.

meanMotion

meant to be used for lazy evaluation of an object attribute.

p

meant to be used for lazy evaluation of an object attribute.

pa

meant to be used for lazy evaluation of an object attribute.

periapsis

meant to be used for lazy evaluation of an object attribute.

period

meant to be used for lazy evaluation of an object attribute.

raan

meant to be used for lazy evaluation of an object attribute.

tle

meant to be used for lazy evaluation of an object attribute.

trueAnomaly

meant to be used for lazy evaluation of an object attribute.

Methods Summary

at(t[, propagator])

Propagate this orbit to time t.

fromEquinoctialElements(a, hx, hy, ex, ey, lv, t)

Construct an Orbit from equinoctial elements.

fromKeplerianElements(a, e, i, pa, raan, ...)

Construct an Orbit from Keplerian elements.

fromKozaiMeanKeplerianElements(a, e, i, pa, ...)

Construct an Orbit from Kozai mean Keplerian elements.

fromTLE(sat_name, tle_filename[, propkw])

Construct an Orbit from a TLE file

fromTLETuple(tle[, propkw])

Construct an Orbit from a TLE tuple

Attributes Documentation

LRL[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

a[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

angularMomentum[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

apoapsis[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

e[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

eccentricAnomaly[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

energy[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

equinoctialElements[source]

Equinoctial elements (a, hx, hy, ex, ey, lv).

ex[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

ey[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

hx[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

hy[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

i[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

keplerianElements[source]

Keplerian elements (a, e, i, pa, raan, trueAnomaly).

kozaiMeanKeplerianElements[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

lE[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

lM[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

lonPa[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

lv[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

meanAnomaly[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

meanMotion[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

p[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

pa[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

periapsis[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

period[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

raan[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

tle[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

trueAnomaly[source]

meant to be used for lazy evaluation of an object attribute. property should represent non-mutable data, as it replaces itself.

Methods Documentation

at(t, propagator=KeplerianPropagator())[source][source]

Propagate this orbit to time t.

Parameters:
  • t (float or astropy.time.Time) – If float, then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC

  • propagator (Propagator, optional) – The propagator instance to use.

Returns:

Propagated Orbit.

Return type:

Orbit

classmethod fromEquinoctialElements(a, hx, hy, ex, ey, lv, t, mu=398600441800000.0, propkw=None)[source][source]

Construct an Orbit from equinoctial elements.

Parameters:
  • a (float) – Semimajor axis in meters.

  • hx (float) – Components of the equinoctial inclination vector.

  • hy (float) – Components of the equinoctial inclination vector.

  • ex (float) – Components of the equinoctial eccentricity vector.

  • ey (float) – Components of the equinoctial eccentricity vector.

  • lv (float) – True longitude in radians.

  • t (float or astropy.time.Time) – If float, then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC

  • mu (float, optional) – Gravitational constant of central body in m^3/s^2. (Default: Earth’s gravitational constant in WGS84).

Returns:

The Orbit with given parameters.

Return type:

Orbit

classmethod fromKeplerianElements(a, e, i, pa, raan, trueAnomaly, t, mu=398600441800000.0, propkw=None)[source][source]

Construct an Orbit from Keplerian elements.

Parameters:
  • a (float) – Semimajor axis in meters.

  • e (float) – Keplerian eccentricity.

  • i (float) – Keplerian inclination in radians.

  • pa (float) – Keplerian periapsis argument in radians.

  • raan (float) – Keplerian right ascension of the ascending node in radians.

  • trueAnomaly (float) – Keplerian true anomaly in radians.

  • t (float or astropy.time.Time) – If float, then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC

  • mu (float, optional) – Gravitational constant of central body in m^3/s^2. (Default: Earth’s gravitational constant in WGS84).

Returns:

The Orbit with given parameters.

Return type:

Orbit

classmethod fromKozaiMeanKeplerianElements(a, e, i, pa, raan, trueAnomaly, t, mu=398600441800000.0, _useTEME=False, propkw=None)[source][source]

Construct an Orbit from Kozai mean Keplerian elements. By default, this method also converts from the TEME reference frame to the GCRF frame. This is mainly to support TLEs and SGP4, so the default gravitational parameter is WGS84.

Parameters:
  • a (float) – Semimajor axis in meters.

  • e (float) – Keplerian eccentricity.

  • i (float) – Keplerian inclination in radians.

  • pa (float) – Keplerian periapsis argument in radians.

  • raan (float) – Keplerian right ascension of the ascending node in radians.

  • trueAnomaly (float) – Keplerian true anomaly in radians.

  • t (float or astropy.time.Time) – If float, then should correspond to GPS seconds; i.e., seconds since 1980-01-06 00:00:00 UTC

  • mu (float, optional) – Gravitational constant of central body in m^3/s^2. (Default: Earth’s gravitational constant in WGS84).

Returns:

The Orbit with given parameters.

Return type:

Orbit

classmethod fromTLE(sat_name, tle_filename, propkw=None)[source][source]

Construct an Orbit from a TLE file

Parameters:
  • sat_name (str) – NORAD name of the satellite

  • tle_filename (str) – Path and name of file where TLE is

Return type:

Orbit

classmethod fromTLETuple(tle, propkw=None)[source][source]

Construct an Orbit from a TLE tuple

Parameters:

tle (2-tuple of str) – Line1 and Line2 of TLE as strings

Return type:

Orbit