hipspy / hips

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

HipsSurveyProperties base_url fails for some surveys #53

Closed tboch closed 7 years ago

tboch commented 7 years ago

base_url should be determined using the hips_service_url keyword from the properties file. moc_access_url currently used points to the coverage of the HiPS and this property might be missing. example: http://skies.esac.esa.int/pla/HFI_SkyMap_100_2048_R2_02_full_HiPS/properties doesn't have a moc_access_url property. On the other hand, hips_service_url will always be found.

cdeil commented 7 years ago

Apologies, this is something I changed / broke in https://github.com/hipspy/hips/commit/8af90581b6d63c75d939226de4d23116609312b5 .

The reason I did was that I was using http://alasky.unistra.fr/DSS/DSS2Merged/properties for the example, and that file does not have a hips_service_url key!???

tboch commented 7 years ago

OK, let me check this with my CDS colleagues. Reading again the HiPS document, it seems that hips_service_url key is not required, which I don't understand for now.

cdeil commented 7 years ago

A practical solution for now to get it to work for as many HiPS as possible might be to use hips_service_url and to fall back to moc_access_url (and leave a comment to one case where each is missing to explain why we do that). But yes, @adl1995 - Please wait for Thomas to make a decision here before making a PR.

tboch commented 7 years ago

Alright, for historical and pragmatic reasons, things are more complex than I first thought. The algorithm we could use is:

adl1995 commented 7 years ago

@tboch Is the properties URL present under a key named properties_url? I haven't been able to find this in any of the files in hips-extra repository.

tboch commented 7 years ago

@adl1995 no, there isn't such key and I'm not sure why we would need one. What is the use case you were thinking of?

adl1995 commented 7 years ago

@tboch I was actually asking for clarification on third point of the algorithm you mentioned. Where can I find the properties URL?

tboch commented 7 years ago

Actually, the properties URL is the URL we pass as a parameter of class method HipsSurveyProperties.fetch So, for example, if we start from the properties URL 'http://alasky.unistra.fr/DSS/DSS2Merged/properties' and we can not find hips_service_url or moc_access_url , then base_url should return 'http://alasky.unistra.fr/DSS/DSS2Merged'

adl1995 commented 7 years ago

@tboch Okay, but the object could also be instantiated from a local properties file, such as done here, what should be done in this case? Also, currently we don't store the properties URL in the fetch class method. I think to make this possible, this would need to be manually added in OrderedDict in the parse method.

tboch commented 7 years ago

@adl1995 right, if the properties comes from a local file, then this last fallback can not be applied.

tboch commented 7 years ago

@adl1995 fixed this in PR #60

Closing this issue.