Altitude and Period Functions¶
Functions for computing orbital altitudes and periods from orbital elements or state vectors.
Orbital Period from State¶
orbital_period_from_state builtin ¶
orbital_period_from_state(state_eci: Union[ndarray, Sequence], gm: float, axis: int = -1) -> Union[float, ndarray]
Computes orbital period from an ECI state vector using the vis-viva equation.
This function uses the vis-viva equation to compute the semi-major axis from the position and velocity, then calculates the orbital period.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state_eci | ndarray or list | ECI state vector [x, y, z, vx, vy, vz] in meters and meters/second. Also accepts a batch of states with the 6 components along | required |
gm | float | Gravitational parameter in m³/s². Use GM_EARTH for Earth orbits. | required |
axis | int | The axis of | -1 |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: Orbital period in seconds. An array of the batch dimensions is returned for batched input. |
Example
Altitude Functions¶
Periapsis and Apoapsis (General)¶
periapsis_altitude builtin ¶
periapsis_altitude(a_or_oe: Union[float, array], e: Union[float, array] = None, *, r_body: float) -> Union[float, ndarray]
Calculate the altitude above a body's surface at 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 |
r_body | float | (keyword-only) The radius of the central body in meters. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The altitude above the body's surface at periapsis in meters. An array is returned for array input: shape |
Example
apoapsis_altitude builtin ¶
apoapsis_altitude(a_or_oe: Union[float, array], e: Union[float, array] = None, *, r_body: float) -> Union[float, ndarray]
Calculate the altitude above a body's surface at 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 |
r_body | float | (keyword-only) The radius of the central body in meters. | required |
Returns:
| Type | Description |
|---|---|
Union[float, ndarray] | float or numpy.ndarray: The altitude above the body's surface at apoapsis in meters. An array is returned for array input: shape |
Example
Perigee and Apogee (Earth-Specific)¶
perigee_altitude builtin ¶
perigee_altitude(a_or_oe: Union[float, array], e: Union[float, array] = None) -> Union[float, ndarray]
Calculate the altitude above Earth's surface at perigee.
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 altitude above Earth's surface at perigee in meters. An array is returned for array input: shape |
Example
apogee_altitude builtin ¶
apogee_altitude(a_or_oe: Union[float, array], e: Union[float, array] = None) -> Union[float, ndarray]
Calculate the altitude above Earth's surface at apogee.
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 altitude above Earth's surface at apogee in meters. An array is returned for array input: shape |