LSST Applications g044012fb7c+304891ab8a,g04a91732dc+4e1b87f259,g07dc498a13+f701f15b83,g114c6a66ad+c7887c1284,g1409bbee79+f701f15b83,g1a7e361dbc+f701f15b83,g1fd858c14a+6ebd102b59,g35bb328faa+0eb18584fe,g3bd4b5ce2c+e83bf4edc8,g4e0f332c67+976ceb6bc8,g53246c7159+0eb18584fe,g5477a8d5ce+51234355ef,g60b5630c4e+c7887c1284,g623d845a50+c7887c1284,g6f0c2978f1+98123c34b6,g71fabbc107+c7887c1284,g75b6c65c88+ce466f4385,g78460c75b0+85633614c8,g786e29fd12+02b9b86fc9,g8852436030+cfe5cf5b7b,g89139ef638+f701f15b83,g9125e01d80+0eb18584fe,g95236ca021+d4f98599f0,g974caa22f6+0eb18584fe,g989de1cb63+f701f15b83,g9f33ca652e+b4908f5dcd,gaaedd4e678+f701f15b83,gabe3b4be73+543c3c03c9,gace736f484+07e57cea59,gb1101e3267+487fd1b06d,gb58c049af0+492386d360,gc99c83e5f0+a513197d39,gcf25f946ba+cfe5cf5b7b,gd0fa69b896+babbe6e5fe,gd6cbbdb0b4+3fef02d88a,gde0f65d7ad+e8379653a2,ge278dab8ac+ae64226a64,gfba249425e+0eb18584fe,w.2025.07
LSST Data Management Base Package
Loading...
Searching...
No Matches
_defect.cc
Go to the documentation of this file.
1/*
2 * This file is part of afw.
3 *
4 * Developed for the LSST Data Management System.
5 * This product includes software developed by the LSST Project
6 * (https://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#include "pybind11/pybind11.h"
26
28
29namespace py = pybind11;
30using namespace pybind11::literals;
31
32namespace lsst {
33namespace afw {
34namespace image {
35namespace {
36
37using PyDefectBase = py::class_<DefectBase, std::shared_ptr<DefectBase>>;
38
39void declareDefects(lsst::cpputils::python::WrapperCollection &wrappers) {
40 wrappers.wrapType(PyDefectBase(wrappers.module, "DefectBase"), [](auto &mod, auto &cls) {
41 /* Constructors */
42 cls.def(py::init<const lsst::geom::Box2I &>(), "bbox"_a);
43
44 /* Members */
45 cls.def("getBBox", &DefectBase::getBBox);
46 cls.def("getX0", &DefectBase::getX0);
47 cls.def("getX1", &DefectBase::getX1);
48 cls.def("getY0", &DefectBase::getY0);
49 cls.def("getY1", &DefectBase::getY1);
50 cls.def("clip", &DefectBase::clip);
51 cls.def("shift", (void (DefectBase::*)(int, int)) & DefectBase::shift, "dx"_a, "dy"_a);
52 cls.def("shift", (void (DefectBase::*)(lsst::geom::Extent2I const &)) & DefectBase::shift, "d"_a);
53 });
54}
55} // namespace
57 wrappers.addSignatureDependency("lsst.afw.geom");
58 declareDefects(wrappers);
59}
60} // namespace image
61} // namespace afw
62} // namespace lsst
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
void addSignatureDependency(std::string const &name)
Indicate an external module that provides a type used in function/method signatures.
Definition python.h:357
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
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
Definition python.h:448
void wrapDefect(lsst::cpputils::python::WrapperCollection &wrappers)
Definition _defect.cc:56