shashwatak / satellite-js

Modular set of functions for SGP4 and SDP4 propagation of TLEs.
MIT License
902 stars 145 forks source link

Does satellite-js provide a way to see if a sat is in eclipse. #51

Closed wgaylord closed 5 years ago

wgaylord commented 5 years ago

I am working on a project and I was wondering if satellite-js provided a function to tell me if a specific satellite is in eclipse or not.

wgaylord commented 5 years ago

Anyone know this?

davidcalhoun commented 5 years ago

That's an interesting question - my first guess would be to start from the sun's position, and then do a calculation (quadratic search style?) based on that, taking into account the position (including altitude) of the satellite. You can use a sun position library like this one: https://github.com/mourner/suncalc

wgaylord commented 5 years ago

I was asking if the software provided a function for it. I know how its done in libastro used by a python library.

thkruz commented 5 years ago

This function is not built into satellite-js. This issue can be closed.

wgaylord commented 5 years ago

So it has ways to see it ifs above the horizon for a observer but not eclipse. Guess its time to start porting parts of libastro to JS so I can supplement this.