Skip to main content

Predict satellite overpasses based on TLE and user location

Project description

SatMarg - Satellite Overpass Predictor

SatMarg = Satellite + Marg (Sanskrit for "path" or "orbit")
Predict satellite overpass times for any location easily and precisely.

About SatMarg

SatMarg is an open source Python package designed to calculate satellite overpass predictions for specific locations and time periods. It uses real-time Two-Line Element (TLE) data to provide precise estimates of when satellites such as SENTINEL-2A, SENTINEL-2B, LANDSAT 8, and others will pass closest to a given latitude and longitude. SatMarg is built to be fast, simple, and customizable, allowing users to adjust processing speed and proximity angle according to their needs. It is ideal for applications such as satellite image planning, ground station scheduling, and general orbital analysis.

Features

  • Fetches real-time TLE data automatically from Celestrak.
  • Predicts precise satellite overpass dates and times for a given latitude and longitude.
  • Supports Sentinel-2A, Sentinel-2B, Sentinel-2C, Landsat 8/9, ISS, and more with TLE data available on Celestrak https://celestrak.org/NORAD/elements/resource.txt, https://celestrak.org/NORAD/elements/stations.txt
  • Allows control of processing speed (slow, medium, fast) to balance between precision and performance.
  • Allows customization of proximity angle detection (default is 0.5 degrees).
  • Lightweight, fast, and easy to use.

Installation

pip install satmarg

Usage

from satmarg.core import get_precise_overpasses

# Basic usage
df = get_precise_overpasses(
    lat=27.7172,   # Kathmandu
    lon=85.3240
)
print(df)

# Advanced usage
df = get_precise_overpasses(
    lat=27.7172,
    lon=85.3240,
    start_date="2025-04-26", 
    end_date="2025-05-27", 
    timezone="Asia/Kathmandu",  #default: "UTC"
    satellites="SENTINEL-2A, SENTINEL-2B, SENTINEL-3A, LANDSAT 8", 
    max_angle_deg="0.7", # one angle for all satellite or custom angles for each eg. "0.7, 0.7, 0.5, 0.7",
    step_seconds=10,   # custom processing speed, default is 1. 
    output_format='json', 
)
print(df)

Parameters

Parameter Description Default
lat Latitude in degrees. Required
lon Longitude in degrees. Required
start_date Start date in 'YYYY-MM-DD' format. Timezone is specified on the parameter below. If not specified, default: UTC Today
end_date End date in 'YYYY-MM-DD' format. Timezone is specified on the parameter below. default: UTC 30 days later
timezone Optional timezone for local time conversion in IANA format (e.g., "Europe/Vienna"). If invalid, defaults to UTC with a warning. Local Time column is included in output only if timezone ≠ UTC. Check Supported Timezones section below. "UTC"
satellites Comma-separated list of satellites (example: "SENTINEL-2A, SENTINEL-2B") - limit 7 satellites. Check supported satellites section below. SENTINEL-2A, SENTINEL-2B
max_angle_deg Maximum distance (in degrees) from overhead to detect an overpass. "0.7" or comma separated values for each satellite (example: "0.5, 0.7, 0.6")
step_seconds Step interval for orbit simulation in seconds. Higher = faster but less precise. 1
output_format Format of the returned overpass results. Options: "json" (default, returns JSON string), "table" (pandas DataFrame), or "csv" (saves results to CSV). "json"

Notes:

  • step_seconds = 1 for slow (high precision) and requires more processing power reduce it to lower values if it is taking too long,
  • step_seconds = 2 for medium,
  • step_seconds = 5 for fast (less precision). Or it can be custom steps like 3 or 7
  • Timezone: When timezone is set, all the input and output dates are in user-defined time zone. "

Output

You can control the output format using the output_format parameter. Available options are:

'json' (default): Returns the overpass results as a JSON string.

'table': Returns the results as a pandas DataFrame.

'csv': Saves the results directly to a CSV file (you can also specify a csv_filename).

Example Output (json)

json [
  {
    "Date":"2026-01-02T22:16:24+05:45",
    "Timezone":"Asia\/Kathmandu",
    "Satellite":"SENTINEL-2B",
    "Lat (DEG)":27.6861089603,
    "Lon (DEG)":85.1511018967,
    "Sat. Azi. (deg)":263.7250417017,
    "Sat. Elev. (deg)":88.7969902437,
    "Range (km)":791.8631112307
  },
  {
    "Date":"2026-01-12T22:16:27+05:45",
    "Timezone":"Asia\/Kathmandu",
    "Satellite":"SENTINEL-2B",
    "Lat (DEG)":27.6401258516,
    "Lon (DEG)":85.1484809155,
    "Sat. Azi. (deg)":245.8365823306,
    "Sat. Elev. (deg)":88.665605964,
    "Range (km)":791.7747502366
  }
]

Example Output (Table)

Date Timezone Satellite Lat (DEG) Lon (DEG) Sat. Azi. (deg) Sat. Elev. (deg) Range (km)
2026-01-02T22:16:24+05:45 Asia/Kathmandu SENTINEL-2B 27.686109 85.151102 263.725042 88.796990 791.863111

Supported Satellites

Supported Timezones

License

GNU GENERAL PUBLIC LICENSE

Acknowledgements

  • Skyfield: Precise astronomical computation library.
  • Celestrak: Satellite TLE data provider.
  • Special thanks to Termatics, Austria for providing the opportunity and support to develop this project.

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

satmarg-0.3.2.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

satmarg-0.3.2-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file satmarg-0.3.2.tar.gz.

File metadata

  • Download URL: satmarg-0.3.2.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for satmarg-0.3.2.tar.gz
Algorithm Hash digest
SHA256 6756b742ddb8305a5a4063287987fb5543b94462161c111464f17f106b80633d
MD5 73d57f71735b783fe144b7ca257a17e9
BLAKE2b-256 73d65abd013573872312323b03d68c94286a9ae0b0aa5d164734fc17f815b549

See more details on using hashes here.

File details

Details for the file satmarg-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: satmarg-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for satmarg-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c75382b349ce641b862cf8d9df29c8ad8b185d42d705fbd2be3e37f3c55b45b
MD5 58602cd8219d4122b852e641d0ba45bc
BLAKE2b-256 b923a1513284acfa46312867f9805c916b8caa4fa467580414b2eb367c126483

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page