LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
KernelPsfFactory.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
17 
18 namespace lsst { namespace meas { namespace algorithms {
19 
23 struct KernelPsfPersistenceHelper : private boost::noncopyable {
27 
28  static KernelPsfPersistenceHelper const & get();
29 
30 private:
32 };
33 
44 template <typename T=KernelPsf, typename K=afw::math::Kernel>
46 public:
47 
49  read(afw::table::io::InputArchive const & archive, afw::table::io::CatalogVector const & catalogs) const {
51  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
52  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
53  afw::table::BaseRecord const & record = catalogs.front().front();
54  LSST_ARCHIVE_ASSERT(record.getSchema() == keys.schema);
55  return PTR(T)(
56  new T(
57  archive.get<K>(record.get(keys.kernel)),
58  record.get(keys.averagePosition)
59  )
60  );
61  }
62 
63  KernelPsfFactory(std::string const & name) : afw::table::io::PersistableFactory(name) {}
64 
65 };
66 
67 }}} // 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...
#define PTR(...)
Definition: base.h:41
table::Key< std::string > name
Definition: ApCorrMap.cc:71
PersistableFactory(std::string const &name)
Constructor for the factory.
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:47
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)
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
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