hipspy / hips

Python library to handle HiPS
https://hips.readthedocs.io
12 stars 16 forks source link

Introduce a simple way to specify WCSGeometry #82

Open cdeil opened 7 years ago

cdeil commented 7 years ago

The current method we have to specify WCSGeometry is pretty complicated:

In contrast, Aladin Lite and ipyaladin have this nice simple way: https://github.com/cds-astro/ipyaladin/blob/master/examples/2_Base_Commands.ipynb


The main difference is that they have target which can be a string like "Crab nebula" that's looked up via SESAME, or it can be a string representation of the sky coordinate like "0. 0.", whereas we currently have to import SkyCoord and create it, which means two extra lines.

There is http://docs.astropy.org/en/stable/api/astropy.coordinates.SkyCoord.html#astropy.coordinates.SkyCoord.from_name to look up from SESAME, I don't know if they have a Skycoord string parsing functionality???

So I think we should also access skydir strings (maybe rename to target) and the simple interface.

In addition, we might want to allow the geometry parameter in make_sky_image to be a dict, and if it is, call WCSGeometry.create_from_dict() for the user as a convenience. I.e. this would work:

geometry = dict(target='crab', fov='10 deg', frame='galactic')
make_sky_image(geometry, hips_survey)
cdeil commented 7 years ago

I see that this issue was partly implemented by @adl1995 in #100.

The main missing pieces are to

cdeil commented 6 years ago

@tboch - I think in terms of convenience API to define common WCS in a simple way, we might want to just re-use the one from https://github.com/cds-astro/ipyaladin and get rid of our WCSGeometry, or at least add a classmethod to suport what ipyaladin does?

Would be nice if those two Python HiPS packages had a similar API, no?

Users would always be able to make any astropy.wcs.WCS and use that, so really the full functionality remains. This is just for the simple end-user sugar API that most people will use.