24 #include "pybind11/pybind11.h"
25 #include "pybind11/stl.h"
32 using namespace pybind11::literals;
39 using PyPixelFitRegionControl = py::class_<PixelFitRegionControl, std::shared_ptr<PixelFitRegionControl>>;
40 using PyPixelFitRegion = py::class_<PixelFitRegion, std::shared_ptr<PixelFitRegion>>;
43 py::module::import(
"lsst.afw.image");
44 py::module::import(
"lsst.afw.detection");
45 py::module::import(
"lsst.afw.geom.ellipses");
47 using Control = PixelFitRegionControl;
49 PyPixelFitRegionControl clsControl(mod,
"PixelFitRegionControl");
50 clsControl.def(py::init<>());
60 PyPixelFitRegion
cls(mod,
"PixelFitRegion");
62 afw::geom::ellipses::Quadrupole
const &,
Scalar,
int>(),
63 "ctrl"_a,
"moments"_a,
"psfMoments"_a,
"kronRadius"_a,
"footprintArea"_a);
64 cls.def(py::init<Control const &, afw::geom::ellipses::Quadrupole const &>(),
"ctrl"_a,
"ellipse"_a);
65 cls.def(
"applyEllipse", &PixelFitRegion::applyEllipse,
"deconvolved"_a,
"psfMoments"_a);
66 cls.def(
"applyMask", &PixelFitRegion::applyMask,
"mask"_a,
"center"_a);
69 cls.def_readonly(
"ellipse", &PixelFitRegion::ellipse);
70 cls.def_readonly(
"footprint", &PixelFitRegion::footprint);
71 cls.def_readonly(
"usedFootprintArea", &PixelFitRegion::usedFootprintArea);
72 cls.def_readonly(
"usedPsfArea", &PixelFitRegion::usedPsfArea);
73 cls.def_readonly(
"maxArea", &PixelFitRegion::maxArea);
74 cls.def_readonly(
"maxBadPixelFraction", &PixelFitRegion::maxBadPixelFraction);
75 cls.def_readonly(
"usedMinEllipse", &PixelFitRegion::usedMinEllipse);
76 cls.def_readonly(
"usedMaxEllipse", &PixelFitRegion::usedMaxEllipse);