brandon-rhodes / python-sgp4

Python version of the SGP4 satellite position library
MIT License
371 stars 87 forks source link

"mean eccentricity is outside the range of 0.0 to 1.0" #108

Closed drysdam closed 1 year ago

drysdam commented 1 year ago

I'm converting some pre-alpha5/omm code to sgp4-2.21. The work you've done here is invaluable and I appreciate it a LOT.

I am getting a mysterious error message on some elsets, though. For instance, this one:

1 54380U 22162B 22345.68941756 .08877519 80912-5 18379-3 0 9990 2 54380 41.4618 212.0662 0014777 219.1379 204.8125 16.45663364 1950

if I propagate this past 2022-12-12 17:55:44, I get nans. I see there's also an error when I propagate to any time before or after that which says "mean eccentricity is outside the range of 0.0 to 1.0". The eccentricity on the elset is .0014777, which the OMM exporter agrees with.

I'm guessing this object reenters at 17:55:44 which is why the propagator stops then. If that's right, I'll have to handle that situation. But why do I get eccentricity errors before then?

Actually, that theory doesn't make sense, since the last x,y,z reported is less than the radius of the earth, so it must have reentered long before. This must be a decaying elset and it only stops propagating when there's some numerical error. I still don't understand the error message or what I could do about it. Also, I see there's a different error message for a decayed object (error code 6) which I don't get.

Perhaps the problem is that this is just a bad elset and "mean eccentricity" is the first issue reported. It is able to do something with it for a while anyway, but eventually even that fails.

brandon-rhodes commented 1 year ago

Yes, the SGP4 routine is built to keep giving valid results for as long as it can numerically—which is generally for far longer than the satellite will last. When stepping forward in time, I generally watch the altitude, and stop once the satellite's altitude puts it low enough in the atmosphere to force re-entry. Trying to continue SGP4 past that point will give a mix of positions, errors, and NaNs, but none of those—including the positions given—are valid, since the satellite will no longer exist.

drysdam commented 1 year ago

Thanks! And again, thanks thank thanks for updating sgp4.