vendor-branching

SGP4 forks

From https://orbitalradar.com/glossary/sgp4:

SGP4 is the standard algorithm that turns a [deprecated, now OMM] TLE into a satellite's predicted position at any moment, modelling Earth's oblateness, atmospheric drag and lunisolar effects. Nearly every tracking app and screening system runs it — with typical kilometre-scale accuracy that degrades as the TLE ages.

See also Wikipedia

The picture that appears is that many developers try to re-invent the warm water (or copy-paste): see

There are too many SGP4 forks to list them all.

Forks are flooding the Internet and each vendor tries to position them as THE source. They create a dependency that could be fatal once they disappear. (See the KIK case.)

But as a result (and because forking is nowadays so easy), new developers are overwhelmed by implementations that try to call themselve a reference. Which one should we use? Shall we fork that one?

Also, CCSDS is actually promoting copy-pasta: this page invites to download artefacts, while the better way would be to run a minimal/modified vendor drop from CCSDS GitHub.

I'm beginning to understand why: the original code was published in a format (PDF) (1988) that was the norm back then but is not easy to ingest in software, so many developers went their way with the paper. The update (2006) mentions this flurry of new versions. Nowadays the "reference" Vallado's can be ingested by more efficient means than just copy-pasting.

To avoid forking off so far that updates in Vallado's require manual labour, a suggested approach is to use Vendor Branching. The hard part - should you accept the mission - is to rip out your own code and start over from Vallado's. BUT ... not by simply copy-pasting code.

If you think of writing an SGP propagator, please consider the VB approach rather than just copy files and hack away at them.

The detailed vendor branch approach is documented here.

Maybe this approach will also encourage users to explore the later models (SGP8/SDP8).

Bugs and contributions should be discussed there (and please read their CONTRIBUTING).

Note that SGP4 users might also have the need to decode OMM (successor to the deprecated TLE) data. SDS provides the routines needed to decode such data, and either the VB approach or a package manager should be used to decode that data.

GitHub forks should be safe as long as they keep merging...

But they too have to be merged somehow in their own project, and that's where Vendor Branching kicks in. Unknowingly, users modifying their version are actually using the VB approach because their vendor branch is no more than the remote branch.

Celestrak: the SGP4 reference

At least for the small fish, I'd say. I cannot imagine SPICE, STK, NORAD or USAF even taking the slightest notice of the VB approach...

But even this Celestrak publication is already a first invitation to go copy-pasting. BTW - it is unclear how it relates to the GitHub version. It is different, for sure; so maybe Celestrak's GitHub could be made the reference and outdated documents removed. In other words, when publishing code, use a VCS (Git is highly recommended...), not a file format. The various copies should be centralised somehow.

Note that I'm not a scientist and have participated in one single academic paper only (as an associated developer), so I might not fully understand the "paper" community.

Issues raised in other projects

TODO

Probably dead...

Think vendor branching is difficult? Eat this!