Skip to content

Commit

Permalink
Rework what doTest checks WCS against
Browse files Browse the repository at this point in the history
Previously, AstrometryTask would pass if it just kept the WCS on the
exposure the same: the test now starts with a "wrong" (undistorted) WCS
and will fail if the output WCS matches the input (at least for the
testRadial case).
  • Loading branch information
parejkoj committed Apr 23, 2024
1 parent 368a7d4 commit 34449e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_astrometryTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ def doTest(self, pixelsToTanPixels):
task = AstrometryTask(config=config, refObjLoader=self.refObjLoader, schema=schema)
distortedWcs = afwGeom.makeModifiedWcs(pixelTransform=pixelsToTanPixels, wcs=self.tanWcs,
modifyActualPixels=False)
self.exposure.setWcs(distortedWcs)
# Make the source catalog at the distorted positions, but keep the
# initial TAN WCS on the exposure, to check that the fitted WCS
# is close to the distorted one and different from the input.
sourceCat = self.makeSourceCat(distortedWcs, schema)
# This test is from before rough magnitude rejection was implemented.
config.doMagnitudeOutlierRejection = False
results = task.run(sourceCat=sourceCat, exposure=self.exposure)

self.assertWcsAlmostEqualOverBBox(distortedWcs, self.exposure.wcs, self.bbox,
maxDiffSky=0.01*lsst.geom.arcseconds, maxDiffPix=0.02)
maxDiffSky=0.002*lsst.geom.arcseconds, maxDiffPix=0.02)
# Test that the sources used in the fit are flagged in the catalog.
self.assertEqual(sum(sourceCat["calib_astrometry_used"]), len(results.matches))

Expand Down

0 comments on commit 34449e3

Please sign in to comment.