LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
BuildSingleKernelVisitor.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
12 #ifndef LSST_IP_DIFFIM_BUILDSINGLEKERNELVISITOR_H
13 #define LSST_IP_DIFFIM_BUILDSINGLEKERNELVISITOR_H
14 
15 #include "boost/shared_ptr.hpp"
16 
17 #include "lsst/afw/image.h"
18 #include "lsst/afw/math.h"
19 
20 #include "lsst/pex/policy/Policy.h"
21 
23 
24 namespace lsst {
25 namespace ip {
26 namespace diffim {
27 namespace detail {
28 
29  template<typename PixelT>
32  public:
33  typedef boost::shared_ptr<BuildSingleKernelVisitor<PixelT> > Ptr;
34 
36  lsst::afw::math::KernelList const& basisList,
37  lsst::pex::policy::Policy const& policy
38  );
40  lsst::afw::math::KernelList const& basisList,
41  lsst::pex::policy::Policy const& policy,
42  boost::shared_ptr<Eigen::MatrixXd> hMat
43  );
45 
46  /*
47  Don't reprocess candidate if its already been build. The use
48  case for this functionality is : when iterating over all Cells
49  and rejecting bad Kernels, we need to re-visit *all* Cells to
50  build the next candidate in the list. Without this flag we would
51  unncessarily re-build all the good Kernels.
52  */
53  void setSkipBuilt(bool skip) {_skipBuilt = skip;}
54 
55  int getNRejected() {return _nRejected;}
56  int getNProcessed() {return _nProcessed;}
57  void reset() {_nRejected = 0; _nProcessed = 0;}
58 
60 
61  private:
64  boost::shared_ptr<Eigen::MatrixXd> _hMat;
66  bool _skipBuilt;
67  int _nRejected;
70 
73  };
74 
75  template<typename PixelT>
76  boost::shared_ptr<BuildSingleKernelVisitor<PixelT> >
78  lsst::afw::math::KernelList const& basisList,
79  lsst::pex::policy::Policy const& policy
80  ) {
81 
83  new BuildSingleKernelVisitor<PixelT>(basisList, policy)
84  );
85  }
86 
87  template<typename PixelT>
88  boost::shared_ptr<BuildSingleKernelVisitor<PixelT> >
90  lsst::afw::math::KernelList const& basisList,
91  lsst::pex::policy::Policy const& policy,
92  boost::shared_ptr<Eigen::MatrixXd> hMat
93  ) {
94 
96  new BuildSingleKernelVisitor<PixelT>(basisList, policy, hMat)
97  );
98  }
99 
100 }}}} // end of namespace lsst::ip::diffim::detail
101 
102 #endif
An include file to include the public header files for lsst::afw::math.
lsst::afw::math::KernelList const _basisList
Basis set.
ImageStatistics< PixelT > _imstats
To calculate statistics of difference image.
boost::shared_ptr< Eigen::MatrixXd > _hMat
Regularization matrix.
bool _useRegularization
Regularize if delta function basis.
void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate)
lsst::pex::policy::Policy _policy
Policy controlling behavior.
a container for holding hierarchical configuration data in memory.
Definition: Policy.h:169
bool _skipBuilt
Skip over built candidates during processCandidate()
boost::shared_ptr< BuildSingleKernelVisitor< PixelT > > makeBuildSingleKernelVisitor(lsst::afw::math::KernelList const &basisList, lsst::pex::policy::Policy const &policy)
Builds the convolution kernel for a given candidate.
Image Subtraction helper functions.
lsst::afw::image::MaskedImage< PixelT > MaskedImageT
boost::shared_ptr< BuildSingleKernelVisitor< PixelT > > Ptr
BuildSingleKernelVisitor(lsst::afw::math::KernelList const &basisList, lsst::pex::policy::Policy const &policy)
An include file to include the header files for lsst::afw::image.
A class to manipulate images, masks, and variance as a single object.
Definition: MaskedImage.h:77
Class to calculate difference image statistics.
int _nRejected
Number of candidates rejected during processCandidate()
std::vector< boost::shared_ptr< Kernel > > KernelList
Definition: Kernel.h:542
int _nProcessed
Number of candidates processed during processCandidate()