23 #ifndef LSST_AFW_DETECTION_Psf_h_INCLUDED
24 #define LSST_AFW_DETECTION_Psf_h_INCLUDED
31 #include "lsst/daf/base.h"
70 class Psf :
public daf::base::Citizen,
71 public daf::base::Persistable,
98 virtual std::shared_ptr<Psf>
clone()
const = 0;
108 virtual std::shared_ptr<Psf>
resized(
int width,
int height)
const = 0;
249 std::string
const& warpAlgorithm =
"lanczos5",
250 unsigned int warpBuffer = 5);
259 explicit Psf(
bool isFixed =
false);
270 virtual std::shared_ptr<Image> doComputeImage(
geom::Point2D const& position,
272 virtual std::shared_ptr<Image> doComputeKernelImage(
geom::Point2D const& position,
274 virtual double doComputeApertureFlux(
double radius,
geom::Point2D const& position,
282 mutable std::shared_ptr<Image> _cachedImage;
283 mutable std::shared_ptr<Image> _cachedKernelImage;
295 #endif // !LSST_AFW_DETECTION_Psf_h_INCLUDED
An ellipse core with quadrupole moments as parameters.
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.
image::Color getAverageColor() const
Return the average Color of the stars used to construct the Psf.
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.
ImageOwnerEnum
Enum passed to computeImage and computeKernelImage to determine image ownership.
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.
An integer coordinate rectangle.
Psf(bool isFixed=false)
Main constructor for subclasses.
A base class for objects that can be persisted via afw::table::io Archive classes.
virtual std::shared_ptr< Psf > clone() const =0
Polymorphic deep-copy.
Point< double, 2 > Point2D
math::Kernel::Pixel Pixel
Pixel type of Image returned by computeImage.
virtual std::shared_ptr< Psf > resized(int width, int height) const =0
Return clone with specified kernel dimensions.
virtual geom::Point2D getAveragePosition() const
Return the average position of the stars used to construct the Psf.
double computePeak(geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
Return the peak value of the PSF image.
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.
An internal image will be returned without copying.
Describe the colour of a source.
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.
A polymorphic base class for representing an image's Point Spread Function.
A CRTP facade class for subclasses of Persistable.
image::Image< Pixel > Image
Image type returned by computeImage.
The image will be copied before returning; caller will own it.
geom::Box2I computeBBox(geom::Point2D position=makeNullPoint(), image::Color color=image::Color()) const
Return the bounding box of the image returned by computeKernelImage()
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.