pb11_wrapper.cc 1007 B

1234567891011121314151617181920212223242526
  1. #include <pybind11/pybind11.h>
  2. #include "nmie-pybind11.hpp"
  3. namespace py = pybind11;
  4. // wrap as Python module
  5. #ifdef MULTI_PRECISION
  6. PYBIND11_MODULE(scattnlay_mp, m)
  7. #else
  8. PYBIND11_MODULE(scattnlay_dp, m)
  9. #endif // MULTI_PRECISION
  10. {
  11. m.doc() = "The Python version of scattnlay";
  12. m.def("scattcoeffs", &py_ScattCoeffs,
  13. "Calculate the scattering coefficients, required to calculate both the near- and far-field parameters.",
  14. py::arg("x"), py::arg("m"), py::arg("nmax") = -1, py::arg("pl") = -1);
  15. m.def("scattnlay", &py_scattnlay,
  16. "Calculate the scattering parameters and amplitudes.",
  17. py::arg("x"), py::arg("m"), py::arg("theta") = py::array_t<double>(0), py::arg("nmax") = -1, py::arg("pl") = -1);
  18. m.def("fieldnlay", &py_fieldnlay,
  19. "Calculate the complex electric and magnetic field in the surroundings and inside the particle.",
  20. py::arg("x"), py::arg("m"), py::arg("xp"), py::arg("yp"), py::arg("zp"), py::arg("nmax") = -1, py::arg("pl") = -1);
  21. }