28 : position(position_), color(color_) {}
48 struct hash<
lsst::afw::detection::detail::PsfCacheKey> {
68 _imageCache = std::make_unique<PsfCache>(capacity);
69 _kernelImageCache = std::make_unique<PsfCache>(capacity);
78 _isFixed(
other._isFixed),
79 _imageCache(
std::move(
other._imageCache)),
80 _kernelImageCache(
std::move(
other._kernelImageCache)) {}
85 unsigned int warpBuffer) {
90 if (irX.second != 0.0 || irY.second != 0.0) {
94 im->setXY0(irX.first + im->getX0(), irY.first + im->getY0());
106 result = std::make_shared<Image>(*
result,
true);
119 result = std::make_shared<Image>(*
result,
true);
127 return doComputeBBox(position, color);
135 return std::make_shared<math::FixedKernel>(*image);
142 return (*image)(-image->getX0(), -image->getY0());
148 return doComputeApertureFlux(radius, position, color);
154 return doComputeShape(position, color);
168 _imageCache->reserve(capacity);
169 _kernelImageCache->reserve(capacity);
An ellipse core with quadrupole moments as parameters.
int positionToIndex(double pos)
Convert image position to nearest integer index.
std::size_t getCacheCapacity() const
Return the capacity of the caches.
PsfCacheKey(geom::Point2D const &position_, image::Color color_=image::Color())
std::size_t operator()(lsst::afw::detection::detail::PsfCacheKey const &key) const
ImageOwnerEnum
Enum passed to computeImage and computeKernelImage to determine image ownership.
double computePeak(geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
Return the peak value of the PSF image.
image::Color getAverageColor() const
Return the average Color of the stars used to construct the Psf.
An integer coordinate rectangle.
std::shared_ptr< Image > computeKernelImage(geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
Return an Image of the PSF, in a form suitable for convolution.
friend std::ostream & operator<<(std::ostream &os, PsfCacheKey const &key)
std::shared_ptr< math::Kernel const > getLocalKernel(geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
Return a FixedKernel corresponding to the Psf image at the given point.
A base class for image defects.
Point< double, 2 > Point2D
bool operator==(PsfCacheKey const &other) const
double computeApertureFlux(double radius, geom::Point2D position=makeNullPoint(), 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(geom::Point2D position=makeNullPoint(), image::Color color=image::Color(), ImageOwnerEnum owner=COPY) const
Return an Image of the PSF, in a form that can be compared directly with star images.
void setCacheCapacity(std::size_t capacity)
Set the capacity of the caches.
geom::Point2D const position
geom::ellipses::Quadrupole computeShape(geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
Compute the ellipse corresponding to the second moments of the Psf.
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.
Citizen(const std::type_info &)
std::size_t hashCombine(std::size_t seed)
Combine hashes.
ItemVariant const * other
static std::shared_ptr< Image > recenterKernelImage(std::shared_ptr< Image > im, 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,0) when xy0 is taken into account) to an image centered at position when xy0 is taken into account.
An internal image will be returned without copying.
geom::Box2I computeBBox(geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
Return the bounding box of the image returned by computeKernelImage()
Describe the colour of a source.
A polymorphic base class for representing an image's Point Spread Function.
virtual geom::Point2D getAveragePosition() const
Return the average position of the stars used to construct the Psf.
bool isIndeterminate() const
Whether the color is the special value that indicates that it is unspecified.
The image will be copied before returning; caller will own it.