23 #include <pybind11/pybind11.h> 24 #include <pybind11/stl.h> 26 #include "ndarray/pybind11.h" 43 using Class = HeavyFootprint<ImagePixelT>;
44 py::class_<Class, std::shared_ptr<Class>,
Footprint> clsHeavyFootprint(
45 mod, (
"HeavyFootprint" + suffix).c_str());
48 clsHeavyFootprint.def(
51 HeavyFootprintCtrl
const *>(),
52 "foot"_a,
"mimage"_a,
"ctrl"_a =
nullptr);
53 clsHeavyFootprint.def(py::init<Footprint const &, HeavyFootprintCtrl const *>(),
"foot"_a,
57 clsHeavyFootprint.def(
"isHeavy", &Class::isHeavy);
58 clsHeavyFootprint.def(
60 clsHeavyFootprint.def(
"insert",
62 clsHeavyFootprint.def(
"getImageArray",
63 (ndarray::Array<ImagePixelT, 1, 1> (Class::*)()) & Class::getImageArray);
64 clsHeavyFootprint.def(
"getMaskArray",
65 (ndarray::Array<MaskPixelT, 1, 1> (Class::*)()) & Class::getMaskArray);
66 clsHeavyFootprint.def(
"getVarianceArray",
67 (ndarray::Array<VariancePixelT, 1, 1> (Class::*)()) & Class::getVarianceArray);
68 clsHeavyFootprint.def(
"getMaskBitsSet", &Class::getMaskBitsSet);
72 mod.def(
"makeHeavyFootprint",
75 HeavyFootprintCtrl
const *))makeHeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT>,
76 "foot"_a,
"img"_a,
"ctrl"_a =
nullptr);
80 mod.def(
"mergeHeavyFootprints", mergeHeavyFootprints<ImagePixelT, MaskPixelT, VariancePixelT>);
85 declareHeavyFootprint<int>(mod,
"I");
86 declareHeavyFootprint<std::uint16_t>(mod,
"U");
87 declareHeavyFootprint<float>(mod,
"F");
88 declareHeavyFootprint<double>(mod,
"D");
PYBIND11_MODULE(heavyFootprint, mod)
def dot(symb, c, r, frame=None, size=2, ctype=None, origin=afwImage.PARENT, args, kwargs)
A base class for image defects.
A class to manipulate images, masks, and variance as a single object.
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
lsst::afw::detection::Footprint Footprint
float VariancePixel
default type for MaskedImage variance images
A class to represent a 2-dimensional array of pixels.