LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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...
PersistableFactory(std::string const &name)
Constructor for the factory.
table::Key< std::string > name
Definition: ApCorrMap.cc:71
A base class for factory classes used to reconstruct objects from records.
Definition: Persistable.h:231
#define PTR(...)
Definition: base.h:41
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
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:47
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