lsst.meas.base  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
sincCoeffs.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2008-2017 AURA/LSST.
4  *
5  * This product includes software developed by the
6  * LSST Project (http://www.lsst.org/).
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 
23 #include "pybind11/pybind11.h"
24 
26 
27 namespace py = pybind11;
28 using namespace pybind11::literals;
29 
30 namespace lsst {
31 namespace meas {
32 namespace base {
33 
34 namespace {
35  template <typename T>
36  void declareSincCoeffs(py::module & mod, std::string const & suffix) {
37  /* Module level */
38  py::class_<SincCoeffs<T>> cls(mod, ("SincCoeffs" + suffix).c_str());
39 
40  /* Members */
41  cls.def_static("cache", &SincCoeffs<T>::cache, "rInner"_a, "rOuter"_a);
42  cls.def_static("get", &SincCoeffs<T>::get, "outerEllipse"_a, "innerRadiusFactor"_a);
43  }
44 }
45 
46 PYBIND11_PLUGIN(sincCoeffs) {
47  py::module::import("lsst.afw.geom");
48  py::module::import("lsst.afw.image");
49 
50  py::module mod("sincCoeffs");
51 
52  declareSincCoeffs<float>(mod, "F");
53  declareSincCoeffs<double>(mod, "D");
54 
55  return mod.ptr();
56 }
57 
58 } // base
59 } // meas
60 } // lsst
PYBIND11_PLUGIN(algorithm)
Definition: algorithm.cc:37