lsst.meas.algorithms gc655b1545f+5b6147336f
KernelPsfFactory.h
Go to the documentation of this file.
1// -*- lsst-c++ -*-
2
17
18namespace lsst {
19namespace meas {
20namespace algorithms {
21
29
30 static KernelPsfPersistenceHelper const& get();
31
32 // No copying
35
36 // No moving
39
40private:
42};
43
54template <typename T = KernelPsf, typename K = afw::math::Kernel>
56public:
58 afw::table::io::CatalogVector const& catalogs) const {
60 LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
61 LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
62 afw::table::BaseRecord const& record = catalogs.front().front();
63 LSST_ARCHIVE_ASSERT(record.getSchema() == keys.schema);
64 // make_shared cannot be used here because
65 // the KernelPsf constructor that takes shared_ptr<Kernel> is protected
66 return std::shared_ptr<T>(new T(archive.get<K>(record.get(keys.kernel)), record.get(keys.averagePosition)));
67 }
68
69 KernelPsfFactory(std::string const& name) : afw::table::io::PersistableFactory(name) {}
70};
71
72} // namespace algorithms
73} // namespace meas
74} // namespace lsst
table::Key< std::string > name
#define LSST_ARCHIVE_ASSERT(EXPR)
Field< T >::Value get(Key< T > const &key) const
std::shared_ptr< Persistable > get(int id) const
PersistableFactory(std::string const &name)
A PersistableFactory for KernelPsf and its subclasses.
KernelPsfFactory(std::string const &name)
virtual std::shared_ptr< afw::table::io::Persistable > read(afw::table::io::InputArchive const &archive, afw::table::io::CatalogVector const &catalogs) const
def keys(self)
A read-only singleton struct containing the schema and key used in persistence for KernelPsf.
KernelPsfPersistenceHelper(KernelPsfPersistenceHelper &&)=delete
KernelPsfPersistenceHelper & operator=(KernelPsfPersistenceHelper &&)=delete
KernelPsfPersistenceHelper(const KernelPsfPersistenceHelper &)=delete
static KernelPsfPersistenceHelper const & get()
Definition: KernelPsf.cc:55
KernelPsfPersistenceHelper & operator=(const KernelPsfPersistenceHelper &)=delete