31 : position(position_), color(color_) {}
71 Psf::Psf(
bool isFixed,
std::size_t capacity) : _isFixed(isFixed) {
72 _imageCache = std::make_unique<PsfCache>(capacity);
73 _kernelImageCache = std::make_unique<PsfCache>(capacity);
78 Psf::Psf(
Psf const &other) :
Psf(other._isFixed, other.getCacheCapacity()) {}
81 : _isFixed(other._isFixed),
82 _imageCache(
std::move(other._imageCache)),
83 _kernelImageCache(
std::move(other._kernelImageCache)) {}
88 unsigned int warpBuffer) {
93 if (irX.second != 0.0 || irY.second != 0.0) {
97 im->setXY0(irX.first + im->getX0(), irY.first + im->getY0());
165 return std::make_shared<math::FixedKernel>(*
image);
208 return im->getBBox();
216 _imageCache->reserve(capacity);
217 _kernelImageCache->reserve(capacity);
A polymorphic base class for representing an image's Point Spread Function.
static std::shared_ptr< Image > recenterKernelImage(std::shared_ptr< Image > im, lsst::geom::Point2D const &position, std::string const &warpAlgorithm="lanczos5", unsigned int warpBuffer=5)
Helper function for Psf::doComputeImage(): converts a kernel image (centered at (0,...
lsst::geom::Box2I computeBBox() const
virtual std::shared_ptr< Image > doComputeImage(lsst::geom::Point2D const &position, image::Color const &color) const
These virtual members are protected (rather than private) so that python-implemented derived classes ...
lsst::geom::Box2I computeImageBBox() const
std::size_t getCacheCapacity() const
Return the capacity of the caches.
virtual std::shared_ptr< Image > doComputeKernelImage(lsst::geom::Point2D const &position, image::Color const &color) const =0
These virtual member functions are private, not protected, because we only want derived classes to im...
double computeApertureFlux(double radius, lsst::geom::Point2D position, image::Color color=image::Color()) const
Compute the "flux" of the Psf model within a circular aperture of the given radius.
std::shared_ptr< Image > computeImage() const
std::shared_ptr< Image > computeKernelImage() const
std::shared_ptr< math::Kernel const > getLocalKernel() const
double computePeak() const
image::Color getAverageColor() const
Return the average Color of the stars used to construct the Psf.
virtual lsst::geom::Box2I doComputeImageBBox(lsst::geom::Point2D const &position, image::Color const &color) const
ImageOwnerEnum
Enum passed to computeImage and computeKernelImage to determine image ownership.
@ COPY
The image will be copied before returning; caller will own it.
@ INTERNAL
An internal image will be returned without copying.
virtual lsst::geom::Box2I doComputeBBox(lsst::geom::Point2D const &position, image::Color const &color) const =0
void setCacheCapacity(std::size_t capacity)
Set the capacity of the caches.
geom::ellipses::Quadrupole computeShape() const
virtual double doComputeApertureFlux(double radius, lsst::geom::Point2D const &position, image::Color const &color) const =0
virtual lsst::geom::Point2D getAveragePosition() const
Return the average position of the stars used to construct the Psf.
virtual geom::ellipses::Quadrupole doComputeShape(lsst::geom::Point2D const &position, image::Color const &color) const =0
An ellipse core with quadrupole moments as parameters.
Describe the colour of a source.
bool isIndeterminate() const noexcept
Whether the color is the special value that indicates that it is unspecified.
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
An integer coordinate rectangle.
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
int positionToIndex(double pos)
Convert image position to nearest integer index.
std::shared_ptr< ImageT > offsetImage(ImageT const &image, float dx, float dy, std::string const &algorithmName="lanczos5", unsigned int buffer=0)
Return an image offset by (dx, dy) using the specified algorithm.
Point< double, 2 > Point2D
A base class for image defects.
friend std::ostream & operator<<(std::ostream &os, PsfCacheKey const &key)
lsst::geom::Point2D const position
bool operator==(PsfCacheKey const &other) const
PsfCacheKey(lsst::geom::Point2D const &position_, image::Color color_=image::Color())
std::size_t operator()(lsst::afw::detection::detail::PsfCacheKey const &key) const noexcept