README.md

Re:SGP4 python package!

ReSGP4 is SGP4/SDP4 satellite motion model.

It is based on original David Vallado C++ source code which is the reference implementation of SGP4 and SDP4 models.

See:

The original Vallado code is fast but it is designed in Fail fast fassion.

So we can’t use it for orbit determination or satellite tracking as it stops computing on the first failure.

In order to make Vallado SGP4 code usable for orbit determination and satellite tracking we have added failure recovery code to it.

Our version of code is synchronized with 2023 release of Vallado code.

Waht do ve have here?

The package contains a python extension which defines a wrapper class for SGP4.cpp/.h files and several constants to work with it.

The wrapper class also contains orbit determination methods.

The code is in alpha stage as it hasn’t been tested extensively.

How to use it

Install the extension

First of all you need Python 3.6+ installed.

Install prerequicicies:

  • Cython
  • numpy
  • scipy
  • setuptools
  • wheel

Clone this repo or download the code in archive.

$ git clone https://git.org.ru/shkolnick-kun/resgp4.git

Install the extension:

$ cd resgp4
$ python setup.py install

Usage

Import the extension

from resgp4 import ReSGP4

Create the satellite model. There are several constructors you can use any of them.

  • From mean orbital elements
epoch    = 2458883.41667824     # Epoch Julian date
bstar    = 0.010093000000000001 # SGP4 type drag coefficient (kg/m2er).
no_kozai = 0.06623712221479533  # Mean motion (rad/min).
ecco     = 0.0006819            # Eccentricity (unitless).
inclo    = 0.9249773796671908   # Inclination (rad).
agrpo    = 5.67763110589539     # Argument of perigee (rad).
nodeo    = 1.6246816221209697   # Right ascension of ascending node (rad).
mo       = 3.9099860740850607   # Mean anomaly (rad).

sat = ReSGP4.new(epoch, bstar, no_kozai, ecco, inclo, ardpo, nodeo, mo)
  • From TLE
l1 = "1 44249U 19029Q   20034.91667824  .00214009  00000-0  10093-1 0  9996"
l2 = "2 44249  52.9973  93.0874 0006819 325.3043 224.0257 15.18043020  1798"

sat = ReSGP4.from_tle(l1, l2)
  • From state
# Epoch Julian date
epoch = 2458883.41667824

# Position in ECI frame (km)
r = np.array([1041.69481245, -6756.67472297, -896.73317746])

# Speed in ECI frame (km/s)
v = np.array([4.44027778, 1.4777608, -5.9930971])

# This constructor uses orbit determination, so check ``sat.result`` to ensure that the resulting model has propper quality.
sat = ReSGP4.from_rv(epoch, r, v)
  • From osculating elements
# Epoch Julian date
epoch = 2458883.41667824

# Osculating elements
# n    - mean motion (rad/min)
# ecc  - eccentricity
# incl - inclination (rad)
# argp - argument of perigee (rad)
# node - right ascension of ascending node (rad)
# m    - mean anomaly (rad)
#                      n              ecc            incl            argp             node            m
osc = np.array([6.61497164e-02, 3.12078992e-04, 9.25294058e-01, 2.16376233e+00, 1.62481621e+00, 1.14080355e+00])

# This constructor uses orbit determination, so check ``sat.result`` to ensure that the resulting model has propper quality.
sat = ReSGP4.from_osc(epoch, osc)

Porpagate the satellite

# Get state after 10.0 days
error, r, v = sat.sgp4(10.0)

#And yes, ``sat`` object is callable:
error, r, v = sat(10.0)
Конвейеры
0 успешных
0 с ошибкой