lsst.shapelet  13.0-3-g20b541e+9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
hermiteTransformMatrix.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(hermiteTransformMatrix) {
36  py::module::import("lsst.afw.geom");
37 
38  py::module mod("hermiteTransformMatrix");
39 
40  if (_import_array() < 0) {
41  PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
42  return nullptr;
43  }
44 
45  py::class_<HermiteTransformMatrix, std::shared_ptr<HermiteTransformMatrix>> clsHermiteTransformMatrix(
46  mod, "HermiteTransformMatrix");
47 
48  clsHermiteTransformMatrix.def(py::init<int>(), "order"_a);
49 
50  clsHermiteTransformMatrix.def(
51  "compute", (Eigen::MatrixXd (HermiteTransformMatrix::*)(Eigen::Matrix2d const &) const) &
52  HermiteTransformMatrix::compute,
53  "transform"_a);
54  clsHermiteTransformMatrix.def(
55  "compute",
56  (Eigen::MatrixXd (HermiteTransformMatrix::*)(afw::geom::LinearTransform const &) const) &
57  HermiteTransformMatrix::compute,
58  "transform"_a);
59  clsHermiteTransformMatrix.def(
60  "compute", (Eigen::MatrixXd (HermiteTransformMatrix::*)(Eigen::Matrix2d const &, int) const) &
61  HermiteTransformMatrix::compute,
62  "transform"_a, "order"_a);
63  clsHermiteTransformMatrix.def("compute", (Eigen::MatrixXd (HermiteTransformMatrix::*)(
64  afw::geom::LinearTransform const &, int) const) &
65  HermiteTransformMatrix::compute,
66  "transform"_a, "order"_a);
67 
68  clsHermiteTransformMatrix.def("getCoefficientMatrix", &HermiteTransformMatrix::getCoefficientMatrix);
69  clsHermiteTransformMatrix.def("getInverseCoefficientMatrix",
70  &HermiteTransformMatrix::getInverseCoefficientMatrix);
71  clsHermiteTransformMatrix.def("getOrder", &HermiteTransformMatrix::getOrder);
72 
73  return mod.ptr();
74 }
75 
76 } // shapelet
77 } // lsst
PYBIND11_PLUGIN(basisEvaluator)
A class that computes a matrix that applies a linear transform to a 2-d Hermite polynomial expansion...