64 template<
typename PixelT>
79 template<
typename PixelT>
89 template<
typename PixelT>
96 "Failed to cast SpatialCellCandidate to KernelCandidate");
98 LOGL_DEBUG(
"TRACE5.ip.diffim.KernelSumVisitor.processCandidate",
99 "Processing candidate %d, mode %d",
kCandidate->getId(), _mode);
102 if (_mode == AGGREGATE) {
105 else if (_mode == REJECT) {
106 if (_ps->getAsBool(
"kernelSumClipping")) {
110 if (fabs(
kSum - _kSumMean) > _dkSumMax) {
111 kCandidate->setStatus(afwMath::SpatialCellCandidate::BAD);
112 LOGL_DEBUG(
"TRACE3.ip.diffim.KernelSumVisitor.processCandidate",
113 "Rejecting candidate %d; bad source kernel sum : (%.2f)",
120 LOGL_DEBUG(
"TRACE5.ip.diffim.KernelSumVisitor.processCandidate",
121 "Sigma clipping not enabled");
126 template<
typename PixelT>
128 if (_kSums.size() == 0) {
130 "Unable to determine kernel sum; 0 candidates");
132 else if (_kSums.size() == 1) {
133 LOGL_DEBUG(
"TRACE1.ip.diffim.KernelSumVisitor.processKsumDistribution",
134 "WARNING: only 1 kernel candidate");
136 _kSumMean = _kSums[0];
155 str(boost::format(
"Mean kernel sum returns NaN (%d points)")
160 str(boost::format(
"Kernel sum stdev returns NaN (%d points)")
164 _dkSumMax = _ps->getAsDouble(
"maxKsumSigma") * _kSumStd;
165 LOGL_DEBUG(
"TRACE1.ip.diffim.KernelSumVisitor.processCandidate",
166 "Kernel Sum Distribution : %.3f +/- %.3f (%d points)",
167 _kSumMean, _kSumStd, _kSumNpts);
#define LOGL_DEBUG(logger, message...)
#define LSST_EXCEPT_ADD(e, m)
#define LSST_EXCEPT(type,...)
Class used by SpatialModelCell for spatial Kernel fitting.
Declaration of KernelSumVisitor.
Class stored in SpatialCells for spatial Kernel fitting.
Asseses the quality of a candidate given a spatial kernel and background model.
KernelSumVisitor(lsst::daf::base::PropertySet const &ps)
void processKsumDistribution()
void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate)
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
template std::shared_ptr< KernelSumVisitor< PixelT > > makeKernelSumVisitor< PixelT >(lsst::daf::base::PropertySet const &)