hipspy / hips

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

Add all-sky image class and update existing tile code #86

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

This PR introduces support for all-sky combined tile images such as: https://github.com/hipspy/hips-extra/blob/master/datasets/samples/FermiColor/Norder3/Allsky.jpg

I'm not happy at all with the implementation: to re-use the image I/O functionality, I had to sub-class

class HipsTileAllskyArray(HipsTile):

which is very weird.

I'm not sure yet what a good design is. Maybe move the image handling and I/O functionality from HipsTile to a hips.utils.ImageFile class, and introduce a separate hips.utils.ImageArray class which has a Numpy array data member instead of an encoded bytes attribute. Or get rid of those classes and instead use more functions, like they do in scikit-image. If you look at the tests here, you'll see that HipsTileAllskyArray duplicates a lot from HipsTile which is bad, and still, because on HipsTile creation JPG encoding happens, it's not possible to process the non-encoded pixels properly. Something to think about and discuss next week ...

The reason I implemented this now is that we need it here to generate HiPS from our data that works with Aladin Lite, i.e. we need to make an all-sky file: https://github.com/gammapy/gamma-sky/blob/af2529a996bca1d09cb2e2fd10d65a61b4465344/gammasky/maps.py#L133

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.2%) to 96.686% when pulling fc5a870bf4d8215a8818d3068749ea97e7029932 on cdeil:allsky into 354eb158a7ba47203d5771f6bb3cd13542de7187 on hipspy:master.