lsst.ip.diffim g10313568a2+29323cc9ef
Public Types | Public Member Functions | List of all members
lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT > Class Template Reference

Builds the convolution kernel for a given candidate. More...

#include <BuildSingleKernelVisitor.h>

Inheritance diagram for lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >:
lsst::afw::math::CandidateVisitor

Public Types

typedef std::shared_ptr< BuildSingleKernelVisitor< PixelT > > Ptr
 

Public Member Functions

 BuildSingleKernelVisitor (lsst::afw::math::KernelList const &basisList, lsst::daf::base::PropertySet const &ps)
 
 BuildSingleKernelVisitor (lsst::afw::math::KernelList const &basisList, lsst::daf::base::PropertySet const &ps, Eigen::MatrixXd const &hMat)
 
virtual ~BuildSingleKernelVisitor ()
 
void setSkipBuilt (bool skip)
 
int getNRejected ()
 
int getNProcessed ()
 
void reset ()
 
void processCandidate (lsst::afw::math::SpatialCellCandidate *candidate)
 

Detailed Description

template<typename PixelT>
class lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >

Builds the convolution kernel for a given candidate.

std::shared_ptr<PropertySet> ps(new PropertySet);
ps->set("constantVarianceWeighting", false);
ps->set("iterateSingleKernel", false);
ps->set("singleKernelClipping", true);
ps->set("candidateResidualMeanMax", 0.25);
ps->set("candidateResidualStdMax", 1.25);
detail::BuildSingleKernelVisitor<PixelT> singleKernelFitter(*ps);
int nRejected = -1;
while (nRejected != 0) {
singleKernelFitter.reset();
kernelCells.visitCandidates(&singleKernelFitter, nStarPerCell);
nRejected = singleKernelFitter.getNRejected();
}
Note
Visits each current candidate in a afwMath::SpatialCellSet, and builds its kernel using its build() method. We don't build the kernel for every candidate since this is computationally expensive, only when its the current candidate in the cell. During the course of building the kernel, it also assesses the quality of the difference image. If it is determined to be bad (based on the PropertySet paramters) the candidate is flagged as afwMath::SpatialCellCandidate::BAD; otherwise its marked as afwMath::SpatialCellCandidate::GOOD. Keeps a running sample of all the new candidates it visited that turned out to be bad.
Because this visitor does not have access to the next candidate in the cell, it must be called iteratively until no candidates are rejected. This ensures that the current candidate of every cell has an initialized Kernel. This also requires that this class re-Visit all the cells after any other Visitors with the ability to mark something as BAD.
Because we are frequently re-Visiting entirely GOOD candidates during these iterations, the option of _skipBuilt=true will enable the user to not rebuilt the kernel on every visit.
For the particular use case of creating a Pca basis from the raw kernels, we want to re-Visit each candidate and re-fit the kernel using this Pca basis. This requires the user to setSkipBuilt(false) so that the candidate is reprocessed with this new basis.

Definition at line 30 of file BuildSingleKernelVisitor.h.

Member Typedef Documentation

◆ Ptr

Definition at line 33 of file BuildSingleKernelVisitor.h.

Constructor & Destructor Documentation

◆ BuildSingleKernelVisitor() [1/2]

Parameters
basisListList of basis kernels for resulting LinearCombinationKernel
psps file directing behavior

Definition at line 88 of file BuildSingleKernelVisitor.cc.

◆ BuildSingleKernelVisitor() [2/2]

template<typename PixelT >
lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >::BuildSingleKernelVisitor ( lsst::afw::math::KernelList const &  basisList,
lsst::daf::base::PropertySet const &  ps,
Eigen::MatrixXd const &  hMat 
)
Parameters
basisListList of basis kernels for resulting LinearCombinationKernel
psps file directing behavior
hMatRegularization matrix

Definition at line 107 of file BuildSingleKernelVisitor.cc.

◆ ~BuildSingleKernelVisitor()

Definition at line 44 of file BuildSingleKernelVisitor.h.

Member Function Documentation

◆ getNProcessed()

template<typename PixelT >
int lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >::getNProcessed ( )
inline

Definition at line 56 of file BuildSingleKernelVisitor.h.

◆ getNRejected()

template<typename PixelT >
int lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >::getNRejected ( )
inline

Definition at line 55 of file BuildSingleKernelVisitor.h.

◆ processCandidate()

template<typename PixelT >
void lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >::processCandidate ( lsst::afw::math::SpatialCellCandidate candidate)
virtual

Reimplemented from lsst::afw::math::CandidateVisitor.

Definition at line 128 of file BuildSingleKernelVisitor.cc.

◆ reset()

template<typename PixelT >
void lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >::reset ( )
inlinevirtual

Reimplemented from lsst::afw::math::CandidateVisitor.

Definition at line 57 of file BuildSingleKernelVisitor.h.

◆ setSkipBuilt()

template<typename PixelT >
void lsst::ip::diffim::detail::BuildSingleKernelVisitor< PixelT >::setSkipBuilt ( bool  skip)
inline

Definition at line 53 of file BuildSingleKernelVisitor.h.


The documentation for this class was generated from the following files: