LSSTApplications  20.0.0
LSSTDataManagementBasePackage
basisLists.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 #include "pybind11/eigen.h"
24 #include "pybind11/stl.h"
25 
26 #include <Eigen/Core>
27 
28 #include "ndarray/pybind11.h"
29 
31 
32 namespace py = pybind11;
33 using namespace pybind11::literals;
34 
35 namespace lsst {
36 namespace ip {
37 namespace diffim {
38 
39 PYBIND11_MODULE(basisLists, mod) {
40  py::module::import("lsst.afw.math");
41  py::module::import("lsst.daf.base");
42 
43  mod.def("makeDeltaFunctionBasisList", &makeDeltaFunctionBasisList, "width"_a, "height"_a);
44  mod.def("makeRegularizationMatrix", &makeRegularizationMatrix, "ps"_a);
45  mod.def("makeForwardDifferenceMatrix", &makeForwardDifferenceMatrix, "width"_a, "height"_a, "orders"_a,
46  "borderPenalty"_a, "fitForBackground"_a);
47  mod.def("makeCentralDifferenceMatrix", &makeCentralDifferenceMatrix, "width"_a, "height"_a, "stencil"_a,
48  "borderPenalty"_a, "fitForBackground"_a);
49  mod.def("renormalizeKernelList", &renormalizeKernelList, "kernelListIn"_a);
50  mod.def("makeAlardLuptonBasisList", &makeAlardLuptonBasisList, "halfWidth"_a, "nGauss"_a, "sigGauss"_a,
51  "degGauss"_a);
52 }
53 
54 } // diffim
55 } // ip
56 } // lsst
lsst::ip::diffim::makeRegularizationMatrix
Eigen::MatrixXd makeRegularizationMatrix(lsst::daf::base::PropertySet const &ps)
Build a regularization matrix for Delta function kernels.
Definition: BasisLists.cc:149
lsst::ip::diffim::PYBIND11_MODULE
PYBIND11_MODULE(basisLists, mod)
Definition: basisLists.cc:39
lsst::ip::diffim::makeDeltaFunctionBasisList
lsst::afw::math::KernelList makeDeltaFunctionBasisList(int width, int height)
Build a set of Delta Function basis kernels.
Definition: BasisLists.cc:47
BasisLists.h
Subroutines associated with generating, normalising, and regularising Basis functions.
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::ip::diffim::makeCentralDifferenceMatrix
Eigen::MatrixXd makeCentralDifferenceMatrix(int width, int height, int stencil, float borderPenalty, bool fitForBackground)
Build a central difference Laplacian regularization matrix for Delta function kernels.
Definition: BasisLists.cc:209
lsst::ip::diffim::makeAlardLuptonBasisList
lsst::afw::math::KernelList makeAlardLuptonBasisList(int halfWidth, int nGauss, std::vector< double > const &sigGauss, std::vector< int > const &degGauss)
Build a set of Alard/Lupton basis kernels.
Definition: BasisLists.cc:78
pybind11
Definition: _GenericMap.cc:40
lsst::ip::diffim::renormalizeKernelList
lsst::afw::math::KernelList renormalizeKernelList(lsst::afw::math::KernelList const &kernelListIn)
Renormalize a list of basis kernels.
Definition: BasisLists.cc:414
lsst::ip::diffim::makeForwardDifferenceMatrix
Eigen::MatrixXd makeForwardDifferenceMatrix(int width, int height, std::vector< int > const &orders, float borderPenalty, bool fitForBackground)
Build a forward difference regularization matrix for Delta function kernels.
Definition: BasisLists.cc:311