21 namespace afwMath = lsst::afw::math;
22 namespace pexLogging = lsst::pex::logging;
23 namespace pexPolicy = lsst::pex::policy;
24 namespace pexExcept = lsst::pex::exceptions;
65 template<
typename PixelT>
69 afwMath::CandidateVisitor(),
71 _kSums(std::vector<double>()),
80 template<
typename PixelT>
90 template<
typename PixelT>
95 if (kCandidate == NULL) {
97 "Failed to cast SpatialCellCandidate to KernelCandidate");
99 pexLogging::TTrace<6>(
"lsst.ip.diffim.KernelSumVisitor.processCandidate",
100 "Processing candidate %d, mode %d", kCandidate->
getId(), _mode);
103 if (_mode == AGGREGATE) {
106 else if (_mode == REJECT) {
107 if (_policy.getBool(
"kernelSumClipping")) {
111 if (fabs(kSum - _kSumMean) > _dkSumMax) {
113 pexLogging::TTrace<4>(
"lsst.ip.diffim.KernelSumVisitor.processCandidate",
114 "Rejecting candidate %d; bad source kernel sum : (%.2f)",
121 pexLogging::TTrace<6>(
"lsst.ip.diffim.KernelSumVisitor.processCandidate",
122 "Sigma clipping not enabled");
127 template<
typename PixelT>
129 if (_kSums.size() == 0) {
131 "Unable to determine kernel sum; 0 candidates");
133 else if (_kSums.size() == 1) {
134 pexLogging::TTrace<2>(
"lsst.ip.diffim.KernelSumVisitor.processKsumDistribution",
135 "WARNING: only 1 kernel candidate");
137 _kSumMean = _kSums[0];
161 str(
boost::format(
"Kernel sum stdev returns NaN (%d points)")
165 _dkSumMax = _policy.getDouble(
"maxKsumSigma") * _kSumStd;
166 pexLogging::TTrace<2>(
"lsst.ip.diffim.KernelSumVisitor.processCandidate",
167 "Kernel Sum Distribution : %.3f +/- %.3f (%d points)",
168 _kSumMean, _kSumStd, _kSumNpts);
175 template boost::shared_ptr<KernelSumVisitor<PixelT> >
An include file to include the public header files for lsst::afw::math.
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
estimate sample N-sigma clipped mean (N set in StatisticsControl, default=3)
Class stored in SpatialCells for spatial Kernel fitting.
Implementation of KernelSumVisitor.
a container for holding hierarchical configuration data in memory.
int getId() const
Return the candidate's unique ID.
definition of the Trace messaging facilities
void setStatus(Status status)
Set the candidate's status.
estimate sample N-sigma clipped stdev (N set in StatisticsControl, default=3)
A class to accumulate kernel sums across SpatialCells.
void processKsumDistribution()
void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate)
Class used by SpatialModelCell for spatial Kernel fitting.
boost::shared_ptr< StaticKernelSolution< PixelT > > getKernelSolution(CandidateSwitch cand) const
#define LSST_EXCEPT(type,...)
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
template boost::shared_ptr< KernelSumVisitor< PixelT > > makeKernelSumVisitor< PixelT >(lsst::pex::policy::Policy const &)
KernelSumVisitor(lsst::pex::policy::Policy const &policy)
#define LSST_EXCEPT_ADD(e, m)