1
$\begingroup$

The first release on Github was in 2014. I have noticed Brandon Rhodes has contributed quite a bit to the Skyfield source code, so I will tag him here and in a comment.

EDIT: I changed the title to reflect intent of the question. Skyfield is obviously not the only open source Python SGP4 implementation that could, or ever will, exist, and I am definitely looking for version 8+ of SGP4 (accessing link and software requires log-in).

NOTE: By open-source, I do not mean the SGP4 version 8+ algorithm itself. What I mean is an open-source wrapper for the software available via download from space-track.org, which I assume would be quite involved.enter link description here

$\endgroup$
6
  • $\begingroup$ @user8590 not sure the notification went to you from the question so tagging you here. $\endgroup$
    – brethvoice
    Jun 18, 2021 at 17:31
  • 1
    $\begingroup$ I am hoping someone, somewhere, will be able to implement the new SGP4, but it looks like it could be quite a while: github.com/skyfielders/python-skyfield/issues/588 $\endgroup$
    – brethvoice
    Jun 18, 2021 at 17:37
  • 1
    $\begingroup$ I am pretty sure neither of these generates a notification. Go to meta FAQ in the main meta and read How do comment @replies work?. It's likely they follow the Skyfield tag (but I don't know for sure) but the only sure way is to find another post by someone and leave a temporary comment there pointing here, e.g. "Have you seen [this](url) question?" $\endgroup$
    – uhoh
    Jun 19, 2021 at 0:20
  • 2
    $\begingroup$ Also, I think "When was the last time...?" is a not-so interesting question. Seeing your comment "I am hoping someone, somewhere, will be able to implement the new SGP4" I think you should ask "Has Skyfield or any other SGP4-capable Python package yet implemented the new, improved SGP4?" That seems to be what you'd really like to know and is of much more interest to other readers than simply the date of the last update of Skyfield's SGP4 implementation, which if it were last Tuesday still wouldn't tell you in what way it was updated. $\endgroup$
    – uhoh
    Jun 19, 2021 at 0:27
  • 2
    $\begingroup$ @brethvoice — Ryan's answer looks complete to me: there is no public support that we know of beyond the Python code that comes with it. Feel free to subscribe to the Skyfield issue on the subject, which you've already linked, if you want to hear if anyone tries to tackle connecting it to Skyfield. $\endgroup$ Jun 23, 2021 at 21:07

1 Answer 1

6
+100
$\begingroup$

The new SGP4 library comes with a Python wrapper in the same zip archive file (also Java, Matlab, and Visual Basic, and documentation for the C API), but it's not at all idiomatically Pythonic, since it sticks very closely to the underlying implementation in Fortran and C. I've written my own wrapper around their wrapper, to handle things like returning lists rather than forcing you to declare ctypes arrays and pass in their addresses as arguments, to make it more intuitive for Python programmers to call, but it's not actually necessary to add or change anything in order to use SGP4 to propagate TLEs.

However, this does not meet your stated desire, since it knows nothing of skyfield, astropy, or any other module outside the basic Python distribution, because that's the way my employer wanted it. It accomplishes many of the same tasks using the official US Space Force libraries for coordinate conversion, precession & nutation modeling, time manipulation, etc. which come with the SGP4 distribution. My employer also hasn't yet given me permission to share it, but I am trying to convince them.

Also, even if I did rewrite in my spare time and publish it, it still wouldn't allow you to make use of the new "extended perturbations" improvements in the latest SGP4, unless you have a way to get your hands on the new Type 4 TLEs, which as far as I know are not publicly distributed. If you do find a source for them, please let me know!

The releasable portion of the U.S. Space Force Standardized Astrodynamics Algorithm Library may be downloaded from https://www.space-track.org/documentation#/sgp4 after free registration and acceptance of license agreement. Among other things, that license says no one can distribute the libraries to anyone else. Every person who wants them must make a space-track.org account of their own, and download their own, separate copy. You may freely distribute code which calls the libraries, but the libraries themselves must always come only from space-track.

The entire distribution, when unzipped, occupies 72 MB. This breaks down as follows:

  • 4 MB Documents (.doc and .docx)
  • 56 MB Lib
    • 21 MB Linux 32-bit (.so)
    • 20 MB Linux 64-bit (.so)
    • 8 MB Windows 32-bit (.dll and .lib)
    • 8 MB Windows 64-bit (.dll and .lib)
  • 10 MB SampleCode
    • 480 kB API documentation (.txt)
    • 860 kB C
    • 360 kB C#
    • 320 kB Fortran
    • 4600 kB Java (not a typo, it really is ten times the size of most others)
    • 310 kB Julia
    • 300 kB Matlab
    • 1500 kB Python
    • 360 kB Unit Tests (C# for MS Visual Studio)
    • 780 kB Visual Basic
  • 2 MB Verify (sample inputs and the outputs they should produce)

If you are very short of space, you can delete some of the extra libraries that are distributed but you won't be able to use because you won't have the inputs they need. For example, you could save 316 kiB from Linux64 if you delete libvcm.so, which is only needed to parse a file format you only get if you are doing official business of the U.S. Government.

So far, I have found no need for different wrappers on Windows and Linux, apart from the standard Python use of the os module to access the file system, such as os.path.join() rather than '/'.join().

$\endgroup$
1
  • 1
    $\begingroup$ Thanks @user37597 that gives me hope that I could implement it myself. How much space do you find the library takes on your operating system? And do you find that you need different wrappers for different operating systems? $\endgroup$
    – brethvoice
    Jun 22, 2021 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.