aburrell / apexpy

A Python wrapper for Apex coordinates
MIT License
34 stars 25 forks source link

Updating apexsh.dat #109

Closed Ensase closed 1 year ago

Ensase commented 1 year ago

Hi everyone! Firstly, after the installing apexpy on python 3.8 I found that it is impossible to use dates after 2020. It seems like apexpy.dat didn't cover 2025 epoch. I have successfully re-installed apexpy from source by pip install git+https://github.com/aburrell/apexpy.git But again, it can't process dates after 2020:

import apexpy
apex_out = apexpy.Apex(2022.0)
apex_out.convert(60, 15, 'geo', 'apex', height=0)
/opt/anaconda3/lib/python3.8/site-packages/apexpy/apex.py:552: RuntimeWarning: invalid value encountered in <lambda> (vectorized)
  alat, alon = self._geo2apex(glat, glon, height)
/opt/anaconda3/lib/python3.8/site-packages/apexpy/apex.py:555: UserWarning: Apex latitude set to NaN where undefined (apex height may be < reference height)
  warnings.warn(''.join(['Apex latitude set to NaN where undefined ', (nan, nan)

Finally I've rebuilt and replaced apexsh.dat, but all the same. Could you help me with it, please?

aburrell commented 1 year ago

Hi @Ensase, thanks for coming here with your issue. This is strange as it seems this would only happen with a very old version of apexpy. Can you provide:

I am on holiday, so won't be able to answer your question until next year, but with the info I can get to it more quickly.

PS - I edited your comment above to use a code block (three accents in a row), so that the page breaks would show up.

Ensase commented 1 year ago

@aburrell, thank you for prompt reply!

Ensase commented 1 year ago

I've replaced /opt/anaconda3/lib/python3.8/site-packages/apexpy/apexsh.dat with my fresh apexsh.dat and now everything works! Thanks and have a good holiday!

aburrell commented 1 year ago

Thanks for letting us know about this issue, glad your problem was resolved!