lsst.meas.algorithms  14.0-18-gf7dca964+5
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | List of all members
lsst::meas::algorithms::CoaddPsf Class Reference

CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images. More...

#include <CoaddPsf.h>

Inheritance diagram for lsst::meas::algorithms::CoaddPsf:
lsst::afw::table::io::PersistableFacade< CoaddPsf > lsst::meas::algorithms::ImagePsf lsst::afw::table::io::PersistableFacade< ImagePsf > lsst::afw::detection::Psf lsst::daf::base::Citizen lsst::daf::base::Persistable PersistableFacade< Psf > lsst::afw::table::io::Persistable

Classes

class  Factory
 

Public Types

enum  ImageOwnerEnum
 
typedef math::Kernel::Pixel Pixel
 
typedef image::Image< PixelImage
 
typedef unsigned long memId
 
typedef memId(* memNewCallback) (const memId cid)
 
typedef memId(* memCallback) (const Citizen *ptr)
 
typedef std::shared_ptr< PersistablePtr
 

Public Member Functions

 CoaddPsf (afw::table::ExposureCatalog const &catalog, afw::geom::SkyWcs const &coaddWcs, std::string const &weightFieldName="weight", std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
 Main constructors for CoaddPsf. More...
 
 CoaddPsf (afw::table::ExposureCatalog const &catalog, afw::geom::SkyWcs const &coaddWcs, CoaddPsfControl const &ctrl, std::string const &weightFieldName="weight")
 Constructor for CoaddPsf. More...
 
virtual boost::shared_ptr< afw::detection::Psfclone () const
 Polymorphic deep copy. Usually unnecessary, as Psfs are immutable. More...
 
virtual boost::shared_ptr< afw::detection::Psfresized (int width, int height) const
 Return a clone with specified kernel dimensions. More...
 
virtual afw::geom::Point2D getAveragePosition () const
 Return the average of the positions of the stars that went into this Psf. More...
 
afw::geom::SkyWcs getCoaddWcs ()
 Return the Wcs of the coadd (defines the coordinate system of the Psf). More...
 
int getComponentCount () const
 Return the number of component Psfs in this CoaddPsf. More...
 
boost::shared_ptr< afw::detection::Psf const > getPsf (int index)
 Get the Psf of the component image at index. More...
 
afw::geom::SkyWcs getWcs (int index)
 Get the Wcs of the component image at index. More...
 
double getWeight (int index)
 Get the weight of the component image at index. More...
 
afw::table::RecordId getId (int index)
 Get the exposure ID of the component image at index. More...
 
afw::geom::Box2I getBBox (int index)
 Get the bounding box (in component image Pixel coordinates) of the component image at index. More...
 
boost::shared_ptr< afw::geom::polygon::Polygon const > getValidPolygon (int index)
 Get the validPolygon (in component image Pixel coordinates) of the component image at index. More...
 
virtual bool isPersistable () const
 Return true if the CoaddPsf persistable (always true). More...
 
std::shared_ptr< ImagecomputeImage (geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
 
std::shared_ptr< ImagecomputeKernelImage (geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
 
double computePeak (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 
double computeApertureFlux (double radius, geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 
geom::ellipses::Quadrupole computeShape (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 
std::shared_ptr< math::Kernel const > getLocalKernel (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 
image::Color getAverageColor () const
 
geom::Box2I computeBBox (geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
 
void writeFits (std::string const &fileName, std::string const &mode="w") const
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 
void writeFits (fits::Fits &fitsfile) const
 
std::string repr () const
 
void markPersistent (void)
 
memId getId () const
 
void serialize (Archive &, unsigned int const)
 

Static Public Member Functions

static std::shared_ptr< CoaddPsfreadFits (fits::Fits &fitsfile)
 
static std::shared_ptr< CoaddPsfreadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< CoaddPsfreadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< ImagePsfreadFits (fits::Fits &fitsfile)
 
static std::shared_ptr< ImagePsfreadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< ImagePsfreadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< PsfreadFits (fits::Fits &fitsfile)
 
static std::shared_ptr< PsfreadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< PsfreadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< PsfreadFits (fits::Fits &fitsfile)
 
static std::shared_ptr< PsfreadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 
static std::shared_ptr< ImagerecenterKernelImage (std::shared_ptr< Image > im, geom::Point2D const &position, std::string const &warpAlgorithm="lanczos5", unsigned int warpBuffer=5)
 
static bool hasBeenCorrupted ()
 
static memId getNextMemId ()
 
static int init ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static int census (int, memId startingMemId=0)
 
static void census (std::ostream &stream, memId startingMemId=0)
 
static const std::vector< const Citizen *> * census ()
 
static memId setNewCallbackId (memId id)
 
static memId setNewCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memId setDeleteCallbackId (memId id)
 
static memNewCallback setNewCallback (memNewCallback func)
 
static memCallback setDeleteCallback (memCallback func)
 
static memCallback setCorruptionCallback (memCallback func)
 

Public Attributes

 COPY
 
 INTERNAL
 
 magicSentinel
 

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle
 

Protected Member Functions

boost::shared_ptr< afw::detection::Psf::ImagedoComputeKernelImage (afw::geom::Point2D const &ccdXY, afw::image::Color const &color) const
 
virtual afw::geom::Box2I doComputeBBox (afw::geom::Point2D const &position, afw::image::Color const &color) const
 
virtual std::string getPersistenceName () const
 
virtual std::string getPythonModule () const
 
virtual void write (OutputArchiveHandle &handle) const
 
 CoaddPsf (afw::table::ExposureCatalog const &catalog, afw::geom::SkyWcs const &coaddWcs, afw::geom::Point2D const &averagePosition, std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
 
virtual double doComputeApertureFlux (double radius, afw::geom::Point2D const &position, afw::image::Color const &color) const
 
virtual afw::geom::ellipses::Quadrupole doComputeShape (afw::geom::Point2D const &position, afw::image::Color const &color) const
 
virtual void write (OutputArchiveHandle &handle) const
 

Detailed Description

CoaddPsf is the Psf derived to be used for non-PSF-matched Coadd images.

It incorporates the logic of James Jee's Stackfit algorithm for estimating the Psf of coadd by coadding the images of the Psf models of each input exposure.

Definition at line 58 of file CoaddPsf.h.

Constructor & Destructor Documentation

◆ CoaddPsf() [1/3]

lsst::meas::algorithms::CoaddPsf::CoaddPsf ( afw::table::ExposureCatalog const &  catalog,
afw::geom::SkyWcs const &  coaddWcs,
std::string const &  weightFieldName = "weight",
std::string const &  warpingKernelName = "lanczos3",
int  cacheSize = 10000 
)
explicit

Main constructors for CoaddPsf.

The ExposureCatalog contains info about each visit/ccd in Coadd; this must be provided to the constructor, and cannot be changed.

Parameters
[in]catalogExposureCatalog containing the id, bbox, wcs, psf and weight for each ccd/visit. This is usually the same catalog as the "ccds" catalog in the coadd Exposure's CoaddInputs.
[in]coaddWcsWcs for the coadd.
[in]weightFieldNameField name that contains the weight of the exposure in the coadd; defaults to "weight".
[in]warpingKernelNameName of warping kernel
[in]cacheSizeWarping kernel cache size

Definition at line 142 of file CoaddPsf.cc.

◆ CoaddPsf() [2/3]

lsst::meas::algorithms::CoaddPsf::CoaddPsf ( afw::table::ExposureCatalog const &  catalog,
afw::geom::SkyWcs const &  coaddWcs,
CoaddPsfControl const &  ctrl,
std::string const &  weightFieldName = "weight" 
)
inline

Constructor for CoaddPsf.

The ExposureCatalog contains info about each visit/ccd in Coadd; this must be provided to the constructor, and cannot be changed.

Parameters
[in]catalogExposureCatalog containing the id, bbox, wcs, psf and weight for each ccd/visit. This is usually the same catalog as the "ccds" catalog in the coadd Exposure's CoaddInputs.
[in]coaddWcsWcs for the coadd.
[in]ctrlConfiguration options.
[in]weightFieldNameField name that contains the weight of the exposure in the coadd; defaults to "weight".

Definition at line 98 of file CoaddPsf.h.

◆ CoaddPsf() [3/3]

lsst::meas::algorithms::CoaddPsf::CoaddPsf ( afw::table::ExposureCatalog const &  catalog,
afw::geom::SkyWcs const &  coaddWcs,
afw::geom::Point2D const &  averagePosition,
std::string const &  warpingKernelName = "lanczos3",
int  cacheSize = 10000 
)
explicitprotected
Parameters
catalogUnpersisted catalog
coaddWcsWCS for the coadd
averagePositionDefault position for accessors
warpingKernelNameWarping kernel name
cacheSizeKernel cache size

Definition at line 464 of file CoaddPsf.cc.

Member Function Documentation

◆ clone()

boost::shared_ptr< afw::detection::Psf > lsst::meas::algorithms::CoaddPsf::clone ( void  ) const
virtual

Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.

Implements lsst::afw::detection::Psf.

Definition at line 176 of file CoaddPsf.cc.

◆ doComputeApertureFlux()

double lsst::meas::algorithms::ImagePsf::doComputeApertureFlux ( double  radius,
afw::geom::Point2D const &  position,
afw::image::Color const &  color 
) const
protectedvirtualinherited

Definition at line 31 of file ImagePsf.cc.

◆ doComputeBBox()

afw::geom::Box2I lsst::meas::algorithms::CoaddPsf::doComputeBBox ( afw::geom::Point2D const &  position,
afw::image::Color const &  color 
) const
protectedvirtual

Definition at line 228 of file CoaddPsf.cc.

◆ doComputeKernelImage()

boost::shared_ptr< afw::detection::Psf::Image > lsst::meas::algorithms::CoaddPsf::doComputeKernelImage ( afw::geom::Point2D const &  ccdXY,
afw::image::Color const &  color 
) const
protected

Definition at line 252 of file CoaddPsf.cc.

◆ doComputeShape()

afw::geom::ellipses::Quadrupole lsst::meas::algorithms::ImagePsf::doComputeShape ( afw::geom::Point2D const &  position,
afw::image::Color const &  color 
) const
protectedvirtualinherited

Definition at line 46 of file ImagePsf.cc.

◆ getAveragePosition()

virtual afw::geom::Point2D lsst::meas::algorithms::CoaddPsf::getAveragePosition ( ) const
inlinevirtual

Return the average of the positions of the stars that went into this Psf.

For CoaddPsf, this is calculated as the weighted average of the average positions of all the component Psfs.

Reimplemented from lsst::afw::detection::Psf.

Definition at line 116 of file CoaddPsf.h.

◆ getBBox()

afw::geom::Box2I lsst::meas::algorithms::CoaddPsf::getBBox ( int  index)

Get the bounding box (in component image Pixel coordinates) of the component image at index.

Parameters
[in]indexIndex of component for which the bounding box will be fetched.
Returns
Corresponding bounding box.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 339 of file CoaddPsf.cc.

◆ getCoaddWcs()

afw::geom::SkyWcs lsst::meas::algorithms::CoaddPsf::getCoaddWcs ( )
inline

Return the Wcs of the coadd (defines the coordinate system of the Psf).

Definition at line 119 of file CoaddPsf.h.

◆ getComponentCount()

int lsst::meas::algorithms::CoaddPsf::getComponentCount ( ) const

Return the number of component Psfs in this CoaddPsf.

Definition at line 300 of file CoaddPsf.cc.

◆ getId()

afw::table::RecordId lsst::meas::algorithms::CoaddPsf::getId ( int  index)

Get the exposure ID of the component image at index.

Parameters
[in]indexIndex of component for which the exposure ID will be fetched.
Returns
Corresponding exposure ID.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 332 of file CoaddPsf.cc.

◆ getPersistenceName()

std::string lsst::meas::algorithms::CoaddPsf::getPersistenceName ( ) const
protectedvirtual

Reimplemented from lsst::afw::detection::Psf.

Definition at line 447 of file CoaddPsf.cc.

◆ getPsf()

boost::shared_ptr< afw::detection::Psf const > lsst::meas::algorithms::CoaddPsf::getPsf ( int  index)

Get the Psf of the component image at index.

Parameters
[in]indexIndex of component for which the Psf will be fetched.
Returns
Corresponding Psf.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 304 of file CoaddPsf.cc.

◆ getPythonModule()

std::string lsst::meas::algorithms::CoaddPsf::getPythonModule ( ) const
protectedvirtual

Reimplemented from lsst::afw::detection::Psf.

Definition at line 449 of file CoaddPsf.cc.

◆ getValidPolygon()

boost::shared_ptr< afw::geom::polygon::Polygon const > lsst::meas::algorithms::CoaddPsf::getValidPolygon ( int  index)

Get the validPolygon (in component image Pixel coordinates) of the component image at index.

Parameters
[in]indexIndex of component for which the bounding box will be fetched.
Returns
Corresponding validPolygon.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 318 of file CoaddPsf.cc.

◆ getWcs()

afw::geom::SkyWcs lsst::meas::algorithms::CoaddPsf::getWcs ( int  index)

Get the Wcs of the component image at index.

Parameters
[in]indexIndex of component for which the Wcs will be fetched.
Returns
Corresponding Wcs.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 311 of file CoaddPsf.cc.

◆ getWeight()

double lsst::meas::algorithms::CoaddPsf::getWeight ( int  index)

Get the weight of the component image at index.

Parameters
[in]indexIndex of component for which the weight will be fetched.
Returns
Corresponding weight.
Exceptions
RangeErrorIndex of component is out of range.

Definition at line 325 of file CoaddPsf.cc.

◆ isPersistable()

virtual bool lsst::meas::algorithms::CoaddPsf::isPersistable ( ) const
inlinevirtual

Return true if the CoaddPsf persistable (always true).

While it's actually possible to construct a CoaddPsf that isn't persistable (because its nested Psfs and Wcss are not persistable) in artificial situations, in realistic situations it's pretty much impossible, because persistence is a necessary part of how CoaddPsfs are built. And it's simpler and much faster if we just always return true, rather than loop over the elements and check each one.

Reimplemented from lsst::afw::detection::Psf.

Definition at line 187 of file CoaddPsf.h.

◆ resized()

boost::shared_ptr< afw::detection::Psf > lsst::meas::algorithms::CoaddPsf::resized ( int  width,
int  height 
) const
virtual

Return a clone with specified kernel dimensions.

Implements lsst::afw::detection::Psf.

Definition at line 180 of file CoaddPsf.cc.

◆ write()

void lsst::meas::algorithms::CoaddPsf::write ( OutputArchiveHandle handle) const
protectedvirtual

Reimplemented from lsst::afw::detection::Psf.

Definition at line 451 of file CoaddPsf.cc.


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