Skip to content

Commit

Permalink
Fix tile splitting criterion
Browse files Browse the repository at this point in the history
  • Loading branch information
adl1995 committed Aug 8, 2017
1 parent 5f22f98 commit 8140f29
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions hips/draw/paint.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ def is_tile_distorted(corners: tuple) -> bool:

return bool(
max(edges) > 300 or
max(diagonals) > 150 or
diagonal_ratio < 0.7
(max(diagonals) > 150 and
diagonal_ratio < 0.7)
)


Expand Down
2 changes: 1 addition & 1 deletion hips/tiles/tests/test_allsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
dict(
label='fits',
meta=dict(order=3, ipix=-1, file_format='fits'),
url='http://alasky.unistra.fr/IRAC4/Norder3/Allsky.fits',
url='https://github.com/hipspy/hips-extra/blob/master/datasets/samples/IRAC4/Norder3/Allsky.fits?raw=true',
filename='datasets/samples/IRAC4/Norder3/Allsky.fits',

repr="HipsTileAllskyArray(format='fits', order=3, width=1728, "
Expand Down
2 changes: 2 additions & 0 deletions hips/utils/tests/test_wcs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.tests.helper import remote_data
from numpy.testing import assert_allclose
from astropy.coordinates import SkyCoord
from ..wcs import WCSGeometry
Expand Down Expand Up @@ -35,6 +36,7 @@ def test_celestial_frame(self):
assert_allclose(self.geometry.wcs.wcs.crpix, [1000., 500.])
assert_allclose(self.geometry.wcs.wcs.cdelt, [-0.0015, 0.0015])

@remote_data
def test_create_from_dict(self):
params = dict(target='crab', width=2000, height=1000, fov='3 deg',
coordsys='galactic', projection='AIT')
Expand Down
3 changes: 1 addition & 2 deletions hips/utils/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def create(cls, skydir: SkyCoord, width: int, height: int, fov: Union[str, Angle
Sky coordinate of the WCS reference point
width, height : int
Width and height of the image in pixels
fov: str or `~astropy.coordinates.Angle`
fov : str or `~astropy.coordinates.Angle`
Field of view
coordsys : {'icrs', 'galactic'}
Coordinate system
Expand Down Expand Up @@ -162,7 +162,6 @@ def create(cls, skydir: SkyCoord, width: int, height: int, fov: Union[str, Angle
def create_from_dict(cls, params: dict) -> 'WCSGeometry':
"""Create WCS object from a dictionary (`WCSGeometry`)."""
skycoord = SkyCoord.from_name(params.pop('target'), frame=params['coordsys'])
# print(**params)
return cls.create(skycoord, **params)

@classmethod
Expand Down

0 comments on commit 8140f29

Please sign in to comment.