lsst.meas.algorithms  14.0-18-gf7dca964+7
KernelPsfFactory.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
17 
18 namespace lsst { namespace meas { namespace algorithms {
19 
27 
28  static KernelPsfPersistenceHelper const & get();
29 
30  // No copying
33 
34  // No moving
37 
38 private:
40 };
41 
52 template <typename T=KernelPsf, typename K=afw::math::Kernel>
54 public:
55 
57  read(afw::table::io::InputArchive const & archive, afw::table::io::CatalogVector const & catalogs) const {
59  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
60  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
61  afw::table::BaseRecord const & record = catalogs.front().front();
62  LSST_ARCHIVE_ASSERT(record.getSchema() == keys.schema);
63  return PTR(T)(
64  new T(
65  archive.get<K>(record.get(keys.kernel)),
66  record.get(keys.averagePosition)
67  )
68  );
69  }
70 
71  KernelPsfFactory(std::string const & name) : afw::table::io::PersistableFactory(name) {}
72 
73 };
74 
75 }}} // namespace lsst::afw::detection
A read-only singleton struct containing the schema and key used in persistence for KernelPsf...
#define LSST_ARCHIVE_ASSERT(EXPR)
#define PTR(...)
KernelPsfFactory(std::string const &name)
STL class.
static KernelPsfPersistenceHelper const & get()
Definition: KernelPsf.cc:41
KernelPsfPersistenceHelper & operator=(const KernelPsfPersistenceHelper &)=delete
A PersistableFactory for KernelPsf and its subclasses.