Keplerian Elements¶
Functions for working with Keplerian orbital elements and computing orbital properties.
Orbital Properties¶
semimajor_axis builtin ¶
Computes the semi-major axis of an astronomical object from Earth given the object's mean motion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n | float or array | The mean motion of the astronomical object in radians or degrees. An array is evaluated element-wise. | required |
angle_format | AngleFormat | Interpret mean motion as AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The semi-major axis of the astronomical object in meters. An array of the input shape is returned for array input. |
semimajor_axis_general builtin ¶
semimajor_axis_general(n: Union[float, array], gm: float, angle_format: AngleFormat) -> Union[float, ndarray]
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 or array | The mean motion of the astronomical object in radians or degrees. An array is evaluated element-wise. | 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:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The semi-major axis of the astronomical object in meters. An array of the input shape is returned for array input. |
semimajor_axis_from_orbital_period builtin ¶
Computes the semi-major axis from orbital period around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period | float or array | The orbital period in seconds. An array is evaluated element-wise. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The semi-major axis in meters. An array of the input shape is returned for array input. |
semimajor_axis_from_orbital_period_general builtin ¶
semimajor_axis_from_orbital_period_general(period: Union[float, array], gm: float) -> Union[float, ndarray]
Computes the semi-major axis from orbital period for a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period | float or array | The orbital period in seconds. An array is evaluated element-wise. | required |
gm | float | (keyword-only) The standard gravitational parameter of primary body in m³/s². | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The semi-major axis in meters. An array of the input shape is returned for array input. |
mean_motion builtin ¶
Computes the mean motion of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise; or a 2-D array of shape | required |
angle_format | AngleFormat | (keyword-only) Return output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The mean motion of the astronomical object in radians or degrees. An array is returned for array input: shape |
Example
mean_motion_general builtin ¶
mean_motion_general(a_or_oe: Union[float, array], gm: float, angle_format: AngleFormat) -> Union[float, ndarray]
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 | The semi-major axis in meters, as a scalar or an array evaluated element-wise; or a 2-D array of shape | 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:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The mean motion of the astronomical object in radians or degrees. An array is returned for array input: shape |
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 | The semi-major axis in meters, as a scalar or an array evaluated element-wise; or a 2-D array of shape | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The orbital period of the astronomical object in seconds. An array is returned for array input: shape |
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 | The semi-major axis in meters, as a scalar or an array evaluated element-wise; or a 2-D array of shape | required |
gm | float | (keyword-only) The standard gravitational parameter of primary body in m³/s². | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The orbital period of the astronomical object in seconds. An array is returned for array input: shape |
Example
periapsis_distance builtin ¶
periapsis_distance(a_or_oe: Union[float, array], e: Union[float, array] = None) -> Union[float, ndarray]
Calculate the distance of an object at its periapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The distance of the object at periapsis in meters. An array is returned for array input: shape |
Example
apoapsis_distance builtin ¶
apoapsis_distance(a_or_oe: Union[float, array], e: Union[float, array] = None) -> Union[float, ndarray]
Calculate the distance of an object at its apoapsis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The distance of the object at apoapsis in meters. An array is returned for array input: shape |
Example
periapsis_velocity builtin ¶
periapsis_velocity(a_or_oe: Union[float, array], e: Union[float, array] = None, *, gm: float) -> Union[float, ndarray]
Computes the periapsis velocity of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
gm | float | (keyword-only) The standard gravitational parameter of primary body in m³/s². | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The magnitude of velocity of the object at periapsis in m/s. An array is returned for array input: shape |
Example
apoapsis_velocity builtin ¶
apoapsis_velocity(a_or_oe: Union[float, array], e: Union[float, array] = None, *, gm: float) -> Union[float, ndarray]
Computes the apoapsis velocity of an astronomical object around a general body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
gm | float | (keyword-only) The standard gravitational parameter of primary body in m³/s². | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The magnitude of velocity of the object at apoapsis in m/s. An array is returned for array input: shape |
Example
perigee_velocity builtin ¶
perigee_velocity(a_or_oe: Union[float, array], e: Union[float, array] = None) -> Union[float, ndarray]
Computes the perigee velocity of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The magnitude of velocity of the object at perigee in m/s. An array is returned for array input: shape |
Example
apogee_velocity builtin ¶
apogee_velocity(a_or_oe: Union[float, array], e: Union[float, array] = None) -> Union[float, ndarray]
Computes the apogee velocity of an astronomical object around Earth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_or_oe | float or array | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The magnitude of velocity of the object at apogee in m/s. An array is returned for array input: shape |
Example
sun_synchronous_inclination builtin ¶
sun_synchronous_inclination(a_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
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 | The semi-major axis in meters, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Return output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: Inclination for a Sun synchronous orbit in degrees or radians. An array is returned for array input: shape |
Example
Anomaly Conversions¶
anomaly_eccentric_to_mean builtin ¶
anomaly_eccentric_to_mean(anm_ecc_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
Converts eccentric anomaly into mean anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc_or_oe | float or array | The eccentric anomaly, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: Mean anomaly in radians or degrees. An array is returned for array input: shape |
Example
anomaly_eccentric_to_true builtin ¶
anomaly_eccentric_to_true(anm_ecc_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
Converts eccentric anomaly into true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_ecc_or_oe | float or array | The eccentric anomaly, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: True anomaly in radians or degrees. An array is returned for array input: shape |
Example
anomaly_mean_to_eccentric builtin ¶
anomaly_mean_to_eccentric(anm_mean_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
Converts mean anomaly into eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean_or_oe | float or array | The mean anomaly, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: Eccentric anomaly in radians or degrees. An array is returned for array input: shape |
Example
anomaly_mean_to_true builtin ¶
anomaly_mean_to_true(anm_mean_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
Converts mean anomaly into true anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_mean_or_oe | float or array | The mean anomaly, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: True anomaly in radians or degrees. An array is returned for array input: shape |
Example
anomaly_true_to_eccentric builtin ¶
anomaly_true_to_eccentric(anm_true_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
Converts true anomaly into eccentric anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true_or_oe | float or array | The true anomaly, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: Eccentric anomaly in radians or degrees. An array is returned for array input: shape |
Example
anomaly_true_to_mean builtin ¶
anomaly_true_to_mean(anm_true_or_oe: Union[float, array], e: Union[float, array] = None, *, angle_format: AngleFormat) -> Union[float, ndarray]
Converts true anomaly into mean anomaly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
anm_true_or_oe | float or array | The true anomaly, as a scalar or an array evaluated element-wise (broadcast against | required |
e | float or array | The eccentricity, broadcast against | None |
angle_format | AngleFormat | (keyword-only) Interprets input and returns output in AngleFormat.DEGREES or AngleFormat.RADIANS. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: Mean anomaly in radians or degrees. An array is returned for array input: shape |