diff --git a/src/table/wcsUtils.cc b/src/table/wcsUtils.cc index c46fc6119..ec5f6944f 100644 --- a/src/table/wcsUtils.cc +++ b/src/table/wcsUtils.cc @@ -93,6 +93,9 @@ void updateRefCentroids(geom::SkyWcs const &wcs, ReferenceCollection &refList) { Eigen::Matrix2f calculateCoordCovariance(geom::SkyWcs const &wcs, lsst::geom::Point2D center, Eigen::Matrix2f err) { + if (!isfinite(center.getX()) || !isfinite(center.getY())) { + return Eigen::Matrix2f::Constant(NAN); + } // Get the derivative of the pixel-to-sky transformation, then use it to // propagate the centroid uncertainty to coordinate uncertainty. Note that // the calculation is done in arcseconds, then converted to radians in