13#include "boost/timer.hpp"
16#include "Eigen/Cholesky"
72 template<
typename PixelT>
82 int spatialKernelOrder =
ps.getAsInt(
"spatialKernelOrder");
85 int fitForBackground =
ps.getAsBool(
"fitForBackground");
86 int spatialBgOrder = fitForBackground ?
ps.getAsInt(
"spatialBgOrder") : 0;
87 afwMath::Kernel::SpatialFunctionPtr background;
89 std::string spatialModelType =
ps.getAsString(
"spatialModelType");
90 if (spatialModelType ==
"chebyshev1") {
94 background = afwMath::Kernel::SpatialFunctionPtr(
99 else if (spatialModelType ==
"polynomial") {
103 background = afwMath::Kernel::SpatialFunctionPtr(
109 str(boost::format(
"Invalid type (%s) for spatial models") %
120 template<
typename PixelT>
127 "Failed to cast SpatialCellCandidate to KernelCandidate");
130 kCandidate->setStatus(afwMath::SpatialCellCandidate::BAD);
131 LOGL_DEBUG(
"TRACE2.ip.diffim.BuildSpatialKernelVisitor.processCandidate",
132 "Cannot process candidate %d, continuing",
kCandidate->getId());
136 LOGL_DEBUG(
"TRACE5.ip.diffim.BuildSpatialKernelVisitor.processCandidate",
137 "Processing candidate %d",
kCandidate->getId());
145 _kernelSolution->addConstraint(
kCandidate->getXCenter(),
156 template<
typename PixelT>
158 _kernelSolution->solve();
161 template<
typename PixelT>
164 return _kernelSolution->getSolutionPair();
#define LOGL_DEBUG(logger, message...)
Declaration of BuildSpatialKernelVisitor.
#define LSST_EXCEPT(type,...)
Class used by SpatialModelCell for spatial Kernel fitting.
Declaration of classes to store the solution for convolution kernels.
Class stored in SpatialCells for spatial Kernel fitting.
Asseses the quality of a candidate given a spatial kernel and background model.
void solveLinearEquation()
std::pair< std::shared_ptr< lsst::afw::math::LinearCombinationKernel >, lsst::afw::math::Kernel::SpatialFunctionPtr > getSolutionPair()
void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate)
BuildSpatialKernelVisitor(lsst::afw::math::KernelList const &basisList, lsst::geom::Box2I const ®ionBBox, lsst::daf::base::PropertySet const &ps)