6 namespace lsst {
namespace meas {
namespace algorithms {
8 PTR(afw::detection::Psf::Image) KernelPsf::doComputeKernelImage(
9 afw::geom::Point2D
const & position, afw::image::Color
const& color
11 PTR(Psf::Image) im = std::make_shared<Psf::Image>(_kernel->getDimensions());
12 _kernel->computeImage(*im,
true, position.getX(), position.getY());
16 afw::geom::Box2I KernelPsf::doComputeBBox(
17 afw::geom::Point2D
const & position, afw::image::Color
const& color
19 return _kernel->getBBox();
23 ImagePsf(!kernel.isSpatiallyVarying()), _kernel(kernel.
clone()), _averagePosition(averagePosition) {}
26 ImagePsf(!kernel->isSpatiallyVarying()), _kernel(kernel), _averagePosition(averagePosition) {}
28 PTR(afw::detection::Psf)
KernelPsf::clone()
const {
return std::make_shared<KernelPsf>(*this); }
31 return std::make_shared<KernelPsf>(*_kernel->resized(width, height), _averagePosition); }
46 KernelPsfPersistenceHelper::KernelPsfPersistenceHelper() :
48 kernel(
schema.addField<
int>(
"kernel",
"archive ID of nested kernel object")),
50 schema,
"averagePosition",
"average position of stars used to make the PSF",
"pixel" 53 schema.getCitizen().markPersistent();
64 afw::table::BaseCatalog catalog = handle.makeCatalog(keys.
schema);
65 PTR(afw::table::BaseRecord) record = catalog.addNew();
66 record->set(keys.
kernel, handle.put(_kernel));
68 handle.saveCatalog(catalog);
A read-only singleton struct containing the schema and key used in persistence for KernelPsf...
virtual boost::shared_ptr< afw::detection::Psf > clone() const
Polymorphic deep copy.
virtual std::string getPythonModule() const
afw::table::PointKey< double > averagePosition
virtual boost::shared_ptr< afw::detection::Psf > resized(int width, int height) const
Return a clone with specified kernel dimensions.
KernelPsf(afw::math::Kernel const &kernel, afw::geom::Point2D const &averagePosition=afw::geom::Point2D())
Construct a KernelPsf with a clone of the given kernel.
static KernelPsfPersistenceHelper const & get()
virtual void write(OutputArchiveHandle &handle) const
virtual bool isPersistable() const
Whether this object is persistable; just delegates to the kernel.
afw::table::Key< int > kernel
Utilities for persisting KernelPsf and subclasses thereof.
An intermediate base class for Psfs that use an image representation.
A PersistableFactory for KernelPsf and its subclasses.
tbl::PointKey< double > averagePosition
virtual std::string getPersistenceName() const
afw::table::Schema schema
virtual afw::geom::Point2D getAveragePosition() const
Return average position of stars; used as default position.