Satellite orbit tools: TLE propagation, SP3 parsing, and coordinate transformations
Project description
satorbit
Satellite orbit tools for Python: TLE propagation, SP3 parsing, and coordinate transformations.
Originally developed at KNMI (Royal Netherlands Meteorological Institute) as part of swxtools.
Installation
pip install satorbit
Features
- TLE handling: Query space-track.org, parse TLE data, and propagate orbits using SGP4
- SP3 parsing: Read SP3 precise orbit files into pandas DataFrames
- Coordinate transforms: Convert between ITRF, geodetic, GCRS, and Quasi-Dipole coordinates
- Orbit interpolation: High-accuracy 7th-order Lagrange interpolation with automatic handling of geodetic, magnetic, and solar angle coordinates
- Keplerian mechanics: Simulate orbits with J2 perturbation effects
Usage
TLE Propagation
import pandas as pd
from satorbit import geodetic_orbit_from_tle
# Generate orbit positions for a satellite over a time range
times = pd.date_range("2024-01-01", "2024-01-02", freq="1min")
orbit = geodetic_orbit_from_tle(norad_id=25544, times=times) # ISS
print(orbit[['lat', 'lon', 'height']])
SP3 File Parsing
from satorbit import sp3_to_itrf_df
df = sp3_to_itrf_df("orbit.sp3")
print(df[['x_itrf', 'y_itrf', 'z_itrf']])
Coordinate Transformations
from satorbit import itrf_to_geodetic, geodetic_to_qd
# Convert ITRF to geodetic coordinates
df_geo = itrf_to_geodetic(df_orbit)
# Convert to Quasi-Dipole magnetic coordinates
df_qd = geodetic_to_qd(df_geo)
Orbit Interpolation
from satorbit import interpolate_orbit_to_datetimeindex
# Interpolate an orbit DataFrame to new timestamps
# Works with ITRF, geodetic, quasi-dipole, MLT, and solar angle columns
new_times = pd.date_range("2024-01-01", "2024-01-02", freq="1s")
df_interpolated = interpolate_orbit_to_datetimeindex(df_orbit, new_times)
Spherical and angular columns (lon, lat, height, lat_qd, lon_qd, mlt, solar_elevation, solar_azimuth) are automatically converted to Cartesian representation before interpolation, avoiding singularities at the antimeridian and poles. This allows expensive coordinate transformations to be computed once at coarse cadence and then accurately interpolated to any timestamp.
Keplerian Orbit Simulation
import numpy as np
from satorbit import simulate_orbit, unperturbed_orbitalperiod
kepler = {
"semimajoraxis": 7000, # km
"eccentricity": 0.001,
"inclination": np.radians(98),
"argumentofperigee": np.radians(90),
"raan": np.radians(0),
"initial_mean_anomaly": 0,
"mu": 398600.4415,
"re": 6378.1363,
"j2": 1082.6357e-6
}
period = unperturbed_orbitalperiod(kepler)
times = np.linspace(0, period, 100)
orbit = simulate_orbit(kepler, times)
Configuration
For TLE queries from space-track.org, create ~/.spacetrackorg.txt:
[default]
username = your_username
password = your_password
License
Apache License 2.0 - see LICENSE
Acknowledgements
Developed with support from ESA through the Swarm Data Innovation and Science Cluster (Swarm DISC).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file satorbit-0.2.1.tar.gz.
File metadata
- Download URL: satorbit-0.2.1.tar.gz
- Upload date:
- Size: 106.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a32d1fff4b7f4990270552d0ffe8635b3a21d4aef1e573d5df5b30af99e7648
|
|
| MD5 |
56593cf195b68cc743b552c720851af9
|
|
| BLAKE2b-256 |
048f360b5adcc878d10fbf2e9d2a9fb702199e045b84bb4532bcd0dab8b6e58a
|
File details
Details for the file satorbit-0.2.1-py3-none-any.whl.
File metadata
- Download URL: satorbit-0.2.1-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0875346df28ca76763e05f8b963458d8dd5c3b2062998e7e28fa1ace1f70e8b
|
|
| MD5 |
14fa4cd54f16efc4cfd43517077cd2db
|
|
| BLAKE2b-256 |
c78807675d7f8eca484bf6ff53cdfb88d1b9c258392b958bd3f4913c5c16e250
|