LSST Applications g0265f82a02+d6b5cd48b5,g02d81e74bb+a41d3748ce,g1470d8bcf6+6be6c9203b,g2079a07aa2+14824f138e,g212a7c68fe+a4f2ea4efa,g2305ad1205+72971fe858,g295015adf3+ab2c85acae,g2bbee38e9b+d6b5cd48b5,g337abbeb29+d6b5cd48b5,g3ddfee87b4+31b3a28dff,g487adcacf7+082e807817,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+b2918d57ae,g5a732f18d5+66d966b544,g64a986408d+a41d3748ce,g858d7b2824+a41d3748ce,g8a8a8dda67+a6fc98d2e7,g99cad8db69+7fe4acdf18,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga8c6da7877+84af8b3ff8,gb0e22166c9+3863383f4c,gb6a65358fc+d6b5cd48b5,gba4ed39666+9664299f35,gbb8dafda3b+d8d527deb2,gc07e1c2157+b2dbe6b631,gc120e1dc64+61440b2abb,gc28159a63d+d6b5cd48b5,gcf0d15dbbd+31b3a28dff,gdaeeff99f8+a38ce5ea23,ge6526c86ff+39927bb362,ge79ae78c31+d6b5cd48b5,gee10cc3b42+a6fc98d2e7,gf1cff7945b+a41d3748ce,v24.1.5.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
psf.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/stl.h"
25
26
27#include "ndarray/pybind11.h"
28
29#include "lsst/meas/extensions/psfex/psf.hh"
30
31namespace py = pybind11;
32using namespace pybind11::literals;
33
34namespace lsst {
35namespace meas {
36namespace extensions {
37namespace psfex {
38
40 using PyContext = py::class_<Context>;
41
42 wrappers.wrapType(PyContext(wrappers.module, "Context"), [](auto &mod, auto &clsContext) {
43
44 clsContext.attr("KEEPHIDDEN") = py::cast(static_cast<int>(Context::KEEPHIDDEN));
45 clsContext.attr("REMOVEHIDDEN") = py::cast(static_cast<int>(Context::REMOVEHIDDEN));
46
47 clsContext.def(
48 py::init<std::vector<std::string> const &, std::vector<int> const &, std::vector<int> const &, bool>(),
49 "names"_a, "group"_a, "degree"_a, "pcexflag"_a);
50
51 clsContext.def("getName", &Context::getName);
52 clsContext.def("getNpc", &Context::getNpc);
53 clsContext.def("getPcflag", &Context::getPcflag);
54 clsContext.def("getPc", &Context::getPc);
55 });
56
57 using PySample = py::class_<Sample>;
58 wrappers.wrapType(PySample(wrappers.module, "Sample"), [](auto &mod, auto &clsSample) {
59
60 clsSample.def("getCatindex", &Sample::getCatindex);
61 clsSample.def("setCatindex", &Sample::setCatindex);
62 clsSample.def("getObjindex", &Sample::getObjindex);
63 clsSample.def("setObjindex", &Sample::setObjindex);
64 clsSample.def("getExtindex", &Sample::getExtindex);
65 clsSample.def("setExtindex", &Sample::setExtindex);
66 clsSample.def("setVig", &Sample::setVig);
67 clsSample.def("setNorm", &Sample::setNorm);
68 clsSample.def("setBacknoise2", &Sample::setBacknoise2);
69 clsSample.def("setGain", &Sample::setGain);
70 clsSample.def("setX", &Sample::setX);
71 clsSample.def("setY", &Sample::setY);
72 clsSample.def("setContext", &Sample::setContext);
73 clsSample.def("setFluxrad", &Sample::setFluxrad);
74 clsSample.def("getVig", &Sample::getVig);
75 clsSample.def("getVigResi", &Sample::getVigResi);
76 clsSample.def("getVigChi", &Sample::getVigChi);
77 clsSample.def("getVigWeight", &Sample::getVigWeight);
78 clsSample.def("getXY", &Sample::getXY);
79 clsSample.def("getNorm", &Sample::getNorm);
80 });
81
82 using PySet = py::class_<Set, std::shared_ptr<Set>>;
83 wrappers.wrapType(PySet(wrappers.module, "Set"), [](auto &mod, auto &clsSet) {
84 clsSet.def(py::init<Context &>());
85
86 clsSet.def("newSample", &Set::newSample);
87 clsSet.def("trimMemory", &Set::trimMemory);
88 clsSet.def("getFwhm", &Set::getFwhm);
89 clsSet.def("setFwhm", &Set::setFwhm);
90 clsSet.def("getNcontext", &Set::getNcontext);
91 clsSet.def("getNsample", &Set::getNsample);
92 clsSet.def("getContextOffset", &Set::getContextOffset);
93 clsSet.def("setContextOffset", &Set::setContextOffset);
94 clsSet.def("getContextScale", &Set::getContextScale);
95 clsSet.def("setContextScale", &Set::setContextScale);
96 clsSet.def("getRecentroid", &Set::getRecentroid);
97 clsSet.def("setRecentroid", &Set::setRecentroid);
98 clsSet.def("setVigSize", &Set::setVigSize);
99 clsSet.def("finiSample", &Set::finiSample);
100 clsSet.def("empty", &Set::empty);
101 clsSet.def("getContextNames", &Set::getContextNames);
102 clsSet.def("setContextname", &Set::setContextname);
103 clsSet.def("setBadFlags", &Set::setBadFlags);
104 clsSet.def("getBadFlags", &Set::getBadFlags);
105 clsSet.def("setBadSN", &Set::setBadSN);
106 clsSet.def("getBadSN", &Set::getBadSN);
107 clsSet.def("setBadFrmin", &Set::setBadFrmin);
108 clsSet.def("getBadFrmin", &Set::getBadFrmin);
109 clsSet.def("setBadFrmax", &Set::setBadFrmax);
110 clsSet.def("getBadFrmax", &Set::getBadFrmax);
111 clsSet.def("setBadElong", &Set::setBadElong);
112 clsSet.def("getBadElong", &Set::getBadElong);
113 clsSet.def("setBadPix", &Set::setBadPix);
114 clsSet.def("getBadPix", &Set::getBadPix);
115 clsSet.def("getSample", &Set::getSample);
116 });
117
118 using PyPsf = py::class_<Psf>;
119 wrappers.wrapType(PyPsf(wrappers.module, "Psf"), [](auto &mod, auto &clsPsf) {
120 clsPsf.def(py::init<>());
121
122 clsPsf.def("getLoc", &Psf::getLoc);
123 clsPsf.def("getResi", &Psf::getResi);
124 clsPsf.def("build", &Psf::build,
125 "x"_a, "y"_a, "other"_a = std::vector<double>());
126 clsPsf.def("clip", &Psf::clip);
127 });
128}
129
130} // psfex
131} // extensions
132} // meas
133} // lsst
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
PyType wrapType(PyType cls, ClassWrapperCallback function, bool setModuleName=true)
Add a type (class or enum) wrapper, deferring method and other attribute definitions until finish() i...
Definition python.h:391
void wrapPsf(WrapperCollection &wrappers)
Definition psf.cc:39