Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-11162: Replace all use of Coord and subclasses with SpherePoint #15

Merged
merged 1 commit into from
Mar 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 1 addition & 19 deletions tests/test_coadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,6 @@ def testAddOne(self):
msg = "coadd != input exposure"
self.assertMaskedImagesAlmostEqual(inMaskedImage, coaddMaskedImage, skipMask=skipMaskArr, msg=msg)

def assertWcsSame(self, wcs1, wcs2):
for xPixPos in (0, 1000, 2000):
for yPixPos in (0, 1000, 2000):
fromPixPos = afwGeom.Point2D(xPixPos, yPixPos)
sky1 = wcs1.pixelToSky(fromPixPos)
sky2 = wcs2.pixelToSky(fromPixPos)
if not np.allclose(sky1.getPosition(), sky2.getPosition()):
self.fail("wcs do not match at fromPixPos=%s: sky1=%s != sky2=%s" %
(fromPixPos, sky1, sky2))
toPixPos1 = wcs1.skyToPixel(sky1)
toPixPos2 = wcs2.skyToPixel(sky1)
if not np.allclose((xPixPos, yPixPos), toPixPos1):
self.fail("wcs do not match at sky1=%s: fromPixPos=%s != toPixPos1=%s" %
(sky1, fromPixPos, toPixPos1))
if not np.allclose(toPixPos1, toPixPos2):
self.fail("wcs do not match at fromPixPos=%s, sky1=%s: toPixPos1=%s != toPixPos2=%s" %
(fromPixPos, sky1, toPixPos1, toPixPos2))

@unittest.skipUnless(AfwdataDir, "afwdata not available")
def testGetters(self):
"""Test getters for coadd
Expand All @@ -124,7 +106,7 @@ def testGetters(self):
badPixelMask += afwImage.Mask.getPlaneBitMask(maskPlaneName)
self.assertEqual(bbox, coadd.getBBox())
self.assertEqual(badPixelMask, coadd.getBadPixelMask())
self.assertWcsSame(wcs, coadd.getWcs())
self.assertWcsAlmostEqualOverBBox(wcs, coadd.getWcs(), coadd.getBBox())

@unittest.skipUnless(AfwdataDir, "afwdata not available")
def testFilters(self):
Expand Down