23 #include "pybind11/pybind11.h"
24 #include "pybind11/stl.h"
30 using namespace py::literals;
38 template <
typename ImageT>
42 cls.def(py::init<bool>(),
"constantWeight"_a =
true);
44 cls.def(
"addImage", &ImagePca<ImageT>::addImage,
"img"_a,
"flux"_a = 0.0);
45 cls.def(
"getImageList", &ImagePca<ImageT>::getImageList);
46 cls.def(
"getDimensions", &ImagePca<ImageT>::getDimensions);
47 cls.def(
"getMean", &ImagePca<ImageT>::getMean);
48 cls.def(
"analyze", &ImagePca<ImageT>::analyze);
49 cls.def(
"updateBadPixels", &ImagePca<ImageT>::updateBadPixels);
50 cls.def(
"getEigenValues", &ImagePca<ImageT>::getEigenValues);
51 cls.def(
"getEigenImages", &ImagePca<ImageT>::getEigenImages);
54 template <
typename Image1T,
typename Image2T>
55 static void declareInnerProduct(
py::module &mod) {
56 mod.def(
"innerProduct",
57 (
double (*)(Image1T
const &, Image2T
const &,
int const))innerProduct<Image1T, Image2T>,
"lhs"_a,
58 "rhs"_a,
"border"_a = 0);
64 declareImagePca<Image<int>>(mod,
"I");
65 declareImagePca<Image<float>>(mod,
"F");
66 declareImagePca<Image<double>>(mod,
"D");
67 declareImagePca<Image<std::uint16_t>>(mod,
"U");
68 declareImagePca<Image<std::uint64_t>>(mod,
"L");
69 declareImagePca<MaskedImage<int>>(mod,
"MI");
70 declareImagePca<MaskedImage<float>>(mod,
"MF");
71 declareImagePca<MaskedImage<double>>(mod,
"MD");
72 declareImagePca<MaskedImage<std::uint16_t>>(mod,
"MU");
73 declareImagePca<MaskedImage<std::uint64_t>>(mod,
"ML");
75 declareInnerProduct<Image<int>,
Image<int>>(mod);