20 namespace afwMath = lsst::afw::math;
22 namespace pexLogging = lsst::pex::logging;
23 namespace pexExcept = lsst::pex::exceptions;
56 template<
typename PixelT>
60 afwMath::CandidateVisitor(),
65 template<
typename PixelT>
69 std::vector<typename ImageT::Ptr> eigenImages =
_imagePca->getEigenImages();
70 int ncomp = eigenImages.size();
78 for (
int i = 0; i < ncomp; i++) {
89 template<
typename PixelT>
93 if (kCandidate == NULL) {
95 "Failed to cast SpatialCellCandidate to KernelCandidate");
97 pexLogging::TTrace<6>(
"lsst.ip.diffim.SetPcaImageVisitor.processCandidate",
98 "Processing candidate %d", kCandidate->
getId());
113 template<
typename PixelT>
138 pexLogging::TTrace<6>(
"lsst.ip.diffim.KernelPcaVisitor.subtractMean",
139 "Subtracting mean feature before Pca");
144 end = imageList.end(); ptr != end; ++ptr) {
163 template <
typename ImageT>
169 typename Super::ImageList::const_iterator
iter = eImageList.begin(), end = eImageList.end();
170 for (
size_t i = 0; iter != end; ++i, ++
iter) {
181 double const extreme = (fabs(min) > max) ? min :max;
182 if (extreme != 0.0) {
An include file to include the public header files for lsst::afw::math.
Class stored in SpatialCells for spatial Kernel fitting.
definition of the Trace messaging facilities
A class to run a PCA on all candidate kernels (represented as Images).
void processCandidate(lsst::afw::math::SpatialCellCandidate *candidate)
table::Key< table::Array< Kernel::Pixel > > image
lsst::afw::math::KernelList getEigenKernels()
double getValue(Property const prop=NOTHING) const
Return the value of the desired property (if specified in the constructor)
An include file to include the header files for lsst::afw::image.
boost::shared_ptr< Kernel > Ptr
int getId() const
Return the candidate's unique ID.
Overrides the analyze method of base class afwImage::ImagePca.
Declaration of KernelPca and KernelPcaVisitor.
std::vector< typename ImageT::Ptr > ImageList
Class used by SpatialModelCell for spatial Kernel fitting.
boost::shared_ptr< StaticKernelSolution< PixelT > > getKernelSolution(CandidateSwitch cand) const
#define LSST_EXCEPT(type,...)
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
KernelPcaVisitor(boost::shared_ptr< KernelPca< ImageT > > imagePca)
A class to represent a 2-dimensional array of pixels.
virtual void analyze()
Generate eigenimages that are normalised.
PsfImagePca< MaskedImageT > * _imagePca
A kernel created from an Image.
std::vector< boost::shared_ptr< Kernel > > KernelList