13template std::shared_ptr<meas::algorithms::KernelPsf>
22std::shared_ptr<afw::detection::Psf::Image>
25 _kernel->computeImage(*im,
true, position.getX(), position.getY());
30 return _kernel->getBBox();
34 :
ImagePsf(!kernel.isSpatiallyVarying()),
35 _kernel(kernel.
clone()),
36 _averagePosition(averagePosition) {}
39 :
ImagePsf(!kernel->isSpatiallyVarying()), _kernel(kernel), _averagePosition(averagePosition) {}
62 kernel(schema.addField<int>(
"kernel",
"archive ID of nested kernel object")),
63 averagePosition(
afw::
table::PointKey<double>::addFields(
64 schema,
"averagePosition",
"average position of stars used to make the PSF",
"pixel")) {}
76 record->set(keys.kernel, handle.put(_kernel));
77 record->set(keys.averagePosition, _averagePosition);
78 handle.saveCatalog(catalog);
Utilities for persisting KernelPsf and subclasses thereof.
std::shared_ptr< RecordT > addNew()
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
io::OutputArchiveHandle OutputArchiveHandle
ImagePsf(bool isFixed=false)
A PersistableFactory for KernelPsf and its subclasses.
KernelPsf(afw::math::Kernel const &kernel, geom::Point2D const &averagePosition=geom::Point2D())
Construct a KernelPsf with a clone of the given kernel.
bool isPersistable() const noexcept override
Whether this object is persistable; just delegates to the kernel.
geom::Box2I doComputeBBox(geom::Point2D const &position, afw::image::Color const &color) const override
std::shared_ptr< Image > doComputeKernelImage(geom::Point2D const &position, afw::image::Color const &color) const override
std::shared_ptr< afw::detection::Psf > clone() const override
Polymorphic deep copy.
std::shared_ptr< afw::detection::Psf > resized(int width, int height) const override
Return a clone with specified kernel dimensions.
std::string getPersistenceName() const override
std::string getPythonModule() const override
void write(OutputArchiveHandle &handle) const override
geom::Point2D getAveragePosition() const override
Return average position of stars; used as default position.
CatalogT< BaseRecord > BaseCatalog
Point< double, 2 > Point2D
A read-only singleton struct containing the schema and key used in persistence for KernelPsf.
KernelPsfPersistenceHelper(const KernelPsfPersistenceHelper &)=delete
static KernelPsfPersistenceHelper const & get()