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 | (keyword-only) 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 | (keyword-only) 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_or_oe: Union[float, array], angle_format: AngleFormat) -> float
Computes the mean motion of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
angle_format | AngleFormat | (keyword-only) 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. |
Example
mean_motion_general builtin ¶
Computes the mean motion of an astronomical object around a general body given a semi-major axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
gm | float | (keyword-only) The standard gravitational parameter of primary body in m³/s². | required |
angle_format | AngleFormat | (keyword-only) 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. |
Example
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_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The orbital period of the astronomical object in seconds. |
Example
orbital_period_general builtin ¶
Computes the orbital period of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
gm | float | (keyword-only) 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. |
Example
periapsis_distance builtin ¶
Calculate the distance of an object at its periapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The distance of the object at periapsis in meters. |
Example
apoapsis_distance builtin ¶
Calculate the distance of an object at its apoapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The distance of the object at apoapsis in meters. |
Example
periapsis_velocity builtin ¶
Computes the periapsis velocity of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
gm | float | (keyword-only) 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. |
Example
apoapsis_velocity builtin ¶
Computes the apoapsis velocity of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
gm | float | (keyword-only) 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. |
Example
perigee_velocity builtin ¶
Computes the perigee velocity of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The magnitude of velocity of the object at perigee in m/s. |
Example
apogee_velocity builtin ¶
Computes the apogee velocity of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The magnitude of velocity of the object at apogee in m/s. |
Example
sun_synchronous_inclination builtin ¶
sun_synchronous_inclination(a_or_oe: Union[float, array], e: float = None, *, 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_or_oe | float or array | Either the semi-major axis in meters, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) 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. |
Example
Anomaly Conversions¶
anomaly_eccentric_to_mean builtin ¶
anomaly_eccentric_to_mean(anm_ecc_or_oe: Union[float, array], e: float = None, *, angle_format: AngleFormat) -> float
Converts eccentric anomaly into mean anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc_or_oe | float or array | Either the eccentric anomaly, or a 6-element Keplerian elements array [a, e, i, Ω, ω, E] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Mean anomaly in radians or degrees. |
Example
anomaly_eccentric_to_true builtin ¶
anomaly_eccentric_to_true(anm_ecc_or_oe: Union[float, array], e: float = None, *, angle_format: AngleFormat) -> float
Converts eccentric anomaly into true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc_or_oe | float or array | Either the eccentric anomaly, or a 6-element Keplerian elements array [a, e, i, Ω, ω, E] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | True anomaly in radians or degrees. |
Example
anomaly_mean_to_eccentric builtin ¶
anomaly_mean_to_eccentric(anm_mean_or_oe: Union[float, array], e: float = None, *, angle_format: AngleFormat) -> float
Converts mean anomaly into eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean_or_oe | float or array | Either the mean anomaly, or a 6-element Keplerian elements array [a, e, i, Ω, ω, M] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Eccentric anomaly in radians or degrees. |
Example
anomaly_mean_to_true builtin ¶
anomaly_mean_to_true(anm_mean_or_oe: Union[float, array], e: float = None, *, angle_format: AngleFormat) -> float
Converts mean anomaly into true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean_or_oe | float or array | Either the mean anomaly, or a 6-element Keplerian elements array [a, e, i, Ω, ω, M] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | True anomaly in radians or degrees. |
Example
anomaly_true_to_eccentric builtin ¶
anomaly_true_to_eccentric(anm_true_or_oe: Union[float, array], e: float = None, *, angle_format: AngleFormat) -> float
Converts true anomaly into eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true_or_oe | float or array | Either the true anomaly, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Eccentric anomaly in radians or degrees. |
Example
anomaly_true_to_mean builtin ¶
anomaly_true_to_mean(anm_true_or_oe: Union[float, array], e: float = None, *, angle_format: AngleFormat) -> float
Converts true anomaly into mean anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true_or_oe | float or array | Either the true anomaly, or a 6-element Keplerian elements array [a, e, i, Ω, ω, ν] from which | required |
e | float | The eccentricity. Required if | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Mean anomaly in radians or degrees. |