Skip to content

Commit

Permalink
Merge branch 'tickets/DM-44805'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenam committed Jun 19, 2024
2 parents 998f435 + f9d41df commit 20cdd03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/lsst/meas/astrom/astrometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def solve(self, exposure, sourceCat):
result.stats = self._computeMatchStatsOnSky(result.matches)
maxMatchDistance = result.stats.maxMatchDist.asArcseconds()
distMean = result.stats.distMean.asArcseconds()
distStdDev = result.stats.distMean.asArcseconds()
distStdDev = result.stats.distStdDev.asArcseconds()
self.log.info("Astrometric fit iteration %d: found %d matches with mean separation "
"= %0.3f +- %0.3f arcsec; max match distance = %0.3f arcsec.",
i, len(result.matches), distMean, distStdDev, maxMatchDistance)
Expand Down
11 changes: 11 additions & 0 deletions tests/test_astrometryTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ def doTest(self, pixelsToTanPixels):
# Test that the sources used in the fit are flagged in the catalog.
self.assertEqual(sum(sourceCat["calib_astrometry_used"]), len(results.matches))

# The following tests that the measured mean astrometry offset is not
# equal to its standard deviation (within the default tolerances of
# double-precision epsilon). While this condition is not strictly
# required to be true, in reality it would be highly unlikely and is
# certainly not the case for this test as configured. The motivation
# for adding this check is that it would have caught a refactor that
# mistakenly set them both as the mean.
self.assertFloatsNotEqual(
self.exposure.metadata["SFM_ASTROM_OFFSET_MEAN"], self.exposure.metadata["SFM_ASTROM_OFFSET_STD"]
)

srcCoordKey = afwTable.CoordKey(sourceCat.schema["coord"])
refCoordKey = afwTable.CoordKey(results.refCat.schema["coord"])
refCentroidKey = afwTable.Point2DKey(results.refCat.schema["centroid"])
Expand Down

0 comments on commit 20cdd03

Please sign in to comment.