Closed tasymons closed 2 years ago
Replace this:
hp = HEALPix(nside=256, order='nested',frame=Galactic)
with this:
hp = HEALPix(nside=256, order='nested',frame=Galactic())
It might be nice to have the string (and maybe class) argument work transparently as the string arguments at least would be more user friendly than having to import the frame classes?
Yes, that's a good idea. Would you like to do a PR, or shall I?
Description
The method healpix_to_skycoord fails instead of giving the skycoord.
Expected behavior
Actual behavior
Using
hp = HEALPix(nside=256, order='nested',frame=Galactic)
Using
hp = HEALPix(nside=256, order='nested',frame='galactic')
Steps to Reproduce
Code to cause the error:
System Details
System 1: Linux-5.1.7-300.fc30.x86_64-x86_64-with-fedora-30-Thirty Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 16:07:37) [GCC 9.3.0] Numpy 1.20.3 astropy 4.3.1 Scipy 1.7.1 astropy_healpix 0.6
System 2: Windows-10-10.0.19041-SP0 Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] Numpy 1.18.1 astropy 4.0 Scipy 1.4.1 astropy_healpix 0.5 (errors on line 330 instead of 339 in this version)
Same error on both systems.
Unsuccessful attempt to fix
On System 1, changed
.../astropy_healpix/high_level.py
at line number 339to be
which bypasses the error and enters the method
realize_frame
.Unfortunately this still leads to an error in
.../astropy/coordinates/baseframe.py
at line number 989With the accompanying traceback:
I am not a Python expert so I'm out of ideas on what to try. Additionally, editing
baseframe.py
in astropy breaks other astropy functions so I can't keep following that rabbit hole.Any help figuring this out would be greatly appreciated!