22 #include "pybind11/pybind11.h"
23 #include "pybind11/stl.h"
30 using namespace pybind11::literals;
34 namespace algorithms {
38 py::class_<CoaddBoundedFieldElement> clsCoaddBoundedFieldElement(mod,
"CoaddBoundedFieldElement");
40 clsCoaddBoundedFieldElement.def(
43 if (polygon.is(py::none())) {
44 return new CoaddBoundedFieldElement(field, wcs, nullptr, weight);
46 auto pgon = py::cast<std::shared_ptr<afw::geom::polygon::Polygon const>>(polygon);
47 return new CoaddBoundedFieldElement(field, wcs, pgon, weight);
50 "field"_a,
"wcs"_a,
"validPolygon"_a,
"weight"_a = 1.0);
57 clsCoaddBoundedFieldElement.def(
"__eq__", &CoaddBoundedFieldElement::operator==, py::is_operator());
58 clsCoaddBoundedFieldElement.def(
"__ne__", &CoaddBoundedFieldElement::operator!=, py::is_operator());
60 afw::table::io::python::declarePersistableFacade<CoaddBoundedField>(mod,
"CoaddBoundedField");
62 py::class_<CoaddBoundedField, std::shared_ptr<CoaddBoundedField>,
63 afw::table::io::PersistableFacade<CoaddBoundedField>, afw::math::BoundedField>
64 clsCoaddBoundedField(mod,
"CoaddBoundedField");
66 clsCoaddBoundedField.attr(
"Element") = clsCoaddBoundedFieldElement;
70 typename CoaddBoundedField::ElementVector
const &>(),
71 "bbox"_a,
"coaddWcs"_a,
"elements"_a);
73 typename CoaddBoundedField::ElementVector
const &,
double>(),
74 "bbox"_a,
"coaddWcs"_a,
"elements"_a,
"default"_a);
77 clsCoaddBoundedField.def(
"__eq__", &CoaddBoundedField::operator==, py::is_operator());
78 clsCoaddBoundedField.def(
"__ne__", &CoaddBoundedField::operator!=, py::is_operator());
79 clsCoaddBoundedField.def(
"__imul__", &CoaddBoundedField::operator*);
82 clsCoaddBoundedField.def(
"evaluate", &CoaddBoundedField::evaluate);
83 clsCoaddBoundedField.def(
"getCoaddWcs", &CoaddBoundedField::getCoaddWcs);
84 clsCoaddBoundedField.def(
"getDefault", &CoaddBoundedField::getDefault);
85 clsCoaddBoundedField.def(
"getElements", &CoaddBoundedField::getElements);
86 clsCoaddBoundedField.def(
"isPersistable", &CoaddBoundedField::isPersistable);