LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
KernelPsfFactory.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
16 
17 namespace lsst { namespace meas { namespace algorithms {
18 
22 struct KernelPsfPersistenceHelper : private boost::noncopyable {
26 
27  static KernelPsfPersistenceHelper const & get();
28 
29 private:
31 };
32 
43 template <typename T=KernelPsf, typename K=afw::math::Kernel>
45 public:
46 
48  read(afw::table::io::InputArchive const & archive, afw::table::io::CatalogVector const & catalogs) const {
50  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
51  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
52  afw::table::BaseRecord const & record = catalogs.front().front();
53  LSST_ARCHIVE_ASSERT(record.getSchema() == keys.schema);
54  return PTR(T)(
55  new T(
56  archive.get<K>(record.get(keys.kernel)),
57  record.get(keys.averagePosition)
58  )
59  );
60  }
61 
62  KernelPsfFactory(std::string const & name) : afw::table::io::PersistableFactory(name) {}
63 
64 };
65 
66 }}} // namespace lsst::afw::detection
Defines the fields and offsets for a table.
Definition: Schema.h:46
A read-only singleton struct containing the schema and key used in persistence for KernelPsf...
PersistableFactory(std::string const &name)
Constructor for the factory.
A base class for factory classes used to reconstruct objects from records.
Definition: Persistable.h:231
static KernelPsfPersistenceHelper const & get()
Definition: KernelPsf.cc:32
KernelPsfFactory(std::string const &name)
#define PTR(...)
Definition: base.h:41
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:74
A vector of catalogs used by Persistable.
Definition: CatalogVector.h:26
Base class for all records.
Definition: BaseRecord.h:27
afw::table::Key< afw::table::Point< double > > averagePosition
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:47
virtual boost::shared_ptr< afw::table::io::Persistable > read(afw::table::io::InputArchive const &archive, afw::table::io::CatalogVector const &catalogs) const
Construct a new object from the given InputArchive and vector of catalogs.
A PersistableFactory for KernelPsf and its subclasses.
A multi-catalog archive object used to load table::io::Persistable objects.
Definition: InputArchive.h:28