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-13297: CoaddBoundedField persistence not exact #358

Merged
merged 2 commits into from
Jun 7, 2018
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions python/lsst/afw/geom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def _compareWcsOverBBox(wcs0, wcs1, bbox, maxDiffSky=0.01*lsst.geom.arcseconds,
if nx < 1 or ny < 1:
raise RuntimeError(
"nx = %s and ny = %s must both be positive" % (nx, ny))
if maxDiffSky <= 0*lsst.geom.arcseconds:
raise RuntimeError("maxDiffSky = %s must be positive" % (maxDiffSky,))
if maxDiffPix <= 0:
raise RuntimeError("maxDiffPix = %s must be positive" % (maxDiffPix,))
if maxDiffSky < 0*lsst.geom.arcseconds:
raise RuntimeError("maxDiffSky = %s must not be negative" % (maxDiffSky,))
if maxDiffPix < 0:
raise RuntimeError("maxDiffPix = %s must not be negative" % (maxDiffPix,))

bboxd = lsst.geom.Box2D(bbox)
xList = np.linspace(bboxd.getMinX(), bboxd.getMaxX(), nx)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def testAssertWcsAlmostEqualOverBBox(self):
wcs1 = lsst.afw.geom.makeSkyWcs(metadata)

self.assertWcsAlmostEqualOverBBox(wcs0, wcs0, bbox,
maxDiffSky=1e-7*lsst.geom.arcseconds, maxDiffPix=1e-7)
maxDiffSky=0*lsst.geom.arcseconds, maxDiffPix=0)
self.assertTrue(afwGeom.wcsAlmostEqualOverBBox(wcs0, wcs0, bbox,
maxDiffSky=1e-7*lsst.geom.arcseconds, maxDiffPix=1e-7))
maxDiffSky=0*lsst.geom.arcseconds, maxDiffPix=0))

self.assertWcsAlmostEqualOverBBox(wcs0, wcs1, bbox,
maxDiffSky=0.04*lsst.geom.arcseconds, maxDiffPix=0.02)
Expand Down
9 changes: 6 additions & 3 deletions tests/test_skyWcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ def checkPersistence(self, skyWcs, bbox):
exposure.writeFits(outFile)
exposureRoundTrip = ExposureF(outFile)
wcsFromExposure = exposureRoundTrip.getWcs()
self.assertWcsAlmostEqualOverBBox(skyWcs, wcsFromExposure, bbox)
self.assertWcsAlmostEqualOverBBox(skyWcs, wcsFromExposure, bbox, maxDiffPix=0,
maxDiffSky=0*lsst.geom.radians)

def checkFrameDictConstructor(self, skyWcs, bbox):
"""Check that the FrameDict constructor works
"""
frameDict = skyWcs.getFrameDict()
wcsFromFrameDict = SkyWcs(frameDict)
self.assertWcsAlmostEqualOverBBox(skyWcs, wcsFromFrameDict, bbox)
self.assertWcsAlmostEqualOverBBox(skyWcs, wcsFromFrameDict, bbox, maxDiffPix=0,
maxDiffSky=0*lsst.geom.radians)

self.checkPersistence(wcsFromFrameDict, bbox)

Expand Down Expand Up @@ -910,7 +912,8 @@ def testReadWriteFits(self):
wcsFromMetadata.writeFits(filePath)
wcsFromFits = SkyWcs.readFits(filePath)

self.assertWcsAlmostEqualOverBBox(wcsFromFits, wcsFromMetadata, self.bbox)
self.assertWcsAlmostEqualOverBBox(wcsFromFits, wcsFromMetadata, self.bbox, maxDiffPix=0,
maxDiffSky=0*lsst.geom.radians)

def testReadOldTanSipFits(self):
"""Test reading a FITS file containing data for an lsst::afw::image::TanWcs
Expand Down