35 py::module::import(
"lsst.geom");
36 py::module::import(
"lsst.afw.geom");
37 py::module::import(
"lsst.afw.image");
39 py::class_<ShapeletFunction, std::shared_ptr<ShapeletFunction>> clsShapeletFunction(mod,
42 clsShapeletFunction.def_readonly_static(
"FLUX_FACTOR", &ShapeletFunction::FLUX_FACTOR);
44 clsShapeletFunction.def(py::init<int, BasisTypeEnum>(),
"order"_a,
"basisType"_a);
45 clsShapeletFunction.def(py::init<
int,
BasisTypeEnum, ndarray::Array<double, 1, 1>
const &>(),
"order"_a,
46 "basisType"_a,
"coefficients"_a);
47 clsShapeletFunction.def(py::init<int, BasisTypeEnum, double, geom::Point2D const &>(),
"order"_a,
50 ndarray::Array<double, 1, 1>
const &>(),
51 "order"_a,
"basisType"_a,
"radius"_a,
"center"_a,
"coefficients"_a);
52 clsShapeletFunction.def(py::init<int, BasisTypeEnum, afw::geom::ellipses::Ellipse const &>(),
"order"_a,
53 "basisType"_a,
"ellipse"_a);
54 clsShapeletFunction.def(py::init<
int,
BasisTypeEnum, afw::geom::ellipses::Ellipse
const &,
55 ndarray::Array<double const, 1, 1>
const &>(),
56 "order"_a,
"basisType"_a,
"ellipse"_a,
"coefficients"_a);
57 clsShapeletFunction.def(py::init<ShapeletFunction>());
59 clsShapeletFunction.def(
"getOrder", &ShapeletFunction::getOrder);
60 clsShapeletFunction.def(
"getEllipse", (afw::geom::ellipses::Ellipse & (ShapeletFunction::*)()) &
61 ShapeletFunction::getEllipse,
62 py::return_value_policy::reference_internal);
63 clsShapeletFunction.def(
"setEllipse", &ShapeletFunction::setEllipse);
64 clsShapeletFunction.def(
"getBasisType", &ShapeletFunction::getBasisType);
65 clsShapeletFunction.def(
"changeBasisType", &ShapeletFunction::changeBasisType);
66 clsShapeletFunction.def(
"normalize", &ShapeletFunction::normalize,
"value"_a = 1.0);
67 clsShapeletFunction.def(
"getCoefficients", (ndarray::Array<double, 1, 1>
const (ShapeletFunction::*)()) &
68 ShapeletFunction::getCoefficients);
70 clsShapeletFunction.def(
"evaluate", &ShapeletFunction::evaluate);
71 clsShapeletFunction.def(
"shiftInPlace", &ShapeletFunction::shiftInPlace);
72 clsShapeletFunction.def(
"transformInPlace", &ShapeletFunction::transformInPlace);
74 py::class_<ShapeletFunctionEvaluator, std::shared_ptr<ShapeletFunctionEvaluator>>
75 clsShapeletFunctionEvaluator(mod,
"ShapeletFunctionEvaluator");
77 clsShapeletFunctionEvaluator.def(py::init<ShapeletFunction const &>(),
"function"_a);
79 clsShapeletFunctionEvaluator.def(
"__call__",
80 (
double (ShapeletFunctionEvaluator::*)(
double,
double)
const) &
81 ShapeletFunctionEvaluator::operator());
82 clsShapeletFunctionEvaluator.def(
83 "__call__", (
double (ShapeletFunctionEvaluator::*)(
geom::Point2D const &)
const) &
84 ShapeletFunctionEvaluator::operator());
85 clsShapeletFunctionEvaluator.def(
86 "__call__", (
double (ShapeletFunctionEvaluator::*)(
geom::Extent2D const &)
const) &
87 ShapeletFunctionEvaluator::operator());
88 clsShapeletFunctionEvaluator.def(
"__call__", (ndarray::Array<double, 1, 1> (ShapeletFunctionEvaluator::*)(
89 ndarray::Array<double const, 1>
const &,
90 ndarray::Array<double const, 1>
const &)
const) &
91 ShapeletFunctionEvaluator::operator());
93 clsShapeletFunctionEvaluator.def(
94 "addToImage", (
void (ShapeletFunctionEvaluator::*)(ndarray::Array<double, 2, 1>
const &,
98 clsShapeletFunctionEvaluator.def(
99 "addToImage", (
void (ShapeletFunctionEvaluator::*)(afw::image::Image<double> &)
const) &
103 clsShapeletFunctionEvaluator.def(
"computeMoments", &ShapeletFunctionEvaluator::computeMoments);
104 clsShapeletFunctionEvaluator.def(
"update", &ShapeletFunctionEvaluator::update);
void convolve(OutImageT &convolvedImage, InImageT const &inImage, KernelT const &kernel, ConvolutionControl const &convolutionControl=ConvolutionControl())
Convolve an Image or MaskedImage with a Kernel, setting pixels of an existing output image.
auto integrate(UnaryFunctionT func, Arg const a, Arg const b, double eps=1.0e-6)
The 1D integrator.
void addToImage(std::shared_ptr< afw::image::Image< double >> image, std::vector< std::shared_ptr< afw::image::Image< double >>> const &imgVector, std::vector< double > const &weightVector)