LSST Applications g06d8191974+de063e15a7,g180d380827+d0b6459378,g2079a07aa2+86d27d4dc4,g2305ad1205+f1ae3263cc,g29320951ab+5752d78b6e,g2bbee38e9b+85cf0a37e7,g337abbeb29+85cf0a37e7,g33d1c0ed96+85cf0a37e7,g3a166c0a6a+85cf0a37e7,g3ddfee87b4+b5254b9343,g48712c4677+9ea88d309d,g487adcacf7+05f7dba17f,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+48904e3942,g64a986408d+de063e15a7,g858d7b2824+de063e15a7,g864b0138d7+33ab2bc355,g8a8a8dda67+585e252eca,g99cad8db69+4508353287,g9c22b2923f+53520f316c,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+ccb7f83a87,gc120e1dc64+6caf640b9b,gc28159a63d+85cf0a37e7,gc3e9b769f7+548c5e05a3,gcf0d15dbbd+b5254b9343,gdaeeff99f8+f9a426f77a,ge6526c86ff+515b6c9330,ge79ae78c31+85cf0a37e7,gee10cc3b42+585e252eca,gff1a9f87cc+de063e15a7,w.2024.17
LSST Data Management Base Package
Loading...
Searching...
No Matches
KernelPsfFactory.h
Go to the documentation of this file.
1// -*- lsst-c++ -*-
2
17
18namespace lsst {
19namespace meas {
20namespace algorithms {
21
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
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition Persistable.h:48
Tag types used to declare specialized field types.
Definition misc.h:31
Base class for all records.
Definition BaseRecord.h:31
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
Definition BaseRecord.h:151
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
Definition BaseRecord.h:80
Defines the fields and offsets for a table.
Definition Schema.h:51
A vector of catalogs used by Persistable.
A multi-catalog archive object used to load table::io::Persistable objects.
std::shared_ptr< Persistable > get(int id) const
Load the Persistable with the given ID and return it.
A base class for factory classes used to reconstruct objects from records.
A PersistableFactory for KernelPsf and its subclasses.
virtual std::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 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