Skip to content

Commit

Permalink
Update tests to use hpgeom instead of healpy.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Jul 21, 2022
1 parent e8aab2b commit 8c50186
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/test_associationUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import healpy as hp
import hpgeom as hpg
import numpy as np
import unittest

Expand All @@ -30,7 +30,7 @@
class TestAssociationUtils(lsst.utils.tests.TestCase):

def test_queryDisc(self):
"""Test that doing a disc query of healpy using our wrapper works as
"""Test that doing a circle query of hpgeom using our wrapper works as
expected.
Most other calculations are very simple and not worth testing.
Expand All @@ -39,8 +39,8 @@ def test_queryDisc(self):
nside = 128
testRa = 225
testDec = 45
centerPixNumber = hp.ang2pix(nside, testRa, testDec, lonlat=True)
ra, dec = hp.pix2ang(nside, centerPixNumber, lonlat=True)
centerPixNumber = hpg.angle_to_pixel(nside, testRa, testDec, nest=False)
ra, dec = hpg.pixel_to_angle(nside, centerPixNumber, nest=False)
# Test that only one pixel is found.
pixelReturn = query_disc(nside, ra, dec, np.radians(0.1))
self.assertEqual(len(pixelReturn), 1)
Expand Down
6 changes: 2 additions & 4 deletions tests/test_hips.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""Test HIPS code."""
import unittest
import numpy as np
import healpy as hp
import hpgeom as hpg

import lsst.utils.tests
import lsst.daf.butler
Expand Down Expand Up @@ -227,12 +227,10 @@ def _get_pixel(self, nside, sphpoint):
pixel : `int`
Healpix pixel (nest ordering)
"""
pixel = hp.ang2pix(
pixel = hpg.angle_to_pixel(
nside,
sphpoint.getRa().asDegrees(),
sphpoint.getDec().asDegrees(),
lonlat=True,
nest=True
)
return pixel

Expand Down

0 comments on commit 8c50186

Please sign in to comment.