lsst.meas.algorithms
g4a7591d645+ff8a1bd350
Toggle main menu visibility
Loading...
Searching...
No Matches
include
lsst
meas
algorithms
KernelPsfFactory.h
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
11
12
#include "
lsst/meas/algorithms/KernelPsf.h
"
13
#include "
lsst/afw/table/io/InputArchive.h
"
14
#include "
lsst/afw/table/io/OutputArchive.h
"
15
#include "
lsst/afw/table/io/CatalogVector.h
"
16
#include "
lsst/afw/table/aggregates.h
"
17
18
namespace
lsst
{
19
namespace
meas
{
20
namespace
algorithms
{
21
25
struct
KernelPsfPersistenceHelper
{
26
afw::table::Schema
schema
;
27
afw::table::Key<int>
kernel
;
28
afw::table::PointKey<double>
averagePosition
;
29
30
static
KernelPsfPersistenceHelper
const
&
get
();
31
32
// No copying
33
KernelPsfPersistenceHelper
(
const
KernelPsfPersistenceHelper
&) =
delete
;
34
KernelPsfPersistenceHelper
&
operator=
(
const
KernelPsfPersistenceHelper
&) =
delete
;
35
36
// No moving
37
KernelPsfPersistenceHelper
(
KernelPsfPersistenceHelper
&&) =
delete
;
38
KernelPsfPersistenceHelper
&
operator=
(
KernelPsfPersistenceHelper
&&) =
delete
;
39
40
private
:
41
KernelPsfPersistenceHelper
();
42
};
43
54
template
<
typename
T = KernelPsf,
typename
K = afw::math::Kernel>
55
class
KernelPsfFactory
:
public
afw::table::io::PersistableFactory
{
56
public
:
57
virtual
std::shared_ptr<afw::table::io::Persistable>
read
(
afw::table::io::InputArchive
const
& archive,
58
afw::table::io::CatalogVector
const
& catalogs)
const
{
59
static
KernelPsfPersistenceHelper
const
& keys =
KernelPsfPersistenceHelper::get
();
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
CatalogVector.h
InputArchive.h
KernelPsf.h
OutputArchive.h
LSST_ARCHIVE_ASSERT
#define LSST_ARCHIVE_ASSERT(EXPR)
aggregates.h
std::string
lsst::afw::table::BaseRecord
lsst::afw::table::BaseRecord::get
Field< T >::Value get(Key< T > const &key) const
lsst::afw::table::BaseRecord::getSchema
Schema getSchema() const
lsst::afw::table::Key
lsst::afw::table::PointKey
lsst::afw::table::Schema
lsst::afw::table::io::CatalogVector
lsst::afw::table::io::InputArchive
lsst::afw::table::io::InputArchive::get
std::shared_ptr< Persistable > get(int id) const
lsst::afw::table::io::PersistableFactory
lsst::afw::table::io::PersistableFactory::PersistableFactory
PersistableFactory(std::string const &name)
lsst::meas::algorithms::KernelPsfFactory::KernelPsfFactory
KernelPsfFactory(std::string const &name)
Definition
KernelPsfFactory.h:69
lsst::meas::algorithms::KernelPsfFactory::read
virtual std::shared_ptr< afw::table::io::Persistable > read(afw::table::io::InputArchive const &archive, afw::table::io::CatalogVector const &catalogs) const
Definition
KernelPsfFactory.h:57
std::vector::front
T front(T... args)
lsst::afw::table
lsst::afw
lsst::meas::algorithms
Definition
mainpage.dox:13
lsst::meas
lsst
std::shared_ptr
std::vector::size
T size(T... args)
lsst::meas::algorithms::KernelPsfPersistenceHelper
A read-only singleton struct containing the schema and key used in persistence for KernelPsf.
Definition
KernelPsfFactory.h:25
lsst::meas::algorithms::KernelPsfPersistenceHelper::KernelPsfPersistenceHelper
KernelPsfPersistenceHelper(KernelPsfPersistenceHelper &&)=delete
lsst::meas::algorithms::KernelPsfPersistenceHelper::schema
afw::table::Schema schema
Definition
KernelPsfFactory.h:26
lsst::meas::algorithms::KernelPsfPersistenceHelper::averagePosition
afw::table::PointKey< double > averagePosition
Definition
KernelPsfFactory.h:28
lsst::meas::algorithms::KernelPsfPersistenceHelper::operator=
KernelPsfPersistenceHelper & operator=(KernelPsfPersistenceHelper &&)=delete
lsst::meas::algorithms::KernelPsfPersistenceHelper::kernel
afw::table::Key< int > kernel
Definition
KernelPsfFactory.h:27
lsst::meas::algorithms::KernelPsfPersistenceHelper::KernelPsfPersistenceHelper
KernelPsfPersistenceHelper(const KernelPsfPersistenceHelper &)=delete
lsst::meas::algorithms::KernelPsfPersistenceHelper::get
static KernelPsfPersistenceHelper const & get()
Definition
KernelPsf.cc:55
lsst::meas::algorithms::KernelPsfPersistenceHelper::operator=
KernelPsfPersistenceHelper & operator=(const KernelPsfPersistenceHelper &)=delete
Generated on
for lsst.meas.algorithms by
1.17.0