LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::ip::diffim::KernelCandidate< _PixelT > Class Template Reference

Class stored in SpatialCells for spatial Kernel fitting. More...

#include <KernelCandidate.h>

Inheritance diagram for lsst::ip::diffim::KernelCandidate< _PixelT >:
lsst::afw::math::SpatialCellImageCandidate lsst::afw::math::SpatialCellCandidate

Public Types

enum  CandidateSwitch { ORIG = 0 , PCA = 1 , RECENT = 2 }
 
typedef afw::image::Image< afw::math::Kernel::PixelImageT
 
typedef _PixelT PixelT
 
typedef std::shared_ptr< KernelCandidatePtr
 
typedef std::shared_ptr< afw::image::MaskedImage< PixelT > > MaskedImagePtr
 
typedef std::shared_ptr< afw::image::Image< afw::image::VariancePixel > > VariancePtr
 
typedef std::shared_ptr< afw::table::SourceRecordSourcePtr
 
enum  Status { BAD = 0 , GOOD = 1 , UNKNOWN = 2 }
 

Public Member Functions

 KernelCandidate (float const xCenter, float const yCenter, MaskedImagePtr const &templateMaskedImage, MaskedImagePtr const &scienceMaskedImage, daf::base::PropertySet const &ps)
 Constructor.
 
 KernelCandidate (SourcePtr const &source, MaskedImagePtr const &templateMaskedImage, MaskedImagePtr const &scienceMaskedImage, daf::base::PropertySet const &ps)
 Constructor.
 
virtual ~KernelCandidate ()
 Destructor.
 
double getCandidateRating () const
 Return Candidate rating.
 
SourcePtr getSource () const
 Return the original source.
 
MaskedImagePtr getTemplateMaskedImage ()
 Return pointers to the image pixels used in kernel determination.
 
MaskedImagePtr getScienceMaskedImage ()
 
std::shared_ptr< afw::math::KernelgetKernel (CandidateSwitch cand) const
 Return results of kernel solution.
 
double getBackground (CandidateSwitch cand) const
 
double getKsum (CandidateSwitch cand) const
 
std::shared_ptr< ImageTgetKernelImage (CandidateSwitch cand) const
 
std::shared_ptr< ImageT const > getImage () const
 
std::shared_ptr< StaticKernelSolution< PixelT > > getKernelSolution (CandidateSwitch cand) const
 
afw::image::MaskedImage< PixelTgetDifferenceImage (CandidateSwitch cand)
 Calculate associated difference image using internal solutions.
 
afw::image::MaskedImage< PixelTgetDifferenceImage (std::shared_ptr< afw::math::Kernel > kernel, double background)
 Calculate associated difference image using input kernel and background.
 
bool isInitialized () const
 
void build (afw::math::KernelList const &basisList)
 Core functionality of KernelCandidate, to build and fill a KernelSolution.
 
void build (afw::math::KernelList const &basisList, Eigen::MatrixXd const &hMat)
 
double getChi2 () const
 Return the candidate's chi^2.
 
void setChi2 (double chi2)
 Set the candidate's chi^2.
 
float getXCenter () const
 Return the object's column-centre.
 
float getYCenter () const
 Return the object's row-centre.
 
virtual bool instantiate ()
 Do anything needed to make this candidate usable.
 
virtual void setCandidateRating (double)
 Set the candidate's rating.
 
int getId () const
 Return the candidate's unique ID.
 
Status getStatus () const
 Return the candidate's status.
 
void setStatus (Status status)
 Set the candidate's status.
 
virtual bool isBad () const
 Is this candidate unacceptable?
 

Static Public Member Functions

static void setWidth (int width)
 Set the width of the image that getImage should return.
 
static int getWidth ()
 Return the width of the image that getImage should return.
 
static void setHeight (int height)
 Set the height of the image that getImage should return.
 
static int getHeight ()
 Return the height of the image that getImage should return.
 

Detailed Description

template<typename _PixelT>
class lsst::ip::diffim::KernelCandidate< _PixelT >

Class stored in SpatialCells for spatial Kernel fitting.

Note
KernelCandidate is a single Kernel derived around a source. We'll assign them to sets of SpatialCells; these sets will then be used to fit a spatial model to the Kernel.

Definition at line 39 of file KernelCandidate.h.

Member Typedef Documentation

◆ ImageT

template<typename _PixelT >
typedef afw::image::Image<afw::math::Kernel::Pixel> lsst::ip::diffim::KernelCandidate< _PixelT >::ImageT

Definition at line 41 of file KernelCandidate.h.

◆ MaskedImagePtr

template<typename _PixelT >
typedef std::shared_ptr<afw::image::MaskedImage<PixelT> > lsst::ip::diffim::KernelCandidate< _PixelT >::MaskedImagePtr

Definition at line 45 of file KernelCandidate.h.

◆ PixelT

template<typename _PixelT >
typedef _PixelT lsst::ip::diffim::KernelCandidate< _PixelT >::PixelT

Definition at line 42 of file KernelCandidate.h.

◆ Ptr

template<typename _PixelT >
typedef std::shared_ptr<KernelCandidate> lsst::ip::diffim::KernelCandidate< _PixelT >::Ptr

Definition at line 44 of file KernelCandidate.h.

◆ SourcePtr

template<typename _PixelT >
typedef std::shared_ptr<afw::table::SourceRecord> lsst::ip::diffim::KernelCandidate< _PixelT >::SourcePtr

Definition at line 47 of file KernelCandidate.h.

◆ VariancePtr

template<typename _PixelT >
typedef std::shared_ptr<afw::image::Image<afw::image::VariancePixel> > lsst::ip::diffim::KernelCandidate< _PixelT >::VariancePtr

Definition at line 46 of file KernelCandidate.h.

Member Enumeration Documentation

◆ CandidateSwitch

template<typename _PixelT >
enum lsst::ip::diffim::KernelCandidate::CandidateSwitch
Enumerator
ORIG 
PCA 
RECENT 

Definition at line 49 of file KernelCandidate.h.

◆ Status

Enumerator
BAD 
GOOD 
UNKNOWN 

Definition at line 72 of file SpatialCell.h.

Constructor & Destructor Documentation

◆ KernelCandidate() [1/2]

template<typename PixelT >
lsst::ip::diffim::KernelCandidate< PixelT >::KernelCandidate ( float const xCenter,
float const yCenter,
MaskedImagePtr const & templateMaskedImage,
MaskedImagePtr const & scienceMaskedImage,
daf::base::PropertySet const & ps )

Constructor.

Parameters
xCenterCol position of object
yCenterRow position of object
templateMaskedImagePointer to template image
scienceMaskedImagePointer to science image
psPropertySet

Definition at line 32 of file KernelCandidate.cc.

37 _templateMaskedImage(templateMaskedImage),
38 _scienceMaskedImage(scienceMaskedImage),
39 _varianceEstimate(),
40 _ps(ps.deepCopy()),
41 _source(),
42 _coreFlux(),
43 _isInitialized(false),
44 _useRegularization(false),
45 _fitForBackground(ps.getAsBool("fitForBackground")),
46 _kernelSolutionOrig(),
47 _kernelSolutionPca() {
48 /* Rank by mean core S/N in science image */
49 ImageStatistics<PixelT> imstats(ps);
50 int candidateCoreRadius = _ps->getAsInt("candidateCoreRadius");
51 try {
52 imstats.apply(*_scienceMaskedImage, candidateCoreRadius);
53 } catch (pexExcept::Exception& e) {
54 LOGL_DEBUG("TRACE2.ip.diffim.KernelCandidate",
55 "Unable to calculate core imstats for rating Candidate %d", this->getId());
56 this->setStatus(afwMath::SpatialCellCandidate::BAD);
57 return;
58 }
59
60 _coreFlux = imstats.getMean();
61 LOGL_DEBUG("TRACE4.ip.diffim.KernelCandidate", "Candidate %d at %.2f %.2f with rating %.2f",
62 this->getId(), this->getXCenter(), this->getYCenter(), _coreFlux);
63}
#define LOGL_DEBUG(logger, message...)
Log a debug-level message using a varargs/printf style interface.
Definition Log.h:515
float getYCenter() const
Return the object's row-centre.
Definition SpatialCell.h:91
float getXCenter() const
Return the object's column-centre.
Definition SpatialCell.h:88
int getId() const
Return the candidate's unique ID.
void setStatus(Status status)
Set the candidate's status.
Base class for candidate objects in a SpatialCell that are able to return an Image of some sort (e....
Provides consistent interface for LSST exceptions.
Definition Exception.h:107

◆ KernelCandidate() [2/2]

template<typename PixelT >
lsst::ip::diffim::KernelCandidate< PixelT >::KernelCandidate ( SourcePtr const & source,
MaskedImagePtr const & templateMaskedImage,
MaskedImagePtr const & scienceMaskedImage,
daf::base::PropertySet const & ps )

Constructor.

Parameters
sourcePointer to a source to use in constructing the candidate
templateMaskedImagePointer to template image
scienceMaskedImagePointer to science image
psPropertySet

Definition at line 66 of file KernelCandidate.cc.

70 _templateMaskedImage(templateMaskedImage),
71 _scienceMaskedImage(scienceMaskedImage),
72 _varianceEstimate(),
73 _ps(ps.deepCopy()),
74 _source(source),
75 _coreFlux(source->getPsfInstFlux()),
76 _isInitialized(false),
77 _useRegularization(false),
78 _fitForBackground(ps.getAsBool("fitForBackground")),
79 _kernelSolutionOrig(),
80 _kernelSolutionPca() {
81 LOGL_DEBUG("TRACE4.ip.diffim.KernelCandidate", "Candidate %d at %.2f %.2f with rating %.2f",
82 this->getId(), this->getXCenter(), this->getYCenter(), _coreFlux);
83}
const char * source()
Source function that allows astChannel to source from a Stream.
Definition Stream.h:224

◆ ~KernelCandidate()

template<typename _PixelT >
virtual lsst::ip::diffim::KernelCandidate< _PixelT >::~KernelCandidate ( )
inlinevirtual

Destructor.

Definition at line 84 of file KernelCandidate.h.

84{};

Member Function Documentation

◆ build() [1/2]

template<typename PixelT >
void lsst::ip::diffim::KernelCandidate< PixelT >::build ( afw::math::KernelList const & basisList)

Core functionality of KernelCandidate, to build and fill a KernelSolution.

Note
This is an expensive step involving matrix math, and one that may be called multiple times per candidate. Use cases are:

o _isInitialized = false. This is a constructed but not initialized KernelCandidate. When build() is called, M and B are derived from the MaskedImages and the basisList. KernelCandidate owns the knowledge of how to fill this KernelSolution; the solution knows how to solve itself and how to turn that into an output kernel. This solution ends up being _kernelSolution0.

o _isInitialized = true. This is for when build() is re-called using a different basis list, e.g. one based on Pca. We need to use M and B for the spatial modeling, but do not want to override the original KernelSolution. This solution ends up as _kernelSolutionCurrent.

Build KernelSolution matrices for M x = B with regularization matrix H

Note
Modified equation is (Mt.M + lambda H) x = Mt.B with lambda a degree of freedom describing the "strength" of the regularization. The larger the value of lambda, the smoother the kernel, but the larger the residuals in the difference image.
A value of lambda = Trace(Mt.M) / Tr(H) will yield essentially equivalent power in the kernel smoothness and in the diffim quality. We scale this estimate by lambdaScaling to give more/less consideration to the smoothness of the kernel.

Definition at line 86 of file KernelCandidate.cc.

86 {
87 build(basisList, Eigen::MatrixXd());
88}
void build(afw::math::KernelList const &basisList)
Core functionality of KernelCandidate, to build and fill a KernelSolution.

◆ build() [2/2]

template<typename PixelT >
void lsst::ip::diffim::KernelCandidate< PixelT >::build ( afw::math::KernelList const & basisList,
Eigen::MatrixXd const & hMat )

Definition at line 91 of file KernelCandidate.cc.

92 {
93 /* Examine the property set for control over the variance estimate */
95 afwImage::Image<afwImage::VariancePixel>(*(_scienceMaskedImage->getVariance()), true);
96 /* Variance estimate comes from sum of image variances */
97 var += (*(_templateMaskedImage->getVariance()));
98
99 if (_ps->getAsBool("constantVarianceWeighting")) {
100 /* Constant variance weighting */
102 float varValue;
103 if (varStats.getValue(afwMath::MEDIAN) <= 0.0)
104 varValue = 1.0;
105 else
106 varValue = varStats.getValue(afwMath::MEDIAN);
107 LOGL_DEBUG("TRACE4.ip.diffim.KernelCandidate", "Candidate %d using constant variance of %.2f",
108 this->getId(), varValue);
109 var = varValue;
110 }
111
112 _varianceEstimate = VariancePtr(new afwImage::Image<afwImage::VariancePixel>(var));
113
114 try {
115 _buildKernelSolution(basisList, hMat);
116 } catch (pexExcept::Exception& e) {
117 throw e;
118 }
119
120 if (_ps->getAsBool("iterateSingleKernel") && (!(_ps->getAsBool("constantVarianceWeighting")))) {
122 _varianceEstimate = diffim.getVariance();
123
124 try {
125 _buildKernelSolution(basisList, hMat);
126 } catch (pexExcept::Exception& e) {
127 throw e;
128 }
129 }
130
131 _isInitialized = true;
132}
A class to represent a 2-dimensional array of pixels.
Definition Image.h:51
A class to manipulate images, masks, and variance as a single object.
Definition MaskedImage.h:74
VariancePtr getVariance() const
Return a (shared_ptr to) the MaskedImage's variance.
A class to evaluate image statistics.
Definition Statistics.h:222
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
std::shared_ptr< afw::image::Image< afw::image::VariancePixel > > VariancePtr
afw::image::MaskedImage< PixelT > getDifferenceImage(CandidateSwitch cand)
Calculate associated difference image using internal solutions.
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Definition Statistics.h:361
@ MEDIAN
estimate sample median
Definition Statistics.h:60

◆ getBackground()

template<typename PixelT >
double lsst::ip::diffim::KernelCandidate< PixelT >::getBackground ( CandidateSwitch cand) const

Definition at line 247 of file KernelCandidate.cc.

247 {
248 switch (cand) {
250 if (_kernelSolutionOrig)
251 return _kernelSolutionOrig->getBackground();
252 else
253 throw LSST_EXCEPT(pexExcept::RuntimeError, "Original kernel does not exist");
254 break;
256 if (_kernelSolutionPca)
257 return _kernelSolutionPca->getBackground();
258 else
259 throw LSST_EXCEPT(pexExcept::RuntimeError, "Pca kernel does not exist");
260 break;
262 if (_kernelSolutionPca)
263 return _kernelSolutionPca->getBackground();
264 else if (_kernelSolutionOrig)
265 return _kernelSolutionOrig->getBackground();
266 else
267 throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
268 break;
269 default:
270 throw std::logic_error("Invalid CandidateSwitch, cannot get background");
271 }
272}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
Reports errors that are due to events beyond the control of the program.
Definition Runtime.h:104

◆ getCandidateRating()

template<typename _PixelT >
double lsst::ip::diffim::KernelCandidate< _PixelT >::getCandidateRating ( ) const
inlinevirtual

Return Candidate rating.

Note
Required method for use by SpatialCell; e.g. total flux

Implements lsst::afw::math::SpatialCellCandidate.

Definition at line 91 of file KernelCandidate.h.

91{ return _coreFlux; }

◆ getChi2()

double lsst::afw::math::SpatialCellImageCandidate::getChi2 ( ) const
inlineinherited

Return the candidate's chi^2.

Definition at line 146 of file SpatialCell.h.

146{ return _chi2; }

◆ getDifferenceImage() [1/2]

Calculate associated difference image using internal solutions.

Definition at line 366 of file KernelCandidate.cc.

366 {
367 switch (cand) {
369 if (_kernelSolutionOrig)
370 return getDifferenceImage(_kernelSolutionOrig->getKernel(),
371 _kernelSolutionOrig->getBackground());
372 else
373 throw LSST_EXCEPT(pexExcept::RuntimeError, "Original kernel does not exist");
374 break;
376 if (_kernelSolutionPca)
377 return getDifferenceImage(_kernelSolutionPca->getKernel(),
378 _kernelSolutionPca->getBackground());
379 else
380 throw LSST_EXCEPT(pexExcept::RuntimeError, "Pca kernel does not exist");
381 break;
383 if (_kernelSolutionPca)
384 return getDifferenceImage(_kernelSolutionPca->getKernel(),
385 _kernelSolutionPca->getBackground());
386 else if (_kernelSolutionOrig)
387 return getDifferenceImage(_kernelSolutionOrig->getKernel(),
388 _kernelSolutionOrig->getBackground());
389 else
390 throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
391 break;
392 default:
393 throw std::logic_error("Invalid CandidateSwitch, cannot get diffim");
394 }
395}

◆ getDifferenceImage() [2/2]

template<typename PixelT >
lsst::afw::image::MaskedImage< PixelT > lsst::ip::diffim::KernelCandidate< PixelT >::getDifferenceImage ( std::shared_ptr< afw::math::Kernel > kernel,
double background )

Calculate associated difference image using input kernel and background.

Note
Useful for spatial modeling

Definition at line 398 of file KernelCandidate.cc.

399 {
400 /* Make diffim and set chi2 from result */
402 convolveAndSubtract(*_templateMaskedImage, *_scienceMaskedImage, *kernel, background);
403 return diffIm;
404}
lsst::afw::image::MaskedImage< PixelT > convolveAndSubtract(lsst::afw::image::MaskedImage< PixelT > const &templateImage, lsst::afw::image::MaskedImage< PixelT > const &scienceMaskedImage, lsst::afw::math::Kernel const &convolutionKernel, BackgroundT background, bool invert=true)
Execute fundamental task of convolving template and subtracting it from science image.

◆ getHeight()

static int lsst::afw::math::SpatialCellImageCandidate::getHeight ( )
inlinestaticinherited

Return the height of the image that getImage should return.

Definition at line 143 of file SpatialCell.h.

143{ return _height; }

◆ getId()

int lsst::afw::math::SpatialCellCandidate::getId ( ) const
inlineinherited

Return the candidate's unique ID.

Definition at line 102 of file SpatialCell.h.

102{ return _id; }

◆ getImage()

template<typename PixelT >
std::shared_ptr< typename KernelCandidate< PixelT >::ImageT const > lsst::ip::diffim::KernelCandidate< PixelT >::getImage ( ) const

Definition at line 332 of file KernelCandidate.cc.

332 {
334}
std::shared_ptr< ImageT > getKernelImage(CandidateSwitch cand) const

◆ getKernel()

Return results of kernel solution.

Definition at line 219 of file KernelCandidate.cc.

219 {
220 switch (cand) {
222 if (_kernelSolutionOrig)
223 return _kernelSolutionOrig->getKernel();
224 else
225 throw LSST_EXCEPT(pexExcept::RuntimeError, "Original kernel does not exist");
226 break;
228 if (_kernelSolutionPca)
229 return _kernelSolutionPca->getKernel();
230 else
231 throw LSST_EXCEPT(pexExcept::RuntimeError, "Pca kernel does not exist");
232 break;
234 if (_kernelSolutionPca)
235 return _kernelSolutionPca->getKernel();
236 else if (_kernelSolutionOrig)
237 return _kernelSolutionOrig->getKernel();
238 else
239 throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
240 break;
241 default:
242 throw std::logic_error("Invalid CandidateSwitch, cannot get kernel");
243 }
244}

◆ getKernelImage()

template<typename PixelT >
std::shared_ptr< typename KernelCandidate< PixelT >::ImageT > lsst::ip::diffim::KernelCandidate< PixelT >::getKernelImage ( CandidateSwitch cand) const

Definition at line 303 of file KernelCandidate.cc.

304 {
305 switch (cand) {
307 if (_kernelSolutionOrig)
308 return _kernelSolutionOrig->makeKernelImage();
309 else
310 throw LSST_EXCEPT(pexExcept::RuntimeError, "Original kernel does not exist");
311 break;
313 if (_kernelSolutionPca)
314 return _kernelSolutionPca->makeKernelImage();
315 else
316 throw LSST_EXCEPT(pexExcept::RuntimeError, "Pca kernel does not exist");
317 break;
319 if (_kernelSolutionPca)
320 return _kernelSolutionPca->makeKernelImage();
321 else if (_kernelSolutionOrig)
322 return _kernelSolutionOrig->makeKernelImage();
323 else
324 throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
325 break;
326 default:
327 throw std::logic_error("Invalid CandidateSwitch, cannot get kernel image");
328 }
329}

◆ getKernelSolution()

template<typename PixelT >
std::shared_ptr< StaticKernelSolution< PixelT > > lsst::ip::diffim::KernelCandidate< PixelT >::getKernelSolution ( CandidateSwitch cand) const

Definition at line 337 of file KernelCandidate.cc.

338 {
339 switch (cand) {
341 if (_kernelSolutionOrig)
342 return _kernelSolutionOrig;
343 else
344 throw LSST_EXCEPT(pexExcept::RuntimeError, "Original kernel does not exist");
345 break;
347 if (_kernelSolutionPca)
348 return _kernelSolutionPca;
349 else
350 throw LSST_EXCEPT(pexExcept::RuntimeError, "Pca kernel does not exist");
351 break;
353 if (_kernelSolutionPca)
354 return _kernelSolutionPca;
355 else if (_kernelSolutionOrig)
356 return _kernelSolutionOrig;
357 else
358 throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
359 break;
360 default:
361 throw std::logic_error("Invalid CandidateSwitch, cannot get solution");
362 }
363}

◆ getKsum()

template<typename PixelT >
double lsst::ip::diffim::KernelCandidate< PixelT >::getKsum ( CandidateSwitch cand) const

Definition at line 275 of file KernelCandidate.cc.

275 {
276 switch (cand) {
278 if (_kernelSolutionOrig)
279 return _kernelSolutionOrig->getKsum();
280 else
281 throw LSST_EXCEPT(pexExcept::RuntimeError, "Original kernel does not exist");
282 break;
284 if (_kernelSolutionPca)
285 return _kernelSolutionPca->getKsum();
286 else
287 throw LSST_EXCEPT(pexExcept::RuntimeError, "Pca kernel does not exist");
288 break;
290 if (_kernelSolutionPca)
291 return _kernelSolutionPca->getKsum();
292 else if (_kernelSolutionOrig)
293 return _kernelSolutionOrig->getKsum();
294 else
295 throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
296 break;
297 default:
298 throw std::logic_error("Invalid CandidateSwitch, cannot get kSum");
299 }
300}

◆ getScienceMaskedImage()

template<typename _PixelT >
MaskedImagePtr lsst::ip::diffim::KernelCandidate< _PixelT >::getScienceMaskedImage ( )
inline

Definition at line 100 of file KernelCandidate.h.

100{return _scienceMaskedImage;}

◆ getSource()

template<typename _PixelT >
SourcePtr lsst::ip::diffim::KernelCandidate< _PixelT >::getSource ( ) const
inline

Return the original source.

Definition at line 95 of file KernelCandidate.h.

95{ return _source; }

◆ getStatus()

Status lsst::afw::math::SpatialCellCandidate::getStatus ( ) const
inlineinherited

Return the candidate's status.

Definition at line 104 of file SpatialCell.h.

104{ return _status; }

◆ getTemplateMaskedImage()

template<typename _PixelT >
MaskedImagePtr lsst::ip::diffim::KernelCandidate< _PixelT >::getTemplateMaskedImage ( )
inline

Return pointers to the image pixels used in kernel determination.

Definition at line 99 of file KernelCandidate.h.

99{return _templateMaskedImage;}

◆ getWidth()

static int lsst::afw::math::SpatialCellImageCandidate::getWidth ( )
inlinestaticinherited

Return the width of the image that getImage should return.

Definition at line 138 of file SpatialCell.h.

138{ return _width; }

◆ getXCenter()

float lsst::afw::math::SpatialCellCandidate::getXCenter ( ) const
inlineinherited

Return the object's column-centre.

Definition at line 88 of file SpatialCell.h.

88{ return _xCenter; }

◆ getYCenter()

float lsst::afw::math::SpatialCellCandidate::getYCenter ( ) const
inlineinherited

Return the object's row-centre.

Definition at line 91 of file SpatialCell.h.

91{ return _yCenter; }

◆ instantiate()

virtual bool lsst::afw::math::SpatialCellCandidate::instantiate ( )
inlinevirtualinherited

Do anything needed to make this candidate usable.

Definition at line 94 of file SpatialCell.h.

94{ return true; }

◆ isBad()

virtual bool lsst::afw::math::SpatialCellCandidate::isBad ( ) const
inlinevirtualinherited

Is this candidate unacceptable?

Definition at line 108 of file SpatialCell.h.

108{ return (_status == BAD); }

◆ isInitialized()

template<typename _PixelT >
bool lsst::ip::diffim::KernelCandidate< _PixelT >::isInitialized ( ) const
inline

Definition at line 128 of file KernelCandidate.h.

128{return _isInitialized;}

◆ setCandidateRating()

virtual void lsst::afw::math::SpatialCellCandidate::setCandidateRating ( double )
inlinevirtualinherited

Set the candidate's rating.

Definition at line 99 of file SpatialCell.h.

99{}

◆ setChi2()

void lsst::afw::math::SpatialCellImageCandidate::setChi2 ( double chi2)
inlineinherited

Set the candidate's chi^2.

Definition at line 148 of file SpatialCell.h.

148{ _chi2 = chi2; }

◆ setHeight()

static void lsst::afw::math::SpatialCellImageCandidate::setHeight ( int height)
inlinestaticinherited

Set the height of the image that getImage should return.

Definition at line 141 of file SpatialCell.h.

141{ _height = height; }

◆ setStatus()

void lsst::afw::math::SpatialCellCandidate::setStatus ( Status status)
inherited

Set the candidate's status.

Definition at line 52 of file SpatialCell.cc.

52 {
53 switch (status) {
54 case GOOD:
55 case UNKNOWN:
56 _status = status;
57 return;
58 case BAD:
59 _status = status;
60 return;
61 }
62
64 (boost::format("Saw unknown status %d") % status).str());
65}
Reports invalid arguments.
Definition Runtime.h:66

◆ setWidth()

static void lsst::afw::math::SpatialCellImageCandidate::setWidth ( int width)
inlinestaticinherited

Set the width of the image that getImage should return.

Definition at line 136 of file SpatialCell.h.

136{ _width = width; }

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