Predict upcoming satellite overpasses


Keywords
iss, predict, orbit, sgp4, satellite
License
MIT
Install
pip install passpredict==0.5.1

Documentation

passpredict

Tests

Predict upcoming satellite overpasses over a point on Earth.

This library exposes a command-line interface and a Python API to generate overpass predictions.

Requirements

  • python >= 3.8
  • numpy >= 1.22
  • scipy
  • cython >= 0.29.24
  • orbit-predictor
  • click
  • rich
  • httpx
  • timezonefinder
  • tzdata (Windows only)
  • backports.zoneinfo (Python 3.8 only)

Install

The package and command line tool can be installed from PyPI using pip.

pip install passpredict

If you intend to use the package as a command line tool, it is a good idea to install the package with its dependencies using pipx.

pipx install passpredict

Quick Start

Overpass predictions are generated by combining a TLE source, topographic location, satellite propagator, and observer algorithm.

In this example, we are generating a list of pass predictions for the International Space Station over Austin, Texas, for 10 days. It automatically downloads the latest TLE from Celestrak.

import datetime
try:
    from zoneinfo import ZoneInfo
except ImportError:
    from backports.zoneinfo import ZoneInfo

from passpredict import CelestrakTLESource, Location, SGP4Propagator, Observer

location = Location('Austin, TX', 30.2711, -97.7437, 0)
date_start = datetime.datetime.now(tz=ZoneInfo('America/Chicago'))
date_end = date_start + datetime.timedelta(days=10)
source = CelestrakTLESource()
tle = source.get_tle(25544)  # International space station, Norad ID 25544
satellite = SGP4Propagator.from_tle(tle)
observer = Observer(location, satellite)
overpasses = observer.pass_list(date_start, limit_date=date_end)

Command Line Usage

The command line output is generated using Rich tables.

Predict upcoming visible overpasses of the International Space Station. The location is entered using decimal coordinates, with positive values East and North.

  • International Space Station (ID 25544)
  • Location: 30.2711Β° N, 97.1234Β° W
  • Visible passes only
  • Compute passes for 10 days
$ passpredict -lat 30.2711 -lon -97.1234 -s 25544 --days 10
Computing overpasses for 1 satellites over 10 days...
Satellite ID 25544 ISS (ZARYA) overpasses
Lat=30.2711Β°, Lon=-97.1234Β°, Timezone America/Chicago
Using TLE with epoch 2022-01-28T20:31:51.927167+00:00
1 25544U 98067A   22028.85546212  .00007118  00000+0  13400-3 0  9994
2 25544  51.6447 306.5909 0006818  72.1061  40.7231 15.49683806323578

┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━┓
┃         ┃                   ┃  Start   ┃ Sta… ┃ Sta… ┃    Max   ┃ Max  ┃ Max  ┃    End   ┃ End  ┃ End  ┃         ┃
┃  Date   ┃     Satellite     ┃   Time   ┃   El ┃   Az ┃   Time   ┃  El  ┃  Az  ┃   Time   ┃  El  ┃  Az  ┃  Type   ┃
┑━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━┩
β”‚ 2/02/22 β”‚ 25544 ISS (ZARYA) β”‚ 19:56:06 β”‚  10Β° β”‚  NNW β”‚ 19:59:14 β”‚  37Β° β”‚   NE β”‚ 20:02:22 β”‚  10Β° β”‚  ESE β”‚ visible β”‚
β”‚ 2/03/22 β”‚ 25544 ISS (ZARYA) β”‚ 19:08:22 β”‚  10Β° β”‚  NNW β”‚ 19:10:59 β”‚  21Β° β”‚   NE β”‚ 19:13:37 β”‚  10Β° β”‚    E β”‚ visible β”‚
β”‚ 2/04/22 β”‚ 25544 ISS (ZARYA) β”‚ 19:56:23 β”‚  10Β° β”‚   NW β”‚ 19:59:36 β”‚  50Β° β”‚   SW β”‚ 20:02:51 β”‚  10Β° β”‚  SSE β”‚ visible β”‚
β”‚ 2/05/22 β”‚ 25544 ISS (ZARYA) β”‚ 19:08:09 β”‚  10Β° β”‚   NW β”‚ 19:11:28 β”‚  73Β° β”‚   NE β”‚ 19:14:46 β”‚  10Β° β”‚   SE β”‚ visible β”‚
β”‚ 2/06/22 β”‚ 25544 ISS (ZARYA) β”‚ 19:58:00 β”‚  10Β° β”‚    W β”‚ 19:59:42 β”‚  13Β° β”‚   SW β”‚ 20:01:27 β”‚  10Β° β”‚  SSW β”‚ visible β”‚
β”‚ 2/07/22 β”‚ 25544 ISS (ZARYA) β”‚ 19:08:49 β”‚  10Β° β”‚  WNW β”‚ 19:11:39 β”‚  26Β° β”‚   SW β”‚ 19:14:29 β”‚  10Β° β”‚    S β”‚ visible β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Use geocoding to designate a location and find overpasses for all satellites on Celestrak's visual satellite list. Compute visual passes for 1 day.

$ passpredict --location "Austin, Texas" --category visual --days 1
Computing overpasses for 163 satellites over 1 days...
for Austin, Travis County, Texas, 78701, United States
Lat=30.2711Β°, Lon=-97.7437Β°, Timezone America/Chicago

┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━┓
┃         ┃                          ┃  Start   ┃ Sta… ┃ Sta… ┃    Max   ┃ Max  ┃ Max  ┃    End   ┃ End  ┃ End  ┃         ┃
┃  Date   ┃        Satellite         ┃   Time   ┃   El ┃   Az ┃   Time   ┃  El  ┃  Az  ┃   Time   ┃  El  ┃  Az  ┃  Type   ┃
┑━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━┩
β”‚ 1/30/22 β”‚ 15354 ERBS               β”‚ 18:26:34 β”‚  10Β° β”‚  WSW β”‚ 18:29:28 β”‚  33Β° β”‚   NW β”‚ 18:32:24 β”‚  10Β° β”‚  NNE β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 694 ATLAS CENTAUR 2      β”‚ 18:27:28 β”‚  10Β° β”‚  WSW β”‚ 18:30:13 β”‚  11Β° β”‚   SW β”‚ 18:32:52 β”‚  10Β° β”‚  SSW β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 13552 COSMOS 1408        β”‚ 18:29:20 β”‚  10Β° β”‚   SE β”‚ 18:32:06 β”‚  20Β° β”‚    E β”‚ 18:34:55 β”‚  10Β° β”‚   NE β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 19046 SL-3 R/B           β”‚ 18:32:35 β”‚  10Β° β”‚  SSW β”‚ 18:35:48 β”‚  25Β° β”‚    W β”‚ 18:39:04 β”‚  10Β° β”‚   NW β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 5730 SL-8 R/B            β”‚ 18:32:38 β”‚  10Β° β”‚   SW β”‚ 18:37:48 β”‚  43Β° β”‚  WNW β”‚ 18:44:29 β”‚  10Β° β”‚    N β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 43600 AEOLUS             β”‚ 18:35:43 β”‚  10Β° β”‚  SSW β”‚ 18:37:46 β”‚  22Β° β”‚    W β”‚ 18:39:52 β”‚  10Β° β”‚   NW β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 14032 COSMOS 1455        β”‚ 18:38:17 β”‚  10Β° β”‚   NW β”‚ 18:41:10 β”‚  21Β° β”‚    W β”‚ 18:44:03 β”‚  10Β° β”‚   SW β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 28932 H-2A R/B           β”‚ 18:38:46 β”‚  10Β° β”‚    E β”‚ 18:40:21 β”‚  11Β° β”‚  ENE β”‚ 18:41:56 β”‚  10Β° β”‚   NE β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 16182 SL-16 R/B          β”‚ 18:42:16 β”‚  10Β° β”‚  ESE β”‚ 18:43:35 β”‚  10Β° β”‚    E β”‚ 18:44:56 β”‚  10Β° β”‚    E β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 16792 SL-14 R/B          β”‚ 18:42:17 β”‚  10Β° β”‚   SE β”‚ 18:45:20 β”‚  18Β° β”‚    E β”‚ 18:48:24 β”‚  10Β° β”‚   NE β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 48274 TIANHE             β”‚ 18:42:45 β”‚  10Β° β”‚   NW β”‚ 18:44:47 β”‚  15Β° β”‚  NNW β”‚ 18:46:51 β”‚  10Β° β”‚  NNE β”‚ visible β”‚
β”‚ 1/30/22 β”‚ 25977 HELIOS 1B          β”‚ 18:43:24 β”‚  10Β° β”‚  NNE β”‚ 18:47:43 β”‚  88Β° β”‚  ENE β”‚ 18:52:03 β”‚  10Β° β”‚  SSW β”‚ visible β”‚

...

Compute all overpasses for amateur radio satellites for 1 day

$ passpredict --location "Austin, Texas" --category amateur --days 1 --all
Computing overpasses for 90 satellites over 1 days...
for Austin, Travis County, Texas, 78701, United States
Lat=30.2711Β°, Lon=-97.7437Β°, Timezone America/Chicago

┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━━━━━┓
┃         ┃                                ┃  Start   ┃ Sta… ┃ Sta… ┃    Max   ┃ Max  ┃ Max  ┃    End   ┃ End  ┃ End  ┃          ┃
┃  Date   ┃           Satellite            ┃   Time   ┃   El ┃   Az ┃   Time   ┃  El  ┃  Az  ┃   Time   ┃  El  ┃  Az  ┃   Type   ┃
┑━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━━━━━┩
β”‚ 1/30/22 β”‚ 43880 UWE-4                    β”‚ 10:59:40 β”‚  10Β° β”‚   SE β”‚ 11:03:22 β”‚  36Β° β”‚  ENE β”‚ 11:07:07 β”‚  10Β° β”‚    N β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 44854 DUCHIFAT-3               β”‚ 11:03:03 β”‚  10Β° β”‚  WNW β”‚ 11:06:55 β”‚  32Β° β”‚    N β”‚ 11:10:48 β”‚  10Β° β”‚  ENE β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 43786 ITASAT 1                 β”‚ 11:04:01 β”‚  10Β° β”‚    N β”‚ 11:08:05 β”‚  59Β° β”‚  WNW β”‚ 11:12:10 β”‚  10Β° β”‚  SSW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 41847 CAS-2T & KS-1Q           β”‚ 11:05:22 β”‚  10Β° β”‚    N β”‚ 11:10:48 β”‚  38Β° β”‚  WNW β”‚ 11:15:39 β”‚  10Β° β”‚   SW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 43137 FOX-1D (AO-92)           β”‚ 11:20:27 β”‚  10Β° β”‚    N β”‚ 11:23:59 β”‚  71Β° β”‚  WNW β”‚ 11:27:31 β”‚  10Β° β”‚  SSW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 43017 RADFXSAT (FOX-1B)        β”‚ 11:31:26 β”‚  10Β° β”‚  SSW β”‚ 11:35:21 β”‚  30Β° β”‚    W β”‚ 11:39:40 β”‚  10Β° β”‚   NW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 46839 BY70-3                   β”‚ 11:38:01 β”‚  10Β° β”‚  NNW β”‚ 11:40:55 β”‚  26Β° β”‚  WNW β”‚ 11:43:49 β”‚  10Β° β”‚   SW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 42017 NAYIF-1 (EO-88)          β”‚ 11:38:05 β”‚  10Β° β”‚   NW β”‚ 11:39:56 β”‚  13Β° β”‚  WNW β”‚ 11:41:48 β”‚  10Β° β”‚  WSW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 39134 SOMP                     β”‚ 11:46:15 β”‚  10Β° β”‚  NNE β”‚ 11:48:14 β”‚  13Β° β”‚   NE β”‚ 11:50:12 β”‚  10Β° β”‚    E β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 44909 RS-44 & BREEZE-KM R/B    β”‚ 11:59:02 β”‚  10Β° β”‚   SE β”‚ 12:04:24 β”‚  19Β° β”‚    E β”‚ 12:10:00 β”‚  10Β° β”‚   NE β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 50466 XW-3 (CAS-9)             β”‚ 11:59:32 β”‚  10Β° β”‚    N β”‚ 12:04:00 β”‚  32Β° β”‚  WNW β”‚ 12:08:28 β”‚  10Β° β”‚   SW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 47963 DIY-1 (ARDUIQUBE)        β”‚ 12:09:51 β”‚  10Β° β”‚  WSW β”‚ 12:11:40 β”‚  12Β° β”‚    W β”‚ 12:13:31 β”‚  10Β° β”‚  WNW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 45857 BY70-2                   β”‚ 12:10:17 β”‚  10Β° β”‚  NNW β”‚ 12:13:44 β”‚  23Β° β”‚  WNW β”‚ 12:17:11 β”‚  10Β° β”‚  WSW β”‚ daylight β”‚
β”‚ 1/30/22 β”‚ 32953 YUBILEINY (RS-30)        β”‚ 12:14:52 β”‚  10Β° β”‚    W β”‚ 12:16:44 β”‚  10Β° β”‚  WNW β”‚ 12:18:39 β”‚  10Β° β”‚   NW β”‚ daylight β”‚

...

Compute all overpasses for two satellites over two days. Display summary table of results.

  • Location: "Austin, Texas"
  • Satellites: International Space Staion (25544), Hubble Space Telescope (20580)
  • All overpass types
  • 2 days
  • Display summary table of results
$ passpredict --location "Austin, Texas" --satid 25544 --satid 20580 --days 2 --all --summary
Computing overpasses for 2 satellites over 2 days...
for Austin, Travis County, Texas, 78701, United States
Lat=30.2711Β°, Lon=-97.7437Β°, Timezone America/Chicago

┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓
┃      Date      ┃     Satellite     ┃ Duration ┃ Max Elev ┃   Type   ┃
┑━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩
β”‚ 1/30/22  12:35 β”‚ 25544 ISS (ZARYA) β”‚     4:58 β”‚      19Β° β”‚ daylight β”‚
β”‚ 1/30/22  14:11 β”‚ 25544 ISS (ZARYA) β”‚     5:40 β”‚      25Β° β”‚ daylight β”‚
β”‚ 1/30/22  18:50 β”‚ 20580 HST         β”‚     6:52 β”‚      25Β° β”‚ visible  β”‚
β”‚ 1/30/22  20:30 β”‚ 20580 HST         β”‚     8:05 β”‚      58Β° β”‚ visible  β”‚
β”‚ 1/30/22  20:44 β”‚ 25544 ISS (ZARYA) β”‚     5:16 β”‚      21Β° β”‚  unlit   β”‚
β”‚ 1/30/22  22:11 β”‚ 20580 HST         β”‚     8:10 β”‚      66Β° β”‚  unlit   β”‚
β”‚ 1/30/22  22:21 β”‚ 25544 ISS (ZARYA) β”‚     5:34 β”‚      24Β° β”‚  unlit   β”‚
β”‚ 1/30/22  23:53 β”‚ 20580 HST         β”‚     7:34 β”‚      35Β° β”‚  unlit   β”‚
β”‚ 1/31/22  01:36 β”‚ 20580 HST         β”‚     3:07 β”‚      11Β° β”‚  unlit   β”‚
β”‚ 1/31/22  13:22 β”‚ 25544 ISS (ZARYA) β”‚     6:27 β”‚      47Β° β”‚ daylight β”‚
β”‚ 1/31/22  18:39 β”‚ 20580 HST         β”‚     7:17 β”‚      30Β° β”‚ visible  β”‚
β”‚ 1/31/22  19:57 β”‚ 25544 ISS (ZARYA) β”‚     3:18 β”‚      13Β° β”‚  unlit   β”‚
β”‚ 1/31/22  20:19 β”‚ 20580 HST         β”‚     8:08 β”‚      63Β° β”‚ visible  β”‚
β”‚ 1/31/22  21:32 β”‚ 25544 ISS (ZARYA) β”‚     6:29 β”‚      51Β° β”‚  unlit   β”‚
β”‚ 1/31/22  22:00 β”‚ 20580 HST         β”‚     8:08 β”‚      62Β° β”‚  unlit   β”‚
β”‚ 1/31/22  23:42 β”‚ 20580 HST         β”‚     7:15 β”‚      30Β° β”‚  unlit   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Changelog

0.5.0 (2022-03-24)

Changes in structure of core classes:

  • begin adding functions and methods to use mjd instead of jd
  • Standardize Observer methods. Use method() to accept datetime objects, _method_mjd() to accept mjd time objects
  • Change SGP4Predictor to SGP4Propagator
  • Update satellite propagator methods to correspond to Observer methods
  • Update tests and benchmarks with new class names and methods
  • Remove orbit predictor Location class as inherited base class
  • Create new Orbit class that can be initialized from a TLE.
  • Refactor the SGP4Propagator to not call a source class directly. Instead initialize from Orbit or TLE object
  • Create tests to ensure that SGP4 satrec propagator is created correctly from TLE object

Changes to pass iterators:

  • Change Observer pass iterator algorithms to callable methods rather than subclassing Observer()
  • Use MJD instead of JD in pass iterators. Update propagation and coordinate transformations to use MJD.
  • Update tests to use new observer pass iterator methods
  • move visual pass detail computation to separate function
  • Performance boost: orbit_predictor pass iterator is now 1.2x faster

Misc:

  • Remove old core.py functions. These can now be easily replicated with the current api
  • Enforce mjd2datetime to always use microseconds.
  • Rename satellite modules to sgp4.py and kepler.py

0.4.0 (2022-02-18)

  • Add tests for visual overpass for Cape Town and Envisat
  • Remove requirements files, specify optional dependencies in setup.py
  • Add Observer.pass_list() method to directly return a list of overpass objects
  • Remove zoneinfo.py and replace with standard importerror checking in each necessary file
  • Refactor cache objects
  • Add better help text to CLI
  • Add tests to confirm that CLI works without arguments
  • Update Celestrak source to use new GP url

0.3.0 (2022-01-30)

  • Query multiple satellites and satellite categories from CLI
  • Specify MIT license for package

0.2.2 (2022-01-22)

  • Use Satellogic's orbit-predictor library as the basis for prediction algorithm, coordinate transformations, locations, propagators, and tle sources. The algorithms are supplemented with custom Cython functions and IAU SOFA routines for speed. Remove unused custom cpp code for now.
  • Improve test suite by adding observation tests using a new brute force observer class to compute predicted passes. Validate visual passes against Heaven's Above.
  • Improve the CLI output using rich tables.
  • Add visibility type enum to pass points