danrw.com

C++ SGP4 Satellite Library

SpaceTrack Report No. 3

The original report SpaceTrack Report No. 3, contains the equations and source code used to predict satellite positions.

NORAD maintains general perturbation element sets on all resident space objects. These element sets are periodically refined so as to maintain a reasonable prediction capability on all space objects. These elements provided here, are only effective when used with the models provided by SpaceTrack Report No. 3.

The report contains two models, SGP4 and SDP4 which are implemented within the code. The SGP4 is used for near-earth predictions and SDP4 is used for deep-space.

Revisiting Spacetrack Report #3

In 2006 a report called Revisiting Spacetrack Report #3 was released, which aimed to summarize the corrections/updates made to the original STR#3 code. The code provided here contains all the updates and corrections.

About the library

The library compiles on Linux using g++ and on Windows using Visual Studio. A Makefile for use with Linux is included for ease of compilation.

The provided source contains three sample programs that make use of the library.

Program 1 - RunTest

Runs the tests specified in the SGP4-VER.TLE file. This allows you to compare the prediction results to other implementations.

Sample output

  23177  xx
       0.00000000   -8801.60046706      -0.03357557      -0.44522743   -3.835279101   -7.662552175    0.944561323
     120.00000000   -1684.34352858  -31555.95196340    3888.99944319    2.023055719   -2.151306405    0.265065778
     240.00000000   12325.51410155  -38982.15046244    4802.88832275    1.763224157   -0.102514446    0.012397139
     360.00000000   22773.66831936  -34348.02176606    4228.77407391    1.067616787    1.352427865   -0.166956367
     480.00000000   26194.40441089  -19482.94203672    2393.84774063   -0.313732186    2.808771328   -0.346204118
     600.00000000    8893.50573448    5763.38890561    -713.69884164   -7.037399220    3.022613131   -0.370272416
     720.00000000   -6028.75686537  -25648.99913786    3164.37107274    1.883159288   -3.177051976    0.390793162
     840.00000000    8313.57299056  -38146.45710922    4697.80777535    1.905002133   -0.625883074    0.076098187
     960.00000000   20181.29108622  -36842.60674073    4529.12568218    1.326244476    0.921916487   -0.114527455
    1080.00000000   26302.61794569  -25173.39539436    3084.65309986    0.245398835    2.329974347   -0.287495880
    1200.00000000   19365.07045602   -2700.00490122     317.42727417   -3.009733018    3.902496058   -0.478928582
    1320.00000000   -9667.81878780  -16930.19112642    2095.87469034    1.279288285   -4.736005905    0.582878255
    1440.00000000    4021.31438583  -36066.09209609    4442.91587411    2.007322354   -1.227461376    0.149383897

Program 2 - SatTrack

Shows real time tracking for a satellite, for a given observer (both hard coded). Outputs for each calcultation are:

  1. date/time
  2. azimuth (degrees)
  3. elevation (degrees)
  4. range (km)
  5. range rate (km/s)
  6. latitude of satellite (degrees)
  7. longitude of satellite (degrees)
  8. altitude of satellite (km)

Sample output

2011-06-04 22:51:48.282 UTC Az:   61.67, El:  -16.61, Rng:   4636.98, Rng Rt:   5.52 Lat:   51.51, Lon: -291.08, Alt:    347.16
2011-06-04 22:51:48.326 UTC Az:   61.66, El:  -16.61, Rng:   4637.22, Rng Rt:   5.52 Lat:   51.51, Lon: -291.08, Alt:    347.16
2011-06-04 22:51:48.327 UTC Az:   61.66, El:  -16.61, Rng:   4637.22, Rng Rt:   5.52 Lat:   51.51, Lon: -291.08, Alt:    347.16

Program 3 - PassPredict

Finds the Acquisition of signal (AOS) and Loss of signal (LOS) for a satellite given an observers location.

Sample output (time period of 10 days):

AOS: 2011-06-08 18:23:56.098 UTC, LOS: 2011-06-09 02:05:34.534 UTC, Max El: 76.8144
AOS: 2011-06-09 10:40:20.470 UTC, LOS: 2011-06-09 14:17:13.907 UTC, Max El: 17.7939
AOS: 2011-06-09 23:27:36.405 UTC, LOS: 2011-06-10 06:48:10.153 UTC, Max El: 70.1256
AOS: 2011-06-10 13:22:38.277 UTC, LOS: 2011-06-10 18:28:56.088 UTC, Max El: 34.8265
AOS: 2011-06-11 04:48:14.836 UTC, LOS: 2011-06-11 10:08:16.710 UTC, Max El: 37.9699
AOS: 2011-06-11 16:34:20.458 UTC, LOS: 2011-06-11 23:44:20.457 UTC, Max El: 66.9081
AOS: 2011-06-12 09:08:22.330 UTC, LOS: 2011-06-12 12:48:57.954 UTC, Max El: 18.3927
AOS: 2011-06-12 21:07:53.265 UTC, LOS: 2011-06-13 04:54:48.576 UTC, Max El: 78.5986
AOS: 2011-06-13 12:08:22.324 UTC, LOS: 2011-06-13 16:28:44.823 UTC, Max El: 25.3878
AOS: 2011-06-14 02:35:47.633 UTC, LOS: 2011-06-14 08:46:02.632 UTC, Max El: 50.3295
AOS: 2011-06-14 14:57:33.568 UTC, LOS: 2011-06-14 21:22:42.004 UTC, Max El: 54.2275
AOS: 2011-06-15 07:22:46.690 UTC, LOS: 2011-06-15 11:31:13.876 UTC, Max El: 23.1914
AOS: 2011-06-15 18:58:12.937 UTC, LOS: 2011-06-16 02:48:45.748 UTC, Max El: 79.8503
AOS: 2011-06-16 10:52:38.246 UTC, LOS: 2011-06-16 14:39:25.120 UTC, Max El: 19.4033
AOS: 2011-06-17 00:15:23.243 UTC, LOS: 2011-06-17 07:12:45.742 UTC, Max El: 63.2552
AOS: 2011-06-17 13:32:30.741 UTC, LOS: 2011-06-17 19:07:47.614 UTC, Max El: 41.5019
AOS: 2011-06-18 05:25:32.612 UTC, LOS: 2011-06-18 10:17:09.174 UTC, Max El: 31.6828

The source code

Find the source on github at https://github.com/dnwrnr/sgp4