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 728f35e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/table/wcsUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* see <http://www.lsstcorp.org/LegalNotices/>.
*/

#include <cmath>
#include <memory>
#include <vector>

Expand Down Expand Up @@ -93,6 +94,9 @@ void updateRefCentroids(geom::SkyWcs const &wcs, ReferenceCollection &refList) {

Eigen::Matrix2f calculateCoordCovariance(geom::SkyWcs const &wcs, lsst::geom::Point2D center,
Eigen::Matrix2f err) {
if (!std::isfinite(center.getX()) || !std::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 728f35e

Please sign in to comment.