Skip to content

Commit

Permalink
Properly handle non-finite position
Browse files Browse the repository at this point in the history
If either position is NaN, the `makeSkyWcs` call further down will fail
because `skyCenter` is also NaN.
  • Loading branch information
parejkoj committed Oct 27, 2023
1 parent b393912 commit ec3b514
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/table/wcsUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec3b514

Please sign in to comment.