hipspy / hips

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

Introduce healpix utils module? #16

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

I think it would be a good idea to introduce a healpix_utils.py module in the hips package.

We would write a few wrapper functions for healpy there. E.g. with healpy.boundaries we noticed that it always returns xyz, but we want lon, lat, and it would give us a place of test_healpix_utils.py to add tests that assert that the healpy functionality we need works well.

It would also allow us to easily switch to drop the dependency on healpy if in the future the small subset of healpy functionality becomes available in Astropy core or another Python package. This would be desirable, because this hips package is nice for hobby astronomers and kids and many of those are on Windows which healpy doesn't support.

I think this would be a small module (just 5 or 10 functions), and we would only add things as we need them in other parts of the hips package (taking the extra time to add docstrings and tests to make sure everything is in order).

@tboch @adl1995 - Thoughts?

tboch commented 7 years ago

I like the idea. We had the same kind of wrapper layer in Aladin Desktop, and it proved to be quite useful (and easy) when we decided to switch from one implementation to another

adl1995 commented 7 years ago

19 I have added a boundaries method for now and included a test case. Please note that I am using np.testing.assert_array_almost_equal for testing purposes, is that alright?

cdeil commented 7 years ago

This exists by now: https://github.com/hipspy/hips/blob/master/hips/utils/healpix.py Of course it will grow for the functionality we need, but there's no concrete action item here. Closing this old issue.