Skip to content

Satellite State

A satellite state at an epoch: position (m) and velocity (m/s) in the GCRF, with an optional 6×6 covariance and scheduled maneuvers, and a propagate() method that carries all of them forward with the numerical propagator. Background: State Vectors, STM & Covariance and Maneuver Coordinate Frames. Tutorials: Covariance Propagation and Orbit Maneuvers.

satstate

Satellite state: position, velocity, optional covariance, and maneuvers

Bundles a GCRF position/velocity with optional 6x6 covariance and a list of impulsive maneuvers into a single propagatable object. Use satstate instead of the free propagate function when you need:

  • Covariance propagation -- attach uncertainty and it propagates automatically via the state transition matrix.
  • Maneuver scheduling -- add impulsive delta-v events at future times; propagation segments around them automatically.
  • Round-trip propagation -- propagate forward then backward, recovering the original state (maneuvers are reversed).

For simple state-vector propagation without covariance or maneuvers, propagate is more direct.

This class supports pickle serialization (all fields including covariance and maneuvers are preserved).

Example
import satkit as sk
import numpy as np

# Create state at 500 km altitude
r = sk.consts.earth_radius + 500e3
v = np.sqrt(sk.consts.mu_earth / r)
sat = sk.satstate(sk.time(2024, 1, 1), np.array([r, 0, 0]), np.array([0, v, 0]))

# Add covariance and maneuver
sat.set_pos_uncertainty(np.array([50.0, 200.0, 100.0]), frame=sk.frame.RTN)
sat.add_prograde(sat.time + sk.duration.from_hours(1), 10.0)

# Propagate -- covariance and maneuver handled automatically
new_state = sat.propagate(sat.time + sk.duration.from_hours(3))

pos property

Position in meters, GCRF frame (alias for pos_gcrf)

vel property

Velocity in m/s, GCRF frame (alias for vel_gcrf)

pos_gcrf property

Position in meters, GCRF frame

vel_gcrf property

Velocity in m/s, GCRF frame

qgcrf2lvlh property

Quaternion rotating from GCRF to the LVLH frame for the current state

LVLH frame
  • z axis: -r (nadir, pointing toward Earth center)
  • y axis: -h (opposite orbital angular momentum, h = r x v)
  • x axis: completes right-handed system

cov property writable

6x6 state covariance matrix in GCRF, or None if not set

Element [i, j] is the covariance of elements i and j of the state [x, y, z, vx, vy, vz]: the upper-left 3x3 block is the position covariance (m^2), the lower-right 3x3 the velocity covariance ((m/s)^2), and the off-diagonal blocks the position-velocity cross-covariance (m^2/s).

The getter returns a new array on every access, holding exactly what was assigned (or what propagate computed, Phi @ cov @ Phi.T), so modifying the returned array does not change the state: assign a matrix to set the covariance, or None to remove it.

Raises:

Type Description
ValueError

on assignment, if the matrix is not 6x6 or not symmetric

TypeError

on assignment, if the value is not a real numeric array-like or None

time property

Epoch of this satellite state

num_maneuvers property

Number of impulsive maneuvers scheduled on this state

maneuvers property

The scheduled impulsive maneuvers, in the order they were added.

A copy: a new list of new dicts on every access, so changing it (or a dict in it) does not change the state. To add a maneuver use add_maneuver (or add_prograde, add_retrograde, add_radial, add_normal); to remove them use clear_maneuvers. To remove or change only some, clear them and add back the ones to keep, e.g. for m in kept: state.add_maneuver(**m).

Returns:

Type Description
list[dict]

One dict per maneuver with keys "time" (satkit.time), "delta_v" (3-element numpy array, m/s, in "frame"), and "frame" (satkit.frame)

__init__(time, pos, vel, cov=None)

Create a new satellite state

Parameters:

Name Type Description Default
time time | datetime | datetime64

Epoch of the state

required
pos array - like

3-element position in meters, GCRF frame

required
vel array - like

3-element velocity in m/s, GCRF frame

required
cov array - like | None

symmetric 6x6 covariance matrix in GCRF (position block m^2, velocity block (m/s)^2, cross blocks m^2/s). Defaults to None.

None

Raises:

Type Description
TypeError

if time is not a time, or pos, vel or cov is not a real numeric array-like

ValueError

if pos or vel does not have 3 elements, or cov is not a symmetric 6x6 matrix

Example
t = satkit.time(2024, 1, 1)
pos = np.array([6.781e6, 0, 0])       # meters, GCRF
vel = np.array([0, 7.5e3, 0])          # m/s, GCRF
state = satkit.satstate(t, pos, vel)

from_kepler(time, kepler) staticmethod

Create a state from Keplerian elements

The two-body position (meters) and velocity (m/s) of the elements (kepler.to_pv()) are taken as GCRF at time; no covariance, no maneuvers. The elements are treated as osculating GCRF elements, so kepler.mu should be Earth's.

Parameters:

Name Type Description Default
time time

Epoch of the state

required
kepler kepler

Osculating Keplerian elements

required

Returns:

Type Description
satstate

state at time

Example
import math
k = satkit.kepler(7000e3, 0.001, math.radians(98), 0, 0, 0)
state = satkit.satstate.from_kepler(satkit.time(2024, 1, 1), k)

set_pos_uncertainty(sigma, frame)

Set 1-sigma position uncertainty in a satellite-local or inertial frame.

Constructs a diagonal 3x3 covariance from the given 1-sigma values (interpreted along the frame's axes), rotates it into GCRF, and stores it as the position block of the 6x6 state covariance. Any existing velocity covariance is preserved; the position-velocity cross blocks are cleared.

Parameters:

Name Type Description Default
sigma ArrayLike

3-element array-like of 1-sigma position components along the frame's axes. Units: meters.

required
frame frame

Coordinate frame — required, no default (matching the Rust API). Supported values:

  • frame.GCRF — inertial Cartesian
  • frame.RTN — Radial / Transverse / Normal (= RSW = RIC); R exactly along position. CCSDS OEM / CDM convention.
  • frame.NTW — Normal-to-velocity / Tangent / Cross-track; T exactly along velocity.
  • frame.LVLH — Local Vertical / Local Horizontal (RTN axes relabeled: x = T, y = -N, z = -R)
required

Raises:

Type Description
ValueError

if sigma does not have 3 elements, or the frame is not one of the supported frames.

TypeError

if sigma is not a real numeric array-like

Example
# RTN: 10 m radial, 200 m transverse, 30 m normal
sat.set_pos_uncertainty(np.array([10.0, 200.0, 30.0]), frame=sk.frame.RTN)

# NTW: 10 m normal-to-velocity, 200 m along velocity, 30 m cross-track
sat.set_pos_uncertainty(np.array([10.0, 200.0, 30.0]), frame=sk.frame.NTW)

set_vel_uncertainty(sigma, frame)

Set 1-sigma velocity uncertainty in a satellite-local or inertial frame.

Analogous to set_pos_uncertainty, but for the velocity block of the 6x6 state covariance. Any existing position covariance is preserved; the position-velocity cross blocks are cleared.

Parameters:

Name Type Description Default
sigma ArrayLike

3-element array-like of 1-sigma velocity components along the frame's axes. Units: m/s.

required
frame frame

Coordinate frame — required, no default (matching the Rust API). Supported values: frame.GCRF, frame.RTN, frame.NTW, frame.LVLH.

required

Raises:

Type Description
ValueError

if sigma does not have 3 elements, or the frame is not one of the supported frames.

TypeError

if sigma is not a real numeric array-like

add_maneuver(time, delta_v, frame)

Add an impulsive maneuver (instantaneous delta-v)

Parameters:

Name Type Description Default
time time | datetime | datetime64

Time at which to apply the maneuver

required
delta_v array - like

3-element delta-v vector [m/s]

required
frame frame

Coordinate frame — required, no default (matching the Rust API). Supported frames:

  • frame.GCRF — inertial Cartesian
  • frame.RTN — radial / in-track / cross-track (a.k.a. RSW, RIC). The I axis is perpendicular to R in the orbit plane — for eccentric orbits this is not strictly along velocity.
  • frame.NTW — normal-to-velocity / tangent / cross-track. The T axis is along velocity, so a pure +T burn of magnitude Δv adds exactly Δv to |v|. Preferred for prograde burns on eccentric orbits.
  • frame.LVLH — Local Vertical / Local Horizontal (classical crewed-spaceflight frame with z=nadir, y=-h, x=forward). Geometrically equivalent to RIC with relabeled axes; useful when porting GN&C code written in LVLH conventions.

See the "Theory: Maneuver Coordinate Frames" guide in the satkit documentation for a side-by-side comparison.

required

Raises:

Type Description
ValueError

if delta_v does not have 3 elements, or frame is not one of the four above (an Earth-fixed or other inertial frame is refused here, not later by propagate)

TypeError

if time is not a time, or delta_v is not numeric

See Also

add_prograde, add_retrograde, add_radial, add_normal for scalar-magnitude helpers that pick the frame for you.

Example
# Explicit frame selection
sat.add_maneuver(t_burn, [0, 10, 0], frame=sk.frame.NTW)  # +10 m/s along velocity
sat.add_maneuver(t_burn, [0, 10, 0], frame=sk.frame.RTN)  # +10 m/s in RIC in-track

add_prograde(time, dv_mps)

Add a prograde impulsive burn (NTW +T, along velocity).

A positive dv_mps adds energy (raises semi-major axis). The burn adds exactly dv_mps to |v| regardless of orbit eccentricity.

Parameters:

Name Type Description Default
time time

Time at which to apply the burn

required
dv_mps float

Magnitude along velocity vector [m/s]

required
Example
sat.add_prograde(t_burn, 10.0)  # +10 m/s along velocity

add_retrograde(time, dv_mps)

Add a retrograde impulsive burn (NTW -T, opposite velocity).

Equivalent to add_prograde with a negated magnitude. dv_mps should be positive; a positive value removes energy from the orbit.

Parameters:

Name Type Description Default
time time

Time at which to apply the burn

required
dv_mps float

Magnitude along anti-velocity vector [m/s]

required

add_radial(time, dv_mps)

Add a radial-outward impulsive burn (NTW +N axis).

For circular orbits this is the outward radial direction. For eccentric orbits the N axis leans off the radial by the flight-path angle.

Parameters:

Name Type Description Default
time time

Time at which to apply the burn

required
dv_mps float

Magnitude along in-plane normal-to-velocity [m/s]

required

add_normal(time, dv_mps)

Add a cross-track ("normal") impulsive burn (NTW +W axis).

Positive values push in the +angular-momentum direction. Changes orbit inclination without altering energy (at apsides).

Parameters:

Name Type Description Default
time time

Time at which to apply the burn

required
dv_mps float

Magnitude along angular momentum direction [m/s]

required

clear_maneuvers()

Remove every scheduled maneuver from this state

Example
sat = sk.satstate(sk.time(2024, 1, 1), np.array([6.781e6, 0, 0]), np.array([0, 7.5e3, 0]))
sat.add_prograde(sat.time + sk.duration(hours=1), 10.0)
sat.clear_maneuvers()
assert sat.num_maneuvers == 0

propagate(timedur, *, propsettings=None, satproperties=None)

Propagate this state to a new time

If covariance is set, it is propagated via the state transition matrix. If maneuvers are scheduled between the current and target time, propagation automatically segments at each maneuver epoch and applies the delta-v (subtracts it when propagating backward). A maneuver at time t is applied when start <= t < target (target <= t < start backward): the state at a maneuver's own time is the state just before the burn, so a maneuver at the current time is applied and one exactly at the target time is not. Maneuvers are preserved on the returned state.

Parameters:

Name Type Description Default
timedur time | datetime | datetime64 | duration | timedelta | float

Target time, or duration from the current time: a satkit.duration, a datetime.timedelta (converted exactly) or a number of seconds (as for satkit.propagate(duration=))

required
propsettings propsettings

Propagation settings. Default: propsettings()

None
satproperties satproperties

Satellite properties (drag, SRP, thrust)

None

Returns:

Type Description
satstate

New state at the target time

Raises:

Type Description
TypeError

if timedur is not a time or a duration, or propsettings / satproperties has the wrong type

ValueError

if the position is all zeros, or timedur is a NaN or infinite number of seconds

RuntimeError

if the propagation fails (see satkit.propagate). A covariance needs the state transition matrix, which integrator.rodas4 and integrator.gauss_jackson8 cannot propagate

Example
sat = sk.satstate(time=t0, pos=r, vel=v)
sat.add_maneuver(t_burn, [0, 100, 0], frame=sk.frame.RTN)
new_state = sat.propagate(t_end)