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
Public Types | Public Member Functions | Private Types | List of all members
lsst::ip::diffim::detail::KernelPca< ImageT > Class Template Reference

Overrides the analyze method of base class afwImage::ImagePca. More...

#include <KernelPca.h>

Inheritance diagram for lsst::ip::diffim::detail::KernelPca< ImageT >:
lsst::afw::image::ImagePca< ImageT >

Public Types

typedef boost::shared_ptr
< KernelPca< ImageT > > 
Ptr
 
- Public Types inherited from lsst::afw::image::ImagePca< ImageT >
typedef boost::shared_ptr< ImageT > Ptr
 
typedef boost::shared_ptr
< const ImageT > 
ConstPtr
 
typedef std::vector< typename
ImageT::Ptr > 
ImageList
 

Public Member Functions

 KernelPca (bool constantWeight=true)
 Ctor. More...
 
virtual void analyze ()
 Generate eigenimages that are normalised. More...
 
- Public Member Functions inherited from lsst::afw::image::ImagePca< ImageT >
 ImagePca (bool constantWeight=true)
 ctor More...
 
virtual ~ImagePca ()
 
void addImage (typename ImageT::Ptr img, double flux=0.0)
 
ImageList getImageList () const
 Return the list of images being analyzed. More...
 
geom::Extent2I const getDimensions () const
 Return the dimension of the images being analyzed. More...
 
ImageT::Ptr getMean () const
 
virtual double updateBadPixels (unsigned long mask, int const ncomp)
 
std::vector< double > const & getEigenValues () const
 Return Eigen values. More...
 
ImageList const & getEigenImages () const
 Return Eigen images. More...
 

Private Types

typedef
lsst::afw::image::ImagePca
< ImageT > 
Super
 Base class. More...
 

Detailed Description

template<typename ImageT>
class lsst::ip::diffim::detail::KernelPca< ImageT >

Overrides the analyze method of base class afwImage::ImagePca.

Note
Templated on the Image types it is running on (typically [exclusively?] afwMath::Kernel::Pixel, which is double)
This override normalizes the resulting eigenImages to have peak value of 1.0.

Definition at line 24 of file KernelPca.h.

Member Typedef Documentation

template<typename ImageT>
typedef boost::shared_ptr<KernelPca<ImageT> > lsst::ip::diffim::detail::KernelPca< ImageT >::Ptr

Definition at line 27 of file KernelPca.h.

template<typename ImageT>
typedef lsst::afw::image::ImagePca<ImageT> lsst::ip::diffim::detail::KernelPca< ImageT >::Super
private

Base class.

Definition at line 25 of file KernelPca.h.

Constructor & Destructor Documentation

template<typename ImageT>
lsst::ip::diffim::detail::KernelPca< ImageT >::KernelPca ( bool  constantWeight = true)
inlineexplicit

Ctor.

Definition at line 33 of file KernelPca.h.

33 : Super(constantWeight) {}
lsst::afw::image::ImagePca< ImageT > Super
Base class.
Definition: KernelPca.h:25

Member Function Documentation

template<typename ImageT >
void lsst::ip::diffim::detail::KernelPca< ImageT >::analyze ( )
virtual

Generate eigenimages that are normalised.

Reimplemented from lsst::afw::image::ImagePca< ImageT >.

Definition at line 164 of file KernelPca.cc.

165  {
166  Super::analyze();
167 
168  typename Super::ImageList const &eImageList = this->getEigenImages();
169  typename Super::ImageList::const_iterator iter = eImageList.begin(), end = eImageList.end();
170  for (size_t i = 0; iter != end; ++i, ++iter) {
171  PTR(ImageT) eImage = *iter;
172 
173  /*
174  * Normalise eigenImages to have a maximum of 1.0. For n > 0 they
175  * (should) have mean == 0, so we can't use that to normalize
176  */
177  afwMath::Statistics stats = afwMath::makeStatistics(*eImage, (afwMath::MIN | afwMath::MAX));
178  double const min = stats.getValue(afwMath::MIN);
179  double const max = stats.getValue(afwMath::MAX);
180 
181  double const extreme = (fabs(min) > max) ? min :max;
182  if (extreme != 0.0) {
183  *eImage /= extreme;
184  }
185  }
186  }
int iter
estimate sample minimum
Definition: Statistics.h:76
#define PTR(...)
Definition: base.h:41
estimate sample maximum
Definition: Statistics.h:77
ImageList const & getEigenImages() const
Return Eigen images.
Definition: ImagePca.h:70
if(width!=gim.getWidth()||height!=gim.getHeight()||x0!=gim.getX0()||y0!=gim.getY0())
Definition: saturated.cc:47
std::vector< typename ImageT::Ptr > ImageList
Definition: ImagePca.h:52
virtual void analyze()
Definition: ImagePca.cc:135
Statistics makeStatistics(afwImage::Mask< afwImage::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl)
Specialization to handle Masks.
Definition: Statistics.cc:1082

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