lsst.shapelet  13.0-4-g5a043c4+13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
gaussHermiteProjection.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  *
4  * This product includes software developed by the
5  * LSST Project (http://www.lsst.org/).
6  * See the COPYRIGHT file
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the LSST License Statement and
19  * the GNU General Public License along with this program. If not,
20  * see <https://www.lsstcorp.org/LegalNotices/>.
21  */
22 #include "pybind11/pybind11.h"
23 
24 #include "numpy/arrayobject.h"
25 #include "ndarray/pybind11.h"
26 
28 
29 namespace py = pybind11;
30 using namespace pybind11::literals;
31 
32 namespace lsst {
33 namespace shapelet {
34 
35 PYBIND11_PLUGIN(gaussHermiteProjection) {
36  py::module::import("lsst.afw.geom");
37  py::module mod("gaussHermiteProjection");
38 
39  if (_import_array() < 0) {
40  PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
41  return nullptr;
42  }
43 
44  py::class_<GaussHermiteProjection, std::shared_ptr<GaussHermiteProjection>> clsGaussHermiteProjection(
45  mod, "GaussHermiteProjection");
46 
47  clsGaussHermiteProjection.def(py::init<int>(), "maxOrder"_a);
48 
49  clsGaussHermiteProjection.def("compute",
50  (Eigen::MatrixXd (GaussHermiteProjection::*)(
51  afw::geom::ellipses::Quadrupole const &, int inputOrder,
52  afw::geom::ellipses::Quadrupole const &, int outputOrder) const) &
53  GaussHermiteProjection::compute);
54  clsGaussHermiteProjection.def("compute",
55  (Eigen::MatrixXd (GaussHermiteProjection::*)(
56  afw::geom::LinearTransform const &, int inputOrder,
57  afw::geom::LinearTransform const &, int outputOrder) const) &
58  GaussHermiteProjection::compute);
59  clsGaussHermiteProjection.def(
60  "compute", (Eigen::MatrixXd (GaussHermiteProjection::*)(Eigen::Matrix2d const &, int,
61  Eigen::Matrix2d const &, int) const) &
62  GaussHermiteProjection::compute);
63 
64  clsGaussHermiteProjection.def("getMaxOrder", &GaussHermiteProjection::getMaxOrder);
65 
66  return mod.ptr();
67 }
68 
69 } // shapelet
70 } // lsst
PYBIND11_PLUGIN(basisEvaluator)