lsst.ip.diffim
20.0.0-6-g47d5604+533d6aded8
|
Go to the documentation of this file.
64 template<
typename PixelT>
70 _kSums(
std::vector<double>()),
79 template<
typename PixelT>
89 template<
typename PixelT>
94 if (kCandidate == NULL) {
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) {
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];
146 _kSumMean = stats.
getValue(afwMath::MEANCLIP);
147 _kSumStd = stats.
getValue(afwMath::STDEVCLIP);
148 _kSumNpts =
static_cast<int>(stats.
getValue(afwMath::NPOINT));
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);
KernelSumVisitor(lsst::daf::base::PropertySet const &ps)
void setStatus(Status status)
#define LSST_EXCEPT_ADD(e, m)
Class stored in SpatialCells for spatial Kernel fitting.
template std::shared_ptr< KernelSumVisitor< PixelT > > makeKernelSumVisitor< PixelT >(lsst::daf::base::PropertySet const &)
void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate)
double getValue(Property const prop=NOTHING) const
#define LOGL_DEBUG(logger, message...)
Declaration of KernelSumVisitor.
void processKsumDistribution()
#define LSST_EXCEPT(type,...)
std::shared_ptr< StaticKernelSolution< PixelT > > getKernelSolution(CandidateSwitch cand) const
Class used by SpatialModelCell for spatial Kernel fitting.
A class to accumulate kernel sums across SpatialCells.