brandon-rhodes / python-sgp4

Python version of the SGP4 satellite position library
MIT License
376 stars 88 forks source link

Satrec.error is always a special constant(110 or 65636). #102

Closed longzhmm closed 2 years ago

longzhmm commented 2 years ago

The error code (Satrec.error) does not appear to work. Whether the calculation is really wrong or not, Satrec.error is always a special constant. example:

from sgp4.api import Satrec, jday s_err = '1 19751U 89001C 22001.38928995 .00000005 00000-0 00000-0 0 9994' t_err = '2 19751 00.0000 128.1334 -100000 212.4563 204.0644 1.00000000000000' s_right = '1 19751U 89001C 22001.38928995 .00000005 00000-0 00000-0 0 9994' t_right = '2 19751 64.2675 128.1334 0023555 212.4563 204.0644 2.13156140256679' satellite_err = Satrec.twoline2rv(s_err, t_err ) satellite_right = Satrec.twoline2rv(s_right, t_right) jd, fr = jday(2022, 1, 1, 0, 0, 0) e_err, r1, v1 = satellite_err.sgp4(jd, fr) e_right, r2, v2 = satellite_right.sgp4(jd, fr) print(satellite_err.error,e_err) print(satellite_right.error,e_right)

brandon-rhodes commented 2 years ago

@longzhmm — Thanks for pointing that out! I've landed a fix, and will plan to do a new release later today if I get the chance.