hipspy / hips

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

Add compute_image_pixels function in hips.utils #26

Closed adl1995 closed 7 years ago

adl1995 commented 7 years ago

I have added a function related with the computation of pixels. However, in the test case, I'm getting this error:

urllib.error.URLError: <urlopen error An attempt was made to connect to the internet by a test that was not marked remote_data. The requested host was: github.com>

This is caused by the fits.open() function. I tried passing in a parameter called remote_data=None following this issue, but the error still persists.

adl1995 commented 7 years ago

@cdeil I have added a class called WCSGeometry and renamed the function to compute_healpix_pixel_indices. For now, the class just contains two properties, wcs and shape, but I will add a class method to create a WCS object within this class.

adl1995 commented 7 years ago

@cdeil - I added a @classmethod for creating a WCS object, however, I'm getting this error in wcs.all_pix2world function:

TypeError: WCS projection has 4 dimensions, so expected 2 (an Nx4 array and the origin argument) or 5 arguments (the position in each dimension, and the origin argument). Instead, 3 arguments were given.

I think this has something to do with how I'm constructing my SkyCoord object. For now, I am passing it these arguments:

skycoord = SkyCoord(10, 20, unit="deg")

adl1995 commented 7 years ago

@cdeil - I just made a commit which adds 2 examples, updates the test case, crpix parameter for WCSGeometry, and some documentation changes.

adl1995 commented 7 years ago

@cdeil - I've made the necessary changes. Please check.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 0ffe20e0ea787f11df65cd384c63e03c522aa514 on adl1995:hips.utils into ec1cfae57a28f1443664a3ee64232ff3d83c4645 on hipspy:master.

cdeil commented 7 years ago

@adl1995 - See 17925ac . I'll merge if travis-ci passes.

Some things I did:

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-3.1%) to 96.85% when pulling 4130e5bd8c7b7613eaa09d105b0e1b1ac2c825d0 on adl1995:hips.utils into ec1cfae57a28f1443664a3ee64232ff3d83c4645 on hipspy:master.