diff --git a/src/table/wcsUtils.cc b/src/table/wcsUtils.cc index d1ce67580..8628c74f8 100644 --- a/src/table/wcsUtils.cc +++ b/src/table/wcsUtils.cc @@ -112,13 +112,10 @@ Eigen::Matrix2f calculateCoordCovariance(geom::SkyWcs const &wcs, lsst::geom::Po Eigen::Matrix2f d = localMatrix.cast() * scale * (lsst::geom::PI / 180.0); Eigen::Matrix2f skyCov = d * err * d.transpose(); - - // Multiply by declination correction matrix in order to get sigma(RA) * cos(Dec) for the uncertainty - // in RA, and cov(RA, Dec) * cos(Dec) for the RA/Dec covariance: - float cosDec = std::cos(skyCenter.getDec().asRadians()); - Eigen::Matrix2f decCorr{{cosDec, 0}, {0, 1.0}}; - Eigen::Matrix2f skyCovCorr = decCorr * skyCov * decCorr; - return skyCovCorr; + // Because the transform from pixels to RA/Dec was done at a local + // gnomonic, the RA and Dec covariance are already commensurate, and + // multiplying the RA covariance by cos(Dec) is not necessary. + return skyCov; } template diff --git a/tests/test_sourceTable.py b/tests/test_sourceTable.py index a1aa16979..3a16d4743 100644 --- a/tests/test_sourceTable.py +++ b/tests/test_sourceTable.py @@ -235,12 +235,8 @@ def testCoordErrors(self): centroidErr = self.record.getCentroidErr() coordErr = radMatrix.dot(centroidErr.dot(radMatrix.T)) - # multiply RA by cos(Dec): - cosDec = np.cos(skyCenter.getDec().asRadians()) - decCorr = np.array([[cosDec, 0], [0, 1]]) - coordErrCorr = decCorr.dot(coordErr.dot(decCorr)) catCoordErr = self.record.get(self.coordErrKey) - np.testing.assert_almost_equal(coordErrCorr, catCoordErr, decimal=16) + np.testing.assert_almost_equal(coordErr, catCoordErr, decimal=16) def testSorting(self): self.assertFalse(self.catalog.isSorted())