nsat / sgp4-rs

A Rust package for the SGP-4 orbital propagator.
MIT License
8 stars 2 forks source link

Pass Errors through SPG4 with tranparency #17

Closed barry-king-spire closed 2 years ago

barry-king-spire commented 2 years ago

The C++ code has a set of define errors that we can pass through and match.

*  return code - non-zero on error.
*                   1 - mean elements, ecc >= 1.0 or ecc < -0.001 or a < 0.95 er
*                   2 - mean motion less than 0.0
*                   3 - pert elements, ecc < 0.0  or  ecc > 1.0
*                   4 - semi-latus rectum < 0.0
*                   5 - epoch elements are sub-orbital
*                   6 - satellite has decayed

It does have an interesting quirk that satellites decaying fail by error code 1 first. Moving this error code after error code 6 seems to have fixed the issue and return the correct codes.