LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
LSSTDataManagementBasePackage
Public Member Functions | Private Member Functions | List of all members
lsst::ip::diffim::NaiveDipoleCentroid Class Reference
Inheritance diagram for lsst::ip::diffim::NaiveDipoleCentroid:
lsst::ip::diffim::DipoleCentroidAlgorithm lsst::meas::algorithms::Algorithm

Public Member Functions

 NaiveDipoleCentroid (NaiveDipoleCentroidControl const &ctrl, afw::table::Schema &schema)
 
- Public Member Functions inherited from lsst::ip::diffim::DipoleCentroidAlgorithm
DipoleCentroidControl const & getControl () const
 Return a clone of the control object used to construct the algorithm. More...
 
KeyTuple const & getPositiveKeys () const
 Return the standard centroid keys registered by this algorithm. More...
 
KeyTuple const & getNegativeKeys () const
 
- Public Member Functions inherited from lsst::meas::algorithms::Algorithm
 Algorithm (AlgorithmControl const &ctrl)
 
virtual ~Algorithm ()
 
AlgorithmControl const & getControl () const
 Return a clone of the control object used to construct the algorithm. More...
 
template<typename PixelT >
void apply (afw::table::SourceRecord &source, afw::image::Exposure< PixelT > const &exposure, afw::geom::Point2D const &center) const
 Run the algorithm, filling appropriate fields in the given source. More...
 

Private Member Functions

template<typename PixelT >
void _apply (afw::table::SourceRecord &source, afw::image::Exposure< PixelT > const &exposure, afw::geom::Point2D const &center) const
 
 LSST_MEAS_ALGORITHM_PRIVATE_INTERFACE (NaiveDipoleCentroid)
 

Additional Inherited Members

- Public Types inherited from lsst::ip::diffim::DipoleCentroidAlgorithm
typedef afw::table::KeyTuple
< afw::table::Centroid
KeyTuple
 Tuple type that holds the keys that define a standard centroid algorithm. More...
 
- Protected Member Functions inherited from lsst::ip::diffim::DipoleCentroidAlgorithm
 DipoleCentroidAlgorithm (DipoleCentroidControl const &ctrl, KeyTuple const &positiveKeys, KeyTuple const &negativeKeys)
 Initialize with a manually-constructed key tuple. More...
 
 DipoleCentroidAlgorithm (DipoleCentroidControl const &ctrl, afw::table::Schema &schema, char const *doc)
 Initialize using afw::table::addCentroid field to fill out repetitive descriptions. More...
 
- Protected Member Functions inherited from lsst::meas::algorithms::Algorithm
template<typename PixelT >
void _apply (afw::table::SourceRecord &source, afw::image::Exposure< PixelT > const &exposure, afw::geom::Point2D const &center) const
 Simulated virtual function that all algorithms must implement. More...
 

Detailed Description

A class that knows how to calculate centroids as a simple unweighted first moment of the 3x3 region around the peaks

Definition at line 79 of file dipoleAlgorithm.cc.

Constructor & Destructor Documentation

lsst::ip::diffim::NaiveDipoleCentroid::NaiveDipoleCentroid ( NaiveDipoleCentroidControl const &  ctrl,
afw::table::Schema schema 
)
inline

Definition at line 82 of file dipoleAlgorithm.cc.

82  :
83  DipoleCentroidAlgorithm(ctrl, schema, "unweighted 3x3 first moment centroid")
84  {}
tbl::Schema schema
Definition: CoaddPsf.cc:324
DipoleCentroidAlgorithm(DipoleCentroidControl const &ctrl, KeyTuple const &positiveKeys, KeyTuple const &negativeKeys)
Initialize with a manually-constructed key tuple.

Member Function Documentation

template<typename PixelT >
void lsst::ip::diffim::NaiveDipoleCentroid::_apply ( afw::table::SourceRecord source,
afw::image::Exposure< PixelT > const &  exposure,
afw::geom::Point2D const &  center 
) const
private

Given an image and a pixel position, return a Centroid using a naive 3x3 weighted moment

Definition at line 189 of file dipoleAlgorithm.cc.

193  {
194  source.set(getPositiveKeys().flag, true); // say we've failed so that's the result if we throw
195  source.set(getNegativeKeys().flag, true); // say we've failed so that's the result if we throw
196 
197  afw::detection::Footprint::PeakList const& peaks = source.getFootprint()->getPeaks();
198 
199  naiveCentroid(source, exposure, peaks[0]->getI(), (peaks[0]->getPeakValue() >= 0 ?
200  getPositiveKeys() :
201  getNegativeKeys()));
202  if (peaks.size() > 1) {
203  naiveCentroid(source, exposure, peaks[1]->getI(), (peaks[1]->getPeakValue() >= 0 ?
204  getPositiveKeys() :
205  getNegativeKeys()));
206  }
207 }
KeyTuple const & getPositiveKeys() const
Return the standard centroid keys registered by this algorithm.
std::vector< Peak::Ptr > PeakList
Definition: Footprint.h:83
KeyTuple const & getNegativeKeys() const
lsst::ip::diffim::NaiveDipoleCentroid::LSST_MEAS_ALGORITHM_PRIVATE_INTERFACE ( NaiveDipoleCentroid  )
private

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