aerospaceresearch / orbitdeterminator

determination of satellite orbits and more
MIT License
180 stars 113 forks source link

Replace PyEphem with SkyField functions #239

Closed hornig closed 3 years ago

hornig commented 3 years ago

https://github.com/aerospaceresearch/orbitdeterminator/blob/3c4ac10f5518783dbddda3c3e23592d7297654d9/orbitdeterminator/kep_determination/gauss_method.py#L18

PyEphem is (currently) not supported with python 3.9 (windows). Also the creator states their SkyField[0] lib does include similar functions and more.

"The Skyfield astronomy library should be preferred over PyEphem for new projects. Its modern design encourages better Python code, and uses NumPy to accelerate its calculations."

So it is worth a try to replace pyephem functions with the corresponding alternatives from SkyField.

[0] https://rhodesmill.org/skyfield/

AlexReido commented 3 years ago

I don't have time right now but I believe ephem is only used to calculate the right asencion and declination from the topocentric coordinates. Should be an easy fix, I'll try tomorow. I think this is the corresponding function in skyfield. https://rhodesmill.org/skyfield/examples.html#what-is-the-right-ascension-and-declination-of-a-point-in-the-sky

hornig commented 3 years ago

I see it here being used here for the groundstation/observer location at a given time. https://github.com/aerospaceresearch/orbitdeterminator/blob/3c4ac10f5518783dbddda3c3e23592d7297654d9/orbitdeterminator/kep_determination/gauss_method.py#L1236-L1238

That is also what you said @AlexReido. The other ephimerides in this function in there are done differently.

so, interested to work on this including a short test that is is equivalent in result?

AlexReido commented 3 years ago

Yes I'll give it a go now, including testing of course :)