36 using PyShapeletFunction = py::classh<ShapeletFunction>;
38 wrappers.
wrapType(PyShapeletFunction(wrappers.
module,
"ShapeletFunction"), [](
auto &mod,
auto &cls) {
39 cls.def_readonly_static(
"FLUX_FACTOR", &ShapeletFunction::FLUX_FACTOR);
41 cls.def(py::init<int, BasisTypeEnum>(),
"order"_a,
"basisType"_a);
42 cls.def(py::init<int, BasisTypeEnum, ndarray::Array<double, 1, 1> const &>(),
"order"_a,
43 "basisType"_a,
"coefficients"_a);
44 cls.def(py::init<int, BasisTypeEnum, double, geom::Point2D const &>(),
"order"_a,
45 "basisType"_a,
"radius"_a,
"center"_a = geom::Point2D());
46 cls.def(py::init<int, BasisTypeEnum, double, geom::Point2D const &,
47 ndarray::Array<double, 1, 1> const &>(),
48 "order"_a,
"basisType"_a,
"radius"_a,
"center"_a,
"coefficients"_a);
49 cls.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &>(),
"order"_a,
50 "basisType"_a,
"ellipse"_a);
51 cls.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &,
52 ndarray::Array<double const, 1, 1> const &>(),
53 "order"_a,
"basisType"_a,
"ellipse"_a,
"coefficients"_a);
54 cls.def(py::init<ShapeletFunction>());
56 cls.def(
"getOrder", &ShapeletFunction::getOrder);
57 cls.def(
"getEllipse", (afw::geom::ellipses::Ellipse &(ShapeletFunction::*)()) &
58 ShapeletFunction::getEllipse,
59 py::return_value_policy::reference_internal);
60 cls.def(
"setEllipse", &ShapeletFunction::setEllipse);
61 cls.def(
"getBasisType", &ShapeletFunction::getBasisType);
62 cls.def(
"changeBasisType", &ShapeletFunction::changeBasisType);
63 cls.def(
"normalize", &ShapeletFunction::normalize,
"value"_a = 1.0);
64 cls.def(
"getCoefficients", (ndarray::Array<double, 1, 1> const (ShapeletFunction::*)()) &
65 ShapeletFunction::getCoefficients);
66 cls.def(
"convolve", &ShapeletFunction::convolve);
67 cls.def(
"evaluate", &ShapeletFunction::evaluate);
68 cls.def(
"shiftInPlace", &ShapeletFunction::shiftInPlace);
69 cls.def(
"transformInPlace", &ShapeletFunction::transformInPlace);
72 using PyShapeletFunctionEvaluator = py::classh<ShapeletFunctionEvaluator>;
75 PyShapeletFunctionEvaluator(wrappers.
module,
"ShapeletFunctionEvaluator"), [](
auto &mod,
auto &cls) {
76 cls.def(py::init<ShapeletFunction const &>(),
"function"_a);
79 (double (ShapeletFunctionEvaluator::*)(double, double) const) &
80 ShapeletFunctionEvaluator::operator());
82 "__call__", (double (ShapeletFunctionEvaluator::*)(geom::Point2D const &) const) &
83 ShapeletFunctionEvaluator::operator());
85 "__call__", (double (ShapeletFunctionEvaluator::*)(geom::Extent2D const &) const) &
86 ShapeletFunctionEvaluator::operator());
87 cls.def(
"__call__", (ndarray::Array<double, 1, 1> (ShapeletFunctionEvaluator::*)(
88 ndarray::Array<double const, 1> const &,
89 ndarray::Array<double const, 1> const &) const) &
90 ShapeletFunctionEvaluator::operator());
93 "addToImage", (void (ShapeletFunctionEvaluator::*)(ndarray::Array<double, 2, 1> const &,
94 geom::Point2I const &) const) &
95 ShapeletFunctionEvaluator::addToImage,
96 "array"_a,
"xy0"_a = geom::Point2D());
98 "addToImage", (void (ShapeletFunctionEvaluator::*)(afw::image::Image<double> &) const) &
99 ShapeletFunctionEvaluator::addToImage,
101 cls.def(
"integrate", &ShapeletFunctionEvaluator::integrate);
102 cls.def(
"computeMoments", &ShapeletFunctionEvaluator::computeMoments);
103 cls.def(
"update", &ShapeletFunctionEvaluator::update);