12 #ifndef LSST_IP_DIFFIM_KERNELSOLUTION_H
13 #define LSST_IP_DIFFIM_KERNELSOLUTION_H
15 #include "boost/shared_ptr.hpp"
32 typedef boost::shared_ptr<KernelSolution>
Ptr;
50 boost::shared_ptr<Eigen::VectorXd> bVec,
51 bool fitForBackground);
57 virtual void solve(Eigen::MatrixXd mMat,
58 Eigen::VectorXd bVec);
63 inline boost::shared_ptr<Eigen::MatrixXd>
getM() {
return _mMat;}
64 inline boost::shared_ptr<Eigen::VectorXd>
getB() {
return _bVec;}
72 boost::shared_ptr<Eigen::MatrixXd>
_mMat;
73 boost::shared_ptr<Eigen::VectorXd>
_bVec;
74 boost::shared_ptr<Eigen::VectorXd>
_aVec;
81 template <
typename InputT>
84 typedef boost::shared_ptr<StaticKernelSolution<InputT> >
Ptr;
87 bool fitForBackground);
101 virtual std::pair<boost::shared_ptr<lsst::afw::math::Kernel>,
double>
getSolutionPair();
104 boost::shared_ptr<Eigen::MatrixXd>
_cMat;
105 boost::shared_ptr<Eigen::VectorXd>
_iVec;
106 boost::shared_ptr<Eigen::VectorXd>
_ivVec;
117 template <
typename InputT>
120 typedef boost::shared_ptr<MaskedKernelSolution<InputT> >
Ptr;
123 bool fitForBackground);
128 const &varianceEstimate,
134 const &varianceEstimate,
140 const &varianceEstimate,
146 template <
typename InputT>
149 typedef boost::shared_ptr<RegularizedKernelSolution<InputT> >
Ptr;
152 bool fitForBackground,
153 boost::shared_ptr<Eigen::MatrixXd> hMat,
162 boost::shared_ptr<Eigen::MatrixXd>
getM(
bool includeHmat =
true);
165 boost::shared_ptr<Eigen::MatrixXd>
_hMat;
175 typedef boost::shared_ptr<SpatialKernelSolution>
Ptr;
187 boost::shared_ptr<Eigen::MatrixXd> qMat,
188 boost::shared_ptr<Eigen::VectorXd> wVec);
An include file to include the public header files for lsst::afw::math.
boost::shared_ptr< RegularizedKernelSolution< InputT > > Ptr
void _setKernel()
Set kernel after solution.
An include file to include the header files for lsst::afw::geom.
boost::shared_ptr< lsst::afw::math::Function2< double > > SpatialFunctionPtr
virtual lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel >::Ptr makeKernelImage()
a container for holding hierarchical configuration data in memory.
boost::shared_ptr< KernelSolution > Ptr
SpatialKernelSolution(lsst::afw::math::KernelList const &basisList, lsst::afw::math::Kernel::SpatialFunctionPtr spatialKernelFunction, lsst::afw::math::Kernel::SpatialFunctionPtr background, lsst::pex::policy::Policy policy)
boost::shared_ptr< MaskedKernelSolution< InputT > > Ptr
lsst::afw::math::Kernel::Ptr _kernel
Derived single-object convolution kernel.
virtual ~SpatialKernelSolution()
virtual lsst::afw::math::Kernel::Ptr getKernel()
KernelSolvedBy _solvedBy
Type of algorithm used to make solution.
StaticKernelSolution(lsst::afw::math::KernelList const &basisList, bool fitForBackground)
double _background
Derived differential background estimate.
boost::shared_ptr< StaticKernelSolution< InputT > > Ptr
lsst::afw::math::Kernel::Pixel PixelT
boost::shared_ptr< Eigen::VectorXd > getB()
boost::shared_ptr< Image< PixelT > > Ptr
boost::shared_ptr< Eigen::MatrixXd > getM()
boost::shared_ptr< Kernel > Ptr
virtual ~RegularizedKernelSolution()
boost::shared_ptr< SpatialKernelSolution > Ptr
virtual double getBackground()
An integer coordinate rectangle.
void addConstraint(float xCenter, float yCenter, boost::shared_ptr< Eigen::MatrixXd > qMat, boost::shared_ptr< Eigen::VectorXd > wVec)
An include file to include the header files for lsst::afw::image.
virtual void build(lsst::afw::image::Image< InputT > const &templateImage, lsst::afw::image::Image< InputT > const &scienceImage, lsst::afw::image::Image< lsst::afw::image::VariancePixel > const &varianceEstimate)
void _setKernel()
Set kernel after solution.
double _kSum
Derived kernel sum.
static int _SolutionId
Unique identifier for solution.
void _setKernelUncertainty()
Not implemented.
bool _fitForBackground
Background terms included in fit.
lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel > ImageT
virtual double getConditionNumber(ConditionNumberType conditionType)
int _id
Unique ID for object.
boost::shared_ptr< Eigen::VectorXd > _iVec
Vectorized I.
lsst::afw::image::Image< lsst::afw::math::Kernel::Pixel >::Ptr makeKernelImage(lsst::afw::geom::Point2D const &pos)
KernelSolvedBy getSolvedBy()
boost::shared_ptr< Eigen::VectorXd > _bVec
Derived least squares B vector.
virtual void buildOrig(lsst::afw::image::Image< InputT > const &templateImage, lsst::afw::image::Image< InputT > const &scienceImage, lsst::afw::image::Image< lsst::afw::image::VariancePixel > const &varianceEstimate, lsst::afw::image::Mask< lsst::afw::image::MaskPixel > pixelMask)
lsst::afw::math::Kernel::SpatialFunctionPtr _spatialKernelFunction
Spatial function for Kernel.
int _nbt
Number of background terms.
boost::shared_ptr< Eigen::MatrixXd > _hMat
Regularization weights.
bool _constantFirstTerm
Is the first term constant.
lsst::pex::policy::Policy _policy
Policy to control processing.
double _kSum
Derived kernel sum.
lsst::afw::math::LinearCombinationKernel::Ptr _kernel
Spatial convolution kernel.
boost::shared_ptr< Eigen::VectorXd > _aVec
Derived least squares solution matrix.
MaskedKernelSolution(lsst::afw::math::KernelList const &basisList, bool fitForBackground)
lsst::afw::math::Kernel::SpatialFunctionPtr _background
Spatial background model.
RegularizedKernelSolution(lsst::afw::math::KernelList const &basisList, bool fitForBackground, boost::shared_ptr< Eigen::MatrixXd > hMat, lsst::pex::policy::Policy policy)
int _nkt
Number of kernel terms.
boost::shared_ptr< Eigen::MatrixXd > _mMat
Derived least squares M matrix.
std::pair< lsst::afw::math::LinearCombinationKernel::Ptr, lsst::afw::math::Kernel::SpatialFunctionPtr > getSolutionPair()
int _nbases
Number of basis functions.
virtual void buildSingleMaskOrig(lsst::afw::image::Image< InputT > const &templateImage, lsst::afw::image::Image< InputT > const &scienceImage, lsst::afw::image::Image< lsst::afw::image::VariancePixel > const &varianceEstimate, lsst::afw::geom::Box2I maskBox)
virtual std::pair< boost::shared_ptr< lsst::afw::math::Kernel >, double > getSolutionPair()
virtual ~StaticKernelSolution()
virtual void buildWithMask(lsst::afw::image::Image< InputT > const &templateImage, lsst::afw::image::Image< InputT > const &scienceImage, lsst::afw::image::Image< lsst::afw::image::VariancePixel > const &varianceEstimate, lsst::afw::image::Mask< lsst::afw::image::MaskPixel > const &pixelMask)
boost::shared_ptr< Eigen::MatrixXd > _cMat
K_i x R.
double estimateRisk(double maxCond)
double _lambda
Overall regularization strength.
std::vector< boost::shared_ptr< Kernel > > KernelList
lsst::pex::policy::Policy _policy
boost::shared_ptr< Eigen::VectorXd > _ivVec
Inverse variance.
std::vector< double > _createLambdaSteps()
boost::shared_ptr< LinearCombinationKernel > Ptr
virtual ~KernelSolution()
void _setKernelUncertainty()
Not implemented.
virtual ~MaskedKernelSolution()
int _nt
Total number of terms.