FindNextAboveToBelowCrossingPoint fails to find the crossing
Under certain circumstances the elevation angle of a satellite gets stuck at some positive value, and FindNextAboveToBelowCrossingPoint finds the crossing only a few years in the future. This code reproduces the problem:
public void ReproduceError()
{
var myLocation = new GeodeticCoordinate(Angle.FromDegrees(44), Angle.FromDegrees(-79), 270);
var groundStation = new GroundStation(myLocation);
string tle0 = "0 GOES 18";
string tle1 = "1 51850U 22021A 24184.52757794 .00000099 00000-0 00000+0 0 9998";
string tle2 = "2 51850 0.0386 165.9928 0000260 341.7596 186.2013 1.00270475 8635";
var satellite = new Satellite(tle0, tle1, tle2);
var start = DateTime.Parse("2024-07-02 21:57:20Z");
var end = start.AddMinutes(60);
var passes = groundStation.Observe(satellite, start, end, TimeSpan.FromSeconds(15));
if (passes.Count > 0) Debug.WriteLine($"Pass end: {passes[0].End}");
}
This code runs for about a minute and then prints:
Pass end: 2035-01-12 03:26:30
Interesting, thanks for reporting it. I'll take a look.
I did not fix the root cause of this issue (finding AOS/LOS for geostationary satellites), but I did introduce a new method in 1.4.0 on Satellite called IsGeostationary which is recommended to be checked before attempting to observe the satellite. Simply, a geostationary satellite can just have the current elevation checked, and likely will not have AOS/LOS events.