lsst.meas.algorithms g4a7591d645+ff8a1bd350
Loading...
Searching...
No Matches
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::afw::table::io::PersistableFacade< Psf > lsst::afw::typehandling::Storable lsst::afw::table::io::Persistable

Classes

class  Factory

Public Types

enum  ImageOwnerEnum
typedef math::Kernel::Pixel Pixel
typedef image::Image< PixelImage

Public Member Functions

 CoaddPsf (afw::table::ExposureCatalog const &catalog, std::shared_ptr< afw::geom::SkyWcs const > coaddWcs, std::string const &weightFieldName="weight", std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
 Main constructors for CoaddPsf.
 CoaddPsf (afw::table::ExposureCatalog const &catalog, std::shared_ptr< afw::geom::SkyWcs const > coaddWcs, CoaddPsfControl const &ctrl, std::string const &weightFieldName="weight")
 Constructor for CoaddPsf.
 CoaddPsf (afw::table::ExposureCatalog const &catalog, std::shared_ptr< afw::geom::SkyWcs const > coaddWcs, geom::Point2D const &averagePosition, std::string const &warpingKernelName="lanczos3", int cacheSize=10000)
std::shared_ptr< afw::detection::Psfclone () const override
 Polymorphic deep copy. Usually unnecessary, as Psfs are immutable.
std::shared_ptr< afw::detection::Psfresized (int width, int height) const override
 Return a clone with specified kernel dimensions.
geom::Point2D getAveragePosition () const override
 Return the average of the positions of the stars that went into this Psf.
std::shared_ptr< afw::geom::SkyWcs const > getCoaddWcs () const
 Return the Wcs of the coadd (defines the coordinate system of the Psf).
int getComponentCount () const
 Return the number of component Psfs in this CoaddPsf.
std::shared_ptr< afw::detection::Psf const > getPsf (int index) const
 Get the Psf of the component image at index.
std::shared_ptr< afw::geom::SkyWcs const > getWcs (int index) const
 Get the Wcs of the component image at index.
double getWeight (int index) const
 Get the weight of the component image at index.
afw::table::RecordId getId (int index) const
 Get the exposure ID of the component image at index.
geom::Box2I getBBox (int index) const
 Get the bounding box (in component image Pixel coordinates) of the component image at index.
std::shared_ptr< afw::geom::polygon::Polygon const > getValidPolygon (int index) const
 Get the validPolygon (in component image Pixel coordinates) of the component image at index.
int getTract (int index) const
 Get the tract ID of the component image at the given index.
int getPatch (int index) const
 Get the patch ID of the component image at the given index.
bool isPersistable () const noexcept override
 Return true if the CoaddPsf persistable (always true).
std::shared_ptr< typehandling::Storable > cloneStorable () const override
std::shared_ptr< ImagecomputeImage (lsst::geom::Point2D position, image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
std::shared_ptr< ImagecomputeKernelImage (lsst::geom::Point2D position, image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
double computePeak (lsst::geom::Point2D position, image::Color color=image::Color()) const
double computeApertureFlux (double radius, lsst::geom::Point2D position, image::Color color=image::Color()) const
geom::ellipses::Quadrupole computeShape (lsst::geom::Point2D position, image::Color color=image::Color()) const
std::shared_ptr< math::Kernel const > getLocalKernel (lsst::geom::Point2D position, image::Color color=image::Color()) const
image::Color getAverageColor () const
lsst::geom::Box2I computeBBox (lsst::geom::Point2D position, image::Color color=image::Color()) const
lsst::geom::Box2I computeImageBBox (lsst::geom::Point2D position, image::Color color=image::Color()) const
lsst::geom::Box2I computeKernelBBox (lsst::geom::Point2D position, image::Color color=image::Color()) const
std::size_t getCacheCapacity () const
void setCacheCapacity (std::size_t capacity)
virtual std::string toString () const
virtual std::size_t hash_value () const
virtual bool equals (Storable const &other) const noexcept
virtual bool equals (Storable const &other) const noexcept
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::ostreamoperator<< (std::ostream &os, Storable const &storable)
std::ostreamoperator<< (std::ostream &os, Storable const &storable)

Static Public Member Functions

static std::shared_ptr< T > readFits (fits::Fits &fitsfile)
static std::shared_ptr< T > dynamicCast (std::shared_ptr< Persistable > const &ptr)
static std::shared_ptr< T > readFits (fits::Fits &fitsfile)
static std::shared_ptr< PsfreadFits (fits::Fits &fitsfile)
static std::shared_ptr< T > dynamicCast (std::shared_ptr< Persistable > const &ptr)
static std::shared_ptr< PsfdynamicCast (std::shared_ptr< Persistable > const &ptr)
static std::shared_ptr< T > dynamicCast (std::shared_ptr< Persistable > const &ptr)
static std::shared_ptr< ImagerecenterKernelImage (std::shared_ptr< Image > im, lsst::geom::Point2D const &position, std::string const &warpAlgorithm="lanczos5", unsigned int warpBuffer=5)

Public Attributes

 COPY
 INTERNAL

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle

Protected Member Functions

std::shared_ptr< afw::detection::Psf::ImagedoComputeKernelImage (geom::Point2D const &ccdXY, afw::image::Color const &color) const override
geom::Box2I doComputeBBox (geom::Point2D const &position, afw::image::Color const &color) const override
std::string getPersistenceName () const override
std::string getPythonModule () const override
void write (OutputArchiveHandle &handle) const override
virtual double doComputeApertureFlux (double radius, geom::Point2D const &position, afw::image::Color const &color) const
virtual afw::geom::ellipses::Quadrupole doComputeShape (geom::Point2D const &position, afw::image::Color const &color) const
virtual std::shared_ptr< ImagedoComputeImage (lsst::geom::Point2D const &position, image::Color const &color) const
virtual lsst::geom::Box2I doComputeImageBBox (lsst::geom::Point2D const &position, image::Color const &color) const
virtual void write (OutputArchiveHandle &handle) const

Static Protected Member Functions

static bool singleClassEquals (T const &lhs, Storable const &rhs)
static bool singleClassEquals (T const &lhs, Storable const &rhs)

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,
std::shared_ptr< 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,
std::shared_ptr< 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 94 of file CoaddPsf.h.

◆ CoaddPsf() [3/3]

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

Definition at line 172 of file CoaddPsf.cc.

Member Function Documentation

◆ clone()

std::shared_ptr< afw::detection::Psf > lsst::meas::algorithms::CoaddPsf::clone ( ) const
overridevirtual

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

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

Definition at line 193 of file CoaddPsf.cc.

◆ doComputeApertureFlux()

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

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

Definition at line 45 of file ImagePsf.cc.

◆ doComputeBBox()

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

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

Definition at line 242 of file CoaddPsf.cc.

◆ doComputeKernelImage()

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

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

Definition at line 264 of file CoaddPsf.cc.

◆ doComputeShape()

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

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

Definition at line 65 of file ImagePsf.cc.

◆ getAveragePosition()

geom::Point2D lsst::meas::algorithms::CoaddPsf::getAveragePosition ( ) const
inlineoverridevirtual

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()

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

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 346 of file CoaddPsf.cc.

◆ getCoaddWcs()

std::shared_ptr< afw::geom::SkyWcs const > lsst::meas::algorithms::CoaddPsf::getCoaddWcs ( ) const
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 309 of file CoaddPsf.cc.

◆ getId()

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

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 339 of file CoaddPsf.cc.

◆ getPatch()

int lsst::meas::algorithms::CoaddPsf::getPatch ( int index) const

Get the patch ID of the component image at the given index.

Exceptions
lsst::pex::exceptions::NotFoundErrorThere is no patch column.

Definition at line 363 of file CoaddPsf.cc.

◆ getPersistenceName()

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

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

Definition at line 463 of file CoaddPsf.cc.

◆ getPsf()

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

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 311 of file CoaddPsf.cc.

◆ getPythonModule()

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

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

Definition at line 465 of file CoaddPsf.cc.

◆ getTract()

int lsst::meas::algorithms::CoaddPsf::getTract ( int index) const

Get the tract ID of the component image at the given index.

Exceptions
lsst::pex::exceptions::NotFoundErrorThere is no tract column.

Definition at line 353 of file CoaddPsf.cc.

◆ getValidPolygon()

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

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 325 of file CoaddPsf.cc.

◆ getWcs()

std::shared_ptr< afw::geom::SkyWcs const > lsst::meas::algorithms::CoaddPsf::getWcs ( int index) const

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 318 of file CoaddPsf.cc.

◆ getWeight()

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

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 332 of file CoaddPsf.cc.

◆ isPersistable()

bool lsst::meas::algorithms::CoaddPsf::isPersistable ( ) const
inlineoverridevirtualnoexcept

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 201 of file CoaddPsf.h.

◆ resized()

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

Return a clone with specified kernel dimensions.

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

Definition at line 195 of file CoaddPsf.cc.

◆ write()

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

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

Definition at line 467 of file CoaddPsf.cc.


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