22 #include "pybind11/pybind11.h" 24 #include "numpy/arrayobject.h" 25 #include "ndarray/pybind11.h" 29 namespace py = pybind11;
36 py::module mod(
"radialProfile");
38 if (_import_array() < 0) {
39 PyErr_SetString(PyExc_ImportError,
"numpy.core.multiarray failed to import");
43 py::class_<RadialProfile, std::shared_ptr<RadialProfile>> clsRadialProfile(mod,
"RadialProfile");
45 clsRadialProfile.def_static(
"get", &RadialProfile::get, py::return_value_policy::reference);
46 clsRadialProfile.def(
"getName", &RadialProfile::getName);
47 clsRadialProfile.def(
"_evaluate", (
double (
RadialProfile::*)(
double)
const) & RadialProfile::evaluate);
48 clsRadialProfile.def(
"_evaluate", (ndarray::Array<double, 1, 1> (
RadialProfile::*)(
49 ndarray::Array<double const, 1, 1>
const &)
const) &
50 RadialProfile::evaluate);
51 clsRadialProfile.def(
"getMomentsRadiusFactor", &RadialProfile::getMomentsRadiusFactor);
52 clsRadialProfile.def(
"getBasis", &RadialProfile::getBasis,
"nComponents"_a,
"maxRadius"_a = 0);
53 clsRadialProfile.def(
"registerBasis", &RadialProfile::registerBasis);
Registry and utility class for multi-Gaussian approximations to radial profiles.
PYBIND11_PLUGIN(radialProfile)