22 #include "pybind11/pybind11.h"
23 #include "pybind11/stl.h"
30 using namespace pybind11::literals;
34 namespace algorithms {
37 template <
typename PixelT>
38 void declareInterpolateOverDefects(
py::module& mod) {
39 mod.def(
"interpolateOverDefects",
41 afw::image::MaskedImage<PixelT, afw::image::MaskPixel, afw::image::VariancePixel>>,
42 "image"_a,
"psf"_a,
"badList"_a,
"fallBackValue"_a = 0.0,
"useFallbackValueAtEdge"_a =
false);
46 py::module::import(
"lsst.afw.image");
48 py::class_<Defect, std::shared_ptr<Defect>, afw::image::DefectBase> clsDefect(mod,
"Defect");
50 py::enum_<Defect::DefectPosition>(clsDefect,
"DefectPosition")
51 .value(
"LEFT", Defect::DefectPosition::LEFT)
52 .value(
"NEAR_LEFT", Defect::DefectPosition::NEAR_LEFT)
53 .value(
"WIDE_LEFT", Defect::DefectPosition::WIDE_LEFT)
54 .value(
"MIDDLE", Defect::DefectPosition::MIDDLE)
55 .value(
"WIDE_NEAR_LEFT", Defect::DefectPosition::WIDE_NEAR_LEFT)
56 .value(
"WIDE", Defect::DefectPosition::WIDE)
57 .value(
"WIDE_NEAR_RIGHT", Defect::DefectPosition::WIDE_NEAR_RIGHT)
58 .value(
"NEAR_RIGHT", Defect::DefectPosition::NEAR_RIGHT)
59 .value(
"WIDE_RIGHT", Defect::DefectPosition::WIDE_RIGHT)
60 .value(
"RIGHT", Defect::DefectPosition::RIGHT)
63 clsDefect.def(py::init<const geom::BoxI&>(),
"bbox"_a =
geom::BoxI());
65 clsDefect.def(
"classify", &Defect::classify);
66 clsDefect.def(
"getType", &Defect::getType);
67 clsDefect.def(
"getPos", &Defect::getPos);
69 declareInterpolateOverDefects<float>(mod);