Keplerian Elements¶
Functions for working with Keplerian orbital elements and computing orbital properties.
Orbital Properties¶
semimajor_axis
builtin
¶
semimajor_axis(n: float, angle_format: AngleFormat) -> float
Computes the semi-major axis of an astronomical object from Earth given the object's mean motion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
float
|
The mean motion of the astronomical object in radians or degrees. |
required |
angle_format
|
AngleFormat
|
Interpret mean motion as AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The semi-major axis of the astronomical object in meters. |
semimajor_axis_general
builtin
¶
semimajor_axis_general(n: float, gm: float, angle_format: AngleFormat) -> float
Computes the semi-major axis of an astronomical object from a general body given the object's mean motion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
float
|
The mean motion of the astronomical object in radians or degrees. |
required |
gm
|
float
|
The standard gravitational parameter of primary body in m³/s². |
required |
angle_format
|
AngleFormat
|
Interpret mean motion as AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The semi-major axis of the astronomical object in meters. |
semimajor_axis_from_orbital_period
builtin
¶
semimajor_axis_from_orbital_period_general
builtin
¶
Computes the semi-major axis from orbital period for a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
float
|
The orbital period in seconds. |
required |
gm
|
float
|
The standard gravitational parameter of primary body in m³/s². |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The semi-major axis in meters. |
mean_motion
builtin
¶
mean_motion(a: float, angle_format: AngleFormat) -> float
Computes the mean motion of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
angle_format
|
AngleFormat
|
Return output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The mean motion of the astronomical object in radians or degrees. |
mean_motion_general
builtin
¶
mean_motion_general(a: float, gm: float, angle_format: AngleFormat) -> float
Computes the mean motion of an astronomical object around a general body given a semi-major axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
gm
|
float
|
The standard gravitational parameter of primary body in m³/s². |
required |
angle_format
|
AngleFormat
|
Return output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The mean motion of the astronomical object in radians or degrees. |
orbital_period
builtin
¶
Computes the orbital period of an object around Earth.
Uses rastro.constants.GM_EARTH as the standard gravitational parameter for the calculation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The orbital period of the astronomical object in seconds. |
orbital_period_general
builtin
¶
Computes the orbital period of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
gm
|
float
|
The standard gravitational parameter of primary body in m³/s². |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The orbital period of the astronomical object in seconds. |
periapsis_distance
builtin
¶
Calculate the distance of an object at its periapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The distance of the object at periapsis in meters. |
apoapsis_distance
builtin
¶
Calculate the distance of an object at its apoapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The distance of the object at apoapsis in meters. |
periapsis_velocity
builtin
¶
Computes the periapsis velocity of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
gm
|
float
|
The standard gravitational parameter of primary body in m³/s². |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The magnitude of velocity of the object at periapsis in m/s. |
apoapsis_velocity
builtin
¶
Computes the apoapsis velocity of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
gm
|
float
|
The standard gravitational parameter of primary body in m³/s². |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The magnitude of velocity of the object at apoapsis in m/s. |
perigee_velocity
builtin
¶
Computes the perigee velocity of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The magnitude of velocity of the object at perigee in m/s. |
apogee_velocity
builtin
¶
Computes the apogee velocity of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The magnitude of velocity of the object at apogee in m/s. |
sun_synchronous_inclination
builtin
¶
sun_synchronous_inclination(a: float, e: float, angle_format: AngleFormat) -> float
Computes the inclination for a Sun-synchronous orbit around Earth based on the J2 gravitational perturbation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
float
|
The semi-major axis of the astronomical object in meters. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Return output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Inclination for a Sun synchronous orbit in degrees or radians. |
Anomaly Conversions¶
anomaly_eccentric_to_mean
builtin
¶
anomaly_eccentric_to_mean(anm_ecc: float, e: float, angle_format: AngleFormat) -> float
Converts eccentric anomaly into mean anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc
|
float
|
Eccentric anomaly in radians or degrees. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Mean anomaly in radians or degrees. |
anomaly_eccentric_to_true
builtin
¶
anomaly_eccentric_to_true(anm_ecc: float, e: float, angle_format: AngleFormat) -> float
Converts eccentric anomaly into true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc
|
float
|
Eccentric anomaly in radians or degrees. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
True anomaly in radians or degrees. |
anomaly_mean_to_eccentric
builtin
¶
anomaly_mean_to_eccentric(anm_mean: float, e: float, angle_format: AngleFormat) -> float
Converts mean anomaly into eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean
|
float
|
Mean anomaly in radians or degrees. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Eccentric anomaly in radians or degrees. |
anomaly_mean_to_true
builtin
¶
anomaly_mean_to_true(anm_mean: float, e: float, angle_format: AngleFormat) -> float
Converts mean anomaly into true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean
|
float
|
Mean anomaly in radians or degrees. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
True anomaly in radians or degrees. |
anomaly_true_to_eccentric
builtin
¶
anomaly_true_to_eccentric(anm_true: float, e: float, angle_format: AngleFormat) -> float
Converts true anomaly into eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true
|
float
|
True anomaly in radians or degrees. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Eccentric anomaly in radians or degrees. |
anomaly_true_to_mean
builtin
¶
anomaly_true_to_mean(anm_true: float, e: float, angle_format: AngleFormat) -> float
Converts true anomaly into mean anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true
|
float
|
True anomaly in radians or degrees. |
required |
e
|
float
|
The eccentricity of the astronomical object's orbit (dimensionless). |
required |
angle_format
|
AngleFormat
|
Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Mean anomaly in radians or degrees. |