15#include "Eigen/Cholesky"
71 template<
typename PixelT>
81 int spatialKernelOrder =
ps.getAsInt(
"spatialKernelOrder");
84 int fitForBackground =
ps.getAsBool(
"fitForBackground");
85 int spatialBgOrder = fitForBackground ?
ps.getAsInt(
"spatialBgOrder") : 0;
86 afwMath::Kernel::SpatialFunctionPtr background;
88 std::string spatialModelType =
ps.getAsString(
"spatialModelType");
89 if (spatialModelType ==
"chebyshev1") {
93 background = afwMath::Kernel::SpatialFunctionPtr(
98 else if (spatialModelType ==
"polynomial") {
102 background = afwMath::Kernel::SpatialFunctionPtr(
108 str(boost::format(
"Invalid type (%s) for spatial models") %
119 template<
typename PixelT>
126 "Failed to cast SpatialCellCandidate to KernelCandidate");
129 kCandidate->setStatus(afwMath::SpatialCellCandidate::BAD);
130 LOGL_DEBUG(
"TRACE2.ip.diffim.BuildSpatialKernelVisitor.processCandidate",
131 "Cannot process candidate %d, continuing",
kCandidate->getId());
135 LOGL_DEBUG(
"TRACE5.ip.diffim.BuildSpatialKernelVisitor.processCandidate",
136 "Processing candidate %d",
kCandidate->getId());
144 _kernelSolution->addConstraint(
kCandidate->getXCenter(),
155 template<
typename PixelT>
157 _kernelSolution->solve();
160 template<
typename PixelT>
163 return _kernelSolution->getSolutionPair();
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.
#define LOGL_DEBUG(logger, message...)
Class stored in SpatialCells for spatial Kernel fitting.
Asseses the quality of a candidate given a spatial kernel and background model.
AssessSpatialKernelVisitor(std::shared_ptr< lsst::afw::math::LinearCombinationKernel > spatialKernel, lsst::afw::math::Kernel::SpatialFunctionPtr spatialBackground, lsst::daf::base::PropertySet const &ps)
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)