1manprojects / one_Sgp4

C# SGP4 orbit prediction Library
MIT License
60 stars 14 forks source link

ArgumentException: Value does not fall within the expected range. #29

Closed absolutelylost closed 1 year ago

absolutelylost commented 1 year ago

I'm attempting to run the example code in the repo with an updated TLE as seen below

Tle tleISS = ParserTLE.parseTle(
            "1 25544U 98067A   23080.70512120  .00015280  00000+0  28135-3 0  9998",
            "2 25544  51.6417  41.9472 0006129 116.4287 305.1642 15.49355675388224",
            "ISS 1");
EpochTime startTime = new EpochTime(DateTime.UtcNow);
EpochTime stopTime = new EpochTime(DateTime.UtcNow.AddSeconds(10));

I'm presented with the following error.

ArgumentException: Value does not fall within the expected range.
One_Sgp4.EpochTime.op_Subtraction (One_Sgp4.EpochTime e1, One_Sgp4.EpochTime e2) (at  Assets/Scripts/TLEsProcessing/One_Sgp4/time/EpochTime.cs:579)

The difference doesn't seem to make sense as the starting date should be smaller than the end date unless that's not the issue. Thanks for your help.

absolutelylost commented 1 year ago

Turns out I was just doing some bad math later on.