Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support strings for frame in HEALPix class #56

Open
astrofrog opened this issue Oct 2, 2017 · 8 comments
Open

Support strings for frame in HEALPix class #56

astrofrog opened this issue Oct 2, 2017 · 8 comments

Comments

@astrofrog
Copy link
Member

astrofrog commented Oct 2, 2017

We should try and re-use the frame-parsing machinery from Astropy to make it so we can use:

hp = HEALPix(nside=4, order='ring', frame='galactic')

(like in SkyCoord)

@cdeil
Copy link
Member

cdeil commented Oct 16, 2017

👍

This is one thing I'm missing in hipspy/hips#109 , trying to use astropy-healpix for hips. I'll implement some utility function there now, but having direct support for frame={‘icrs’, ‘galactic’, ‘ecliptic’}would be great (I haven't encountered ecliptic so far, but the other two are common).

@cdeil
Copy link
Member

cdeil commented Oct 16, 2017

This is the make_frame helper function I'm using in hips for now:
https://github.com/hipspy/hips/pull/109/files#diff-82f8d9d870d0601c2c9452cdd650e703R207

@astrofrog
Copy link
Member Author

astrofrog commented Oct 16, 2017

This should be easy to do with:

In [1]: from astropy.coordinates import frame_transform_graph

In [3]: frame_transform_graph.lookup_name('galactic')
Out[3]: astropy.coordinates.builtin_frames.galactic.Galactic

@astrofrog
Copy link
Member Author

(This could replace make_frame)

@cdeil
Copy link
Member

cdeil commented Oct 16, 2017

I don't know ... this silently fails (returns None):

frame_transform_graph.lookup_name('spam')

For now I'll stick with my helper function.

@astrofrog
Copy link
Member Author

We could easily check for None output though and raise an exception in that case? (for here, not hips). I'll open an issue to Astropy to add an option to raise an exception if the frame is not known.

@cdeil
Copy link
Member

cdeil commented Oct 16, 2017

Yes, maybe that would be the way to go here.

I think the hard part will be to have a sane way to handle frame for FITS I/O for HEALPix maps. There only a small subset of frames will be supported, so at that point something custom like the helper function I have now in hipspy or what you have in reproject is needed.

I guess a good strategy is to allow HEALPix objects with any frame for in-memory computations, and only to apply the checks on valid subset on FITS I/O?

@astrofrog
Copy link
Member Author

I guess a good strategy is to allow HEALPix objects with any frame for in-memory computations, and only to apply the checks on valid subset on FITS I/O?

I agree with this! The HEALPix class itself should not have restrictions, whereas once we write the FITS readers/writers, those should have validation of COORDSYS.

@cdeil cdeil modified the milestones: 0.2, 0.3 Oct 17, 2017
@cdeil cdeil modified the milestones: 0.3, 0.4 Oct 24, 2018
@cdeil cdeil modified the milestones: 0.4, 0.5 Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants