LSSTApplications  18.1.0
LSSTDataManagementBasePackage
wcsUtils.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2018 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 <memory>
24 #include <vector>
25 
26 #include "pybind11/pybind11.h"
27 #include "pybind11/stl.h"
28 
29 #include "lsst/afw/table/fwd.h"
30 #include "lsst/afw/table/Simple.h"
31 #include "lsst/afw/table/Source.h"
33 
34 namespace py = pybind11;
35 using namespace pybind11::literals;
36 
37 namespace lsst {
38 namespace afw {
39 namespace table {
40 namespace {
41 
42 template <typename ReferenceCollection>
43 void declareUpdateRefCentroids(py::module &mod) {
44  mod.def("updateRefCentroids", updateRefCentroids<ReferenceCollection>, "wcs"_a, "refList"_a);
45 }
46 
47 template <typename SourceCollection>
48 void declareUpdateSourceCoords(py::module &mod) {
49  mod.def("updateSourceCoords", updateSourceCoords<SourceCollection>, "wcs"_a, "sourceList"_a);
50 }
51 
53  py::module::import("lsst.afw.table.aggregates");
54  py::module::import("lsst.afw.table.simple");
55  py::module::import("lsst.afw.table.source");
56 
57  declareUpdateRefCentroids<std::vector<std::shared_ptr<lsst::afw::table::SimpleRecord>>>(mod);
58  declareUpdateRefCentroids<lsst::afw::table::SimpleCatalog>(mod);
59 
60  declareUpdateSourceCoords<std::vector<std::shared_ptr<lsst::afw::table::SourceRecord>>>(mod);
61  declareUpdateSourceCoords<lsst::afw::table::SourceCatalog>(mod);
62 }
63 
64 } // namespace
65 } // namespace table
66 } // namespace afw
67 } // namespace lsst
PYBIND11_MODULE(camera, mod)
Definition: camera.cc:34
A base class for image defects.