Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getGroundTracks returning strange values randomly; sometimes tracks equal each other or are completely wrong #20

Closed
JoshuaKahn opened this issue Apr 29, 2021 · 6 comments

Comments

@JoshuaKahn
Copy link

JoshuaKahn commented Apr 29, 2021

Say I use the following code to get a ground track and print the result:

const satInfo = await getGroundTracks({
      tle: satTLE,
      stepMS: 10000,
      isLngLatFormat: false
    })
console.log(satInfo[0][550]) // Choosing 550 as the index to be consistent
console.log(satInfo[1][550])
console.log(satInfo[2][550])

Sometimes, the results will make sense in that each array has different values, like this:

image

And the satellite's current position (using getLatLngObj()) on a map will lie on ground track [1].

image

But quite often, for no discernible reason (after refreshing or whatever), some of the arrays will be equal to each other.

image

And the satellite's position will no longer lie on the plotted line for that orbit!

image

And sometimes, the values will be completely off everywhere:

image

Changing the startTimeMS does not fix this; nor does changing the TLE, or changing stepMS. I have a hunch that this may be due to something with inclined orbits (TLEs with higher inclinations having more problems) but I have no real way to confirm this because I can't replicate the conditions that explicitly cause it to happen.

@JoshuaKahn JoshuaKahn changed the title getGroundTracks returning strange values; sometimes tracks equal each other or are completely wrong getGroundTracks returning strange values randomly; sometimes tracks equal each other or are completely wrong Apr 29, 2021
@JoshuaKahn
Copy link
Author

JoshuaKahn commented May 4, 2021

Again after more investigation I believe this is something to do with inclination in orbits - perhaps some trig or division going wrong?

@JoshuaKahn
Copy link
Author

JoshuaKahn commented May 4, 2021

More investigation - this error may not be happening when getting a single orbit track from getOrbitTrack(), which suggests a problem perhaps with the antimeridian function or something to do with time in general @davidcalhoun ?

@davidcalhoun
Copy link
Owner

Thanks for the heads up, I'll take a look when I can. The underlying SGP4 library satellite.js definitely has problems with some types of TLEs.

If possible, could you share the TLE and some input times that reproduce this error?

@JoshuaKahn
Copy link
Author

JoshuaKahn commented May 5, 2021

@davidcalhoun
I got these TLEs via https://tle.ivanstanojevic.me/; I tried a bunch until I saw satellites that presented errors, and from that, satellites that shared almost similar orbits.

AII-BRAVO
1 48270U 21034C 21124.53276317 .00000342 00000-0 45565-4 0 9993
2 48270 97.7860 200.0737 0003406 358.5519 1.5688 14.85661284 809

PROXIMA 2
1 43696U 18088G 21124.58637862 .00001563 00000-0 64741-4 0 9999
2 43696 85.0352 224.3224 0018986 174.8560 185.2882 15.22846619137699

IRIDIUM 100
1 42956U 17061B 21124.43823099 .00000102 00000-0 29484-4 0 9993
2 42956 86.3949 86.5825 0002211 84.7810 275.3638 14.34216227186804

Timestamps (using Date().getTime())

  • bug present
    1620186716953 IRIDIUM 100
    1620183731392 PROXIMA 2

  • No bug present
    1620183996890 PROXIMA 2
    1620173260997 IRIDIUM 100

(AII-BRAVO never experienced an error)

@davidcalhoun
Copy link
Owner

Thank you for the details, this helps a lot! Will investigate when I get a chance.

@davidcalhoun
Copy link
Owner

Thank you again, the extra info was super helpful to track this down. This is now fixed in 4.2.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants