22 #include "pybind11/pybind11.h"
31 using namespace pybind11::literals;
39 using PyFluxAlgorithm = py::class_<PeakLikelihoodFluxAlgorithm, std::shared_ptr<PeakLikelihoodFluxAlgorithm>,
41 using PyFluxControl = py::class_<PeakLikelihoodFluxControl>;
42 using PyFluxTransform =
43 py::class_<PeakLikelihoodFluxTransform, std::shared_ptr<PeakLikelihoodFluxTransform>,
BaseTransform>;
45 PyFluxControl declareFluxControl(
py::module &mod) {
46 PyFluxControl
cls(mod,
"PeakLikelihoodFluxControl");
53 PyFluxAlgorithm declareFluxAlgorithm(
py::module &mod) {
54 PyFluxAlgorithm
cls(mod,
"PeakLikelihoodFluxAlgorithm");
56 cls.attr(
"FAILURE") = py::cast(PeakLikelihoodFluxAlgorithm::FAILURE);
59 afw::table::Schema &>(),
60 "ctrl"_a,
"name"_a,
"schema"_a);
63 cls.def(
"fail", &PeakLikelihoodFluxAlgorithm::fail,
"measRecord"_a,
"error"_a =
nullptr);
68 PyFluxTransform declareFluxTransform(
py::module &mod) {
69 PyFluxTransform
cls(mod,
"PeakLikelihoodFluxTransform");
72 afw::table::SchemaMapper &>(),
73 "ctrl"_a,
"name"_a,
"mapper"_a);
81 py::module::import(
"lsst.afw.table");
82 py::module::import(
"lsst.meas.base.algorithm");
83 py::module::import(
"lsst.meas.base.flagHandler");
84 py::module::import(
"lsst.meas.base.transform");
86 auto clsFluxControl = declareFluxControl(mod);
87 auto clsFluxAlgorithm = declareFluxAlgorithm(mod);
88 auto clsFluxTransform = declareFluxTransform(mod);
90 clsFluxAlgorithm.attr(
"Control") = clsFluxControl;
91 clsFluxTransform.attr(
"Control") = clsFluxControl;