keplemon.elements
elements
CartesianState
State represented as x, y, z and vx, vy, vz in a given reference frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
UTC epoch of the state |
required |
position
|
CartesianVector
|
Cartesian position vector in kilometers |
required |
velocity
|
CartesianVector
|
Cartesian velocity vector in kilometers per second |
required |
frame
|
ReferenceFrame
|
reference frame of the state |
required |
epoch
instance-attribute
UTC epoch of the state
frame
instance-attribute
Current reference frame of the state
position
instance-attribute
Position of the state in kilometers
velocity
instance-attribute
Velocity of the state in kilometers per second
to_frame(frame)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
ReferenceFrame
|
reference frame of the output state |
required |
Returns:
| Name | Type | Description |
|---|---|---|
CartesianState |
CartesianState
|
Cartesian state in the new frame |
to_keplerian()
Convert the Cartesian state to osculating Keplerian elements
CartesianVector
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
float
|
x coordinate |
required |
y
|
float
|
y coordinate |
required |
z
|
float
|
z coordinate |
required |
magnitude
instance-attribute
angle(other)
Returns:
| Type | Description |
|---|---|
float
|
Angle between two Cartesian vectors in radians. |
distance(other)
Note
Take care to use consistent units with this function.
Returns:
| Type | Description |
|---|---|
float
|
Distance between two Cartesian vectors |
to_spherical()
Returns:
| Type | Description |
|---|---|
SphericalVector
|
Spherical representation of the point |
Ephemeris
add_state(state)
Add a state to the ephemeris.
to_observations()
Generate angular observations from the ephemeris states.
Steps through the ephemeris epoch range at regular intervals, creating synthetic observations from each interpolated state.
Returns:
| Type | Description |
|---|---|
list[Observation]
|
List of angular observations derived from the ephemeris |
EquinoctialElements
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a_f
|
float
|
Equinoctial element a_f |
required |
a_g
|
float
|
Equinoctial element a_g |
required |
chi
|
float
|
Equinoctial element chi |
required |
psi
|
float
|
Equinoctial element psi |
required |
mean_longitude
|
float
|
Mean longitude in degrees |
required |
mean_motion
|
float
|
Mean motion in revolutions per day |
required |
GeodeticPosition
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
latitude
|
float
|
Latitude in degrees |
required |
longitude
|
float
|
Longitude in degrees |
required |
altitude
|
float
|
Altitude in kilometers |
required |
altitude
instance-attribute
Altitude in kilometers
latitude
instance-attribute
Latitude in degrees
longitude
instance-attribute
Longitude in degrees
HorizonElements
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
range
|
Range in kilometers |
required | |
az
|
Azimuth in degrees |
required | |
el
|
Elevation in degrees |
required | |
range_rate
|
Range rate in kilometers per second |
required | |
az_rate
|
Azimuth rate in degrees per second |
required | |
el_rate
|
Elevation rate in degrees per second |
required |
HorizonState
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
UTC epoch of the state |
required |
elements
|
HorizonElements
|
HorizonElements of the state |
required |
azimuth
instance-attribute
Azimuth in degrees
azimuth_rate
instance-attribute
Azimuth rate in degrees per second
elements
instance-attribute
Horizon elements of the state
elevation
instance-attribute
Elevation in degrees
elevation_rate
instance-attribute
Elevation rate in degrees per second
epoch
instance-attribute
UTC epoch of the state
range
instance-attribute
Range in kilometers
range_rate
instance-attribute
Range rate in kilometers per second
KeplerianElements
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
semi_major_axis
|
float
|
Average distance from the central body in kilometers |
required |
eccentricity
|
float
|
Eccentricity of the orbit |
required |
inclination
|
float
|
Inclination of the orbit in degrees |
required |
raan
|
float
|
Right Ascension of Ascending Node in degrees |
required |
argument_of_perigee
|
float
|
Argument of Perigee in degrees |
required |
mean_anomaly
|
float
|
Mean Anomaly in degrees |
required |
KeplerianState
Orbit represented as Keplerian elements in a given reference frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
UTC epoch of the state |
required |
elements
|
KeplerianElements
|
Keplerian elements of the state |
required |
frame
|
ReferenceFrame
|
reference frame of the state |
required |
keplerian_type
|
KeplerianType
|
type of the Keplerian elements |
required |
apoapsis
instance-attribute
Furthest point from the central body in kilometers
argument_of_perigee
instance-attribute
Argument of Perigee in degrees
eccentricity
instance-attribute
Eccentricity of the orbit
inclination
instance-attribute
Inclination of the orbit in degrees
mean_anomaly
instance-attribute
Mean Anomaly in degrees
mean_motion
instance-attribute
Mean motion in revolutions per day
periapsis
instance-attribute
Closest point to the central body in kilometers
raan
instance-attribute
Right Ascension of Ascending Node in degrees
semi_major_axis
instance-attribute
Average distance from the central body in kilometers
to_cartesian()
Returns:
| Type | Description |
|---|---|
CartesianState
|
Cartesian state in kilometers and kilometers per second. |
to_frame(frame)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frame
|
ReferenceFrame
|
reference frame of the output state |
required |
Returns:
| Type | Description |
|---|---|
KeplerianState
|
Keplerian state in the new frame |
SphericalVector
Note
The range units can be disregarded if this class is not being used for astrodynamic transforms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
range
|
float
|
distance from the origin in kilometers |
required |
right_ascension
|
float
|
right ascension in degrees |
required |
declination
|
float
|
declination in degrees |
required |
to_cartesian()
Returns:
| Type | Description |
|---|---|
CartesianVector
|
Cartesian vector in kilometers. |
TLE
agom
instance-attribute
apoapsis
instance-attribute
Apoapsis radius in kilometers
argument_of_perigee
instance-attribute
Argument of Perigee in degrees
b_star
instance-attribute
b_term
instance-attribute
cartesian_state
instance-attribute
TEME cartesian state of the TLE at epoch
classification
instance-attribute
designator
instance-attribute
8-character identifier of the satellite
eccentricity
instance-attribute
epoch
instance-attribute
UTC epoch of the state
inclination
instance-attribute
Inclination of the orbit in degrees
lines
property
Note
If the TLE was created in the 3LE format, only lines 2 and 3 will be returned. The name must be accessed
using the name property.
Returns:
| Type | Description |
|---|---|
tuple[str, str]
|
Tuple of strings in 2 line format |
mean_anomaly
instance-attribute
Mean Anomaly in degrees
mean_motion
instance-attribute
Mean motion in revolutions per day
mean_motion_dot
instance-attribute
mean_motion_dot_dot
instance-attribute
name
instance-attribute
norad_id
instance-attribute
NORAD catalog ID of the satellite
periapsis
instance-attribute
Periapsis radius in kilometers
raan
instance-attribute
Right Ascension of Ascending Node in degrees
satellite_id
instance-attribute
semi_major_axis
instance-attribute
Average distance from the central body in kilometers
Note
This is always calculated using Brouwer mean motion and will differ slightly from Kozai-computed SMA.
type
instance-attribute
from_ephemeris(ephemeris, tle_type)
classmethod
Fit a TLE to an ephemeris using batch least squares.
Generates synthetic observations from the ephemeris and uses batch least squares estimation to produce a TLE of the specified type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ephemeris
|
Ephemeris
|
Ephemeris containing position/velocity states to fit |
required |
tle_type
|
KeplerianType
|
The type of mean elements for the output TLE |
required |
Returns:
| Type | Description |
|---|---|
TLE
|
TLE fitted to the ephemeris |
from_lines(line_1, line_2, line_3=None)
classmethod
Create a TLE object using strings in 2 or 3 line format
get_keplerian_state_at_epoch(epoch)
Get a Keplerian state at a specific epoch by propagating the TLE.
Returns mean elements appropriate to the TLE type (Kozai for SGP4, Brouwer for XP).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
The epoch at which to get the state |
required |
Returns:
| Type | Description |
|---|---|
KeplerianState
|
KeplerianState in TEME frame at the specified epoch |
get_observation_at_epoch(epoch)
Get an observation at a specific epoch.
Creates an observation from the TLE's propagated state at the given epoch, useful for batch least squares fitting of multiple TLEs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
The epoch at which to generate the observation |
required |
Returns:
| Type | Description |
|---|---|
Observation
|
Observation derived from this TLE at the given epoch |
get_state_at_epoch(epoch)
Get a Cartesian state at a specific epoch by propagating the TLE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
The epoch at which to get the state |
required |
Returns:
| Type | Description |
|---|---|
CartesianState
|
CartesianState in TEME frame at the specified epoch |
TopocentricElements
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
right_ascension
|
float
|
TEME right ascension in degrees |
required |
declination
|
float
|
TEME declination in degrees |
required |
declination_rate
instance-attribute
Declination rate in _degrees per second
range
instance-attribute
Range in kilometers
range_rate
instance-attribute
Range rate in kilometers per second
right_ascension_rate
instance-attribute
Right ascension rate in _degrees per second
from_j2000(epoch, ra, dec)
classmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
UTC epoch of the angles |
required |
ra
|
float
|
J2000 right ascension in degrees |
required |
dec
|
float
|
J2000 declination in degrees |
required |
TopocentricState
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch
|
Epoch
|
UTC epoch of the state |
required |
elements
|
TopocentricElements
|
TopocentricElements of the state |
required |
declination
instance-attribute
TEME declination in degrees
declination_rate
instance-attribute
Declination rate in _degrees per second
elements
instance-attribute
Topocentric elements of the state
epoch
instance-attribute
UTC epoch of the state
range
instance-attribute
Range in kilometers
range_rate
instance-attribute
Range rate in kilometers per second
right_ascension
instance-attribute
TEME right ascension in degrees
right_ascension_rate
instance-attribute
Right ascension rate in _degrees per second
from_horizon_state(horizon_state, observer)
classmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizon_state
|
HorizonState
|
HorizonState of the target |
required |
observer
|
Observatory
|
Position of the observer |
required |