Skip to content

Commit

Permalink
Add test for converting invalid coordinates to an index (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Dec 12, 2023
1 parent cab333e commit e5299c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions astropy_healpix/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ def test_lonlat_to_healpix_shape():
assert dy.shape == (2, 4)


def test_lonlat_to_healpix_invalid():
"""Check that if we pass NaN values for example, the index is set to -1"""
ipix = lonlat_to_healpix(np.nan * u.deg, np.nan * u.deg,
nside=1, order='nested')
assert ipix == -1


@pytest.mark.parametrize('function', [nested_to_ring, ring_to_nested])
def test_nested_ring_shape(function):
index = function(1, 8)
Expand Down

0 comments on commit e5299c6

Please sign in to comment.