saurvs/astro-rust

Differences between astro-rust and ERFA in AltAz -> (Hour angle, Dec) conversion

cjordan opened this issue · 0 comments

Hi! I want to use this library, but I noticed some differences with others (notably ERFA https://github.com/liberfa/erfa). I didn't go through the differences in the mathematics, but I did do a quick comparison in python by converting both the C and rust codes: https://gist.github.com/cjordan/d0909a3ed4e726e720d99761dfa6591f

In the rust code, it looks like a az.cos() needs to be changed to alt.cos(), as well as changing a couple of signs. I wanted to raise this as an issue in case I'm being naive here and this is working as intended. If these changes should be applied to the code, then I'm happy to give a PR to fix them.

Also, if I require both the hour angle and declination from a AltAz pair, would it make sense to make another function to provide both? I would be using such a function in a hot loop.