24 #include "pybind11/pybind11.h" 25 #include "pybind11/stl.h" 27 #include "ndarray/pybind11.h" 41 using PyModel = py::class_<Model, std::shared_ptr<Model>>;
44 py::module::import(
"lsst.shapelet");
45 py::module::import(
"lsst.meas.modelfit.priors");
46 py::module::import(
"lsst.meas.modelfit.unitSystem");
48 PyModel
cls(mod,
"Model");
50 py::enum_<Model::CenterEnum>(
cls,
"CenterEnum")
51 .value(
"FIXED_CENTER", Model::FIXED_CENTER)
52 .value(
"SINGLE_CENTER", Model::SINGLE_CENTER)
53 .value(
"MULTI_CENTER", Model::MULTI_CENTER)
59 "basisVector"_a,
"prefixes"_a,
"center"_a);
63 "basis"_a,
"center"_a);
64 cls.def_static(
"makeGaussian", &Model::makeGaussian,
"center"_a,
"radius"_a = 1.0);
65 cls.def(
"getNonlinearDim", &Model::getNonlinearDim);
66 cls.def(
"getAmplitudeDim", &Model::getAmplitudeDim);
67 cls.def(
"getFixedDim", &Model::getFixedDim);
68 cls.def(
"getBasisCount", &Model::getBasisCount);
69 cls.def(
"getNonlinearNames", &Model::getNonlinearNames, py::return_value_policy::copy);
70 cls.def(
"getAmplitudeNames", &Model::getAmplitudeNames, py::return_value_policy::copy);
71 cls.def(
"getFixedNames", &Model::getFixedNames, py::return_value_policy::copy);
72 cls.def(
"getBasisVector", &Model::getBasisVector, py::return_value_policy::copy);
73 cls.def(
"makeShapeletFunction", &Model::makeShapeletFunction);
74 cls.def(
"adaptPrior", &Model::adaptPrior);
75 cls.def(
"makeEllipseVector", &Model::makeEllipseVector);
76 cls.def(
"writeEllipses",
77 (Model::EllipseVector (Model::*)(ndarray::Array<Scalar const, 1, 1>
const &,
78 ndarray::Array<Scalar const, 1, 1>
const &)
const) &
80 "nonlinear"_a,
"fixed"_a);
81 cls.def(
"readEllipses",
82 (
void (Model::*)(Model::EllipseVector
const &, ndarray::Array<Scalar, 1, 1>
const &,
83 ndarray::Array<Scalar, 1, 1>
const &)
const) &
85 "ellipses"_a,
"nonlinear"_a,
"fixed"_a);
86 cls.def(
"transformParameters", &Model::transformParameters,
"transform"_a,
"nonlinear"_a,
"amplitudes"_a,
PYBIND11_MODULE(camera, mod)
A base class for image defects.