hipspy / hips

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

Introduce a simple way to select a HiPS by ID string #81

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

The current way to select which HiPS to draw is cumbersome: https://hips.readthedocs.io/en/latest/getting_started.html#make-a-sky-image

from hips.tiles import HipsSurveyProperties
url = 'http://alasky.unistra.fr/DSS/DSS2Merged/properties'
hips_survey = HipsSurveyProperties.fetch(url)

We should introduce a simple way to let the user pass a string hips_survey="P/DSS/DSS2Merged" to make_sky_image like they do here: https://github.com/cds-astro/ipyaladin/blob/master/examples/2_Base_Commands.ipynb ( passing a HipsSurveyProperties would still work, a string would just be an extra option for the common case where HiPS is fetched from CDS )

Users could get those IDs from here: http://aladin.u-strasbg.fr/java/nph-aladin-new.pl?frame=aladinHpxList and we would use https://hips.readthedocs.io/en/latest/api/hips.HipsSurveyPropertiesList.html to look up the survey from the ID.

This isn't hard to implement, the main thing to discuss a bit is if / how to cache the HipsSurveyPropertiesList, there's tradeoffs between fetching it often, or caching it but then sometimes being outdated.

cdeil commented 7 years ago

Closing this old issue as discussed in the call today. This was implemented by @adl1995 in #95 . For the future, it would probably be better to cache the HiPS survey list instead of re-fetching it on every name lookup. But that's low-priority, usually tile fetching follows and is the slower part.