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

Introduce a simple way to specify WCSGeometry #82

Open
cdeil opened this issue Jul 19, 2017 · 2 comments
Open

Introduce a simple way to specify WCSGeometry #82

cdeil opened this issue Jul 19, 2017 · 2 comments
Assignees
Milestone

Comments

@cdeil
Copy link
Contributor

cdeil commented Jul 19, 2017

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

from astropy.coordinates import SkyCoord
from hips.utils import WCSGeometry
geometry = WCSGeometry.create(
     skydir=SkyCoord(0, 0, unit='deg', frame='galactic'),
     width=2000, height=1000, fov="3 deg",
     coordsys='galactic', projection='AIT',
)

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
Copy link
Contributor Author

cdeil commented Aug 3, 2017

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

The main missing pieces are to

  • use this simpler from dict method in the high-level docs getting started example (and plot_*.py files in docs)
  • make it possible / easier for someone looking at the make_sky_image docstring to figure out what options they can pass, i.e. link from there to the other docstring of the method that is called.

@cdeil cdeil modified the milestones: 0.2, 0.3 Oct 28, 2017
@cdeil
Copy link
Contributor Author

cdeil commented Jun 28, 2018

@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.

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