Skip to content

Commit

Permalink
CoaddPsf: add more exception info
Browse files Browse the repository at this point in the history
A common problem when calling CoaddPsf.computePsfImage() is that
WarpedPsf.computeBBoxFromTransform throws a RangeError stating
'Unexpectedly large transform passed to WarpedPsf'. This is
usually because the astrometry for an input is poor, but it would
be nice to identify *which* input: so add the exposure ID to the
exception message.
  • Loading branch information
PaulPrice committed Sep 25, 2017
1 parent b99accf commit 13aee5c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/CoaddPsf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,15 @@ PTR(afw::detection::Psf::Image) CoaddPsf::doComputeKernelImage(
PTR(afw::geom::XYTransform) xytransform(
new afw::image::XYTransformFromWcsPair(_coaddWcs, exposureRecord.getWcs())
);
WarpedPsf warpedPsf = WarpedPsf(exposureRecord.getPsf(), xytransform, _warpingControl);
PTR(afw::image::Image<double>) componentImg = warpedPsf.computeKernelImage(ccdXY, color);
PTR(afw::image::Image<double>) componentImg;
try {
WarpedPsf warpedPsf = WarpedPsf(exposureRecord.getPsf(), xytransform, _warpingControl);
componentImg = warpedPsf.computeKernelImage(ccdXY, color);
} catch (pex::exceptions::RangeError & exc) {
LSST_EXCEPT_ADD(exc, (boost::format("Computing WarpedPsf kernel image for id=%d") %
exposureRecord.getId()).str());
throw exc;
}
imgVector.push_back(componentImg);
weightSum += exposureRecord.get(_weightKey);
weightVector.push_back(exposureRecord.get(_weightKey));
Expand Down

0 comments on commit 13aee5c

Please sign in to comment.