23 #include "pybind11/pybind11.h"
28 using namespace py::literals;
36 using PyFluxResult = py::class_<FluxResult, std::shared_ptr<FluxResult>>;
37 using PyFluxResultKey = py::class_<FluxResultKey, std::shared_ptr<FluxResultKey>>;
38 using PyMagResult = py::class_<MagResult, std::shared_ptr<MagResult>>;
39 using PyMagResultKey = py::class_<MagResultKey, std::shared_ptr<MagResultKey>>;
42 PyFluxResult
cls(mod,
"FluxResult");
44 cls.def_readwrite(
"instFlux", &FluxResult::instFlux);
45 cls.def_readwrite(
"instFluxErr", &FluxResult::instFluxErr);
49 PyFluxResultKey
cls(mod,
"FluxResultKey");
51 cls.def(py::init<>());
52 cls.def(
py::init<afw::table::Key<meas::base::Flux>
const &,
53 afw::table::Key<meas::base::FluxErrElement>
const &>(),
54 "instFlux"_a,
"instFluxErr"_a);
55 cls.def(py::init<afw::table::SubSchema const &>());
57 cls.def(
"__eq__", &FluxResultKey::operator==, py::is_operator());
58 cls.def(
"__ne__", &FluxResultKey::operator!=, py::is_operator());
60 cls.def(
"get", &FluxResultKey::get);
62 cls.def_static(
"addFields", &FluxResultKey::addFields,
"schema"_a,
"name"_a,
"doc"_a);
64 cls.def(
"getInstFlux", &FluxResultKey::getInstFlux);
65 cls.def(
"getInstFluxErr", &FluxResultKey::getInstFluxErr);
69 PyMagResult
cls(mod,
"MagResult");
71 cls.def_readwrite(
"mag", &MagResult::mag);
72 cls.def_readwrite(
"magErr", &MagResult::magErr);
76 PyMagResultKey
cls(mod,
"MagResultKey");
78 cls.def(py::init<>());
79 cls.def(py::init<afw::table::SubSchema const &>());
81 cls.def(
"get", &MagResultKey::get);
83 (
void (MagResultKey::*)(afw::table::BaseRecord &, MagResult
const &)
const) &
MagResultKey::set);
84 cls.def(
"set", (
void (MagResultKey::*)(afw::table::BaseRecord &, afw::image::Measurement
const &)
const) &
86 cls.def_static(
"addFields", &MagResultKey::addFields,
"schema"_a,
"name"_a);
92 py::module::import(
"lsst.afw.table");
94 declareFluxResult(mod);
95 declareFluxResultKey(mod);
96 declareMagResult(mod);
97 declareMagResultKey(mod);