lsst.afw  13.0-94-ga1c444047
observatory.cc
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2008-2016 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 afw {
32 namespace coord {
33 
35  py::module mod("_observatory", "Python wrapper for afw _observatory library");
36 
37  py::class_<Observatory, std::shared_ptr<Observatory>> cls(mod, "Observatory");
38 
39  /* Constructors */
40  cls.def(py::init<lsst::afw::geom::Angle const, lsst::afw::geom::Angle const, double const>());
41  cls.def(py::init<std::string const, std::string const, double const>());
42 
43  /* Operators */
44  cls.def("__eq__", [](Observatory const& self, Observatory const& other) { return self == other; },
45  py::is_operator());
46  cls.def("__ne__", [](Observatory const& self, Observatory const& other) { return self != other; },
47  py::is_operator());
48  cls.def("__str__", &Observatory::toString);
49  cls.def("__repr__", &Observatory::toString);
50 
51  /* Members */
52  cls.def("getLongitude", &Observatory::getLongitude);
53  cls.def("getLatitude", &Observatory::getLatitude);
54  cls.def("getElevation", &Observatory::getElevation);
55  cls.def("getLatitudeStr", &Observatory::getLatitudeStr);
56  cls.def("getLongitudeStr", &Observatory::getLongitudeStr);
57  cls.def("setLongitude", &Observatory::setLongitude, "longitude"_a);
58  cls.def("setLatitude", &Observatory::setLatitude, "latitude"_a);
59  cls.def("setElevation", &Observatory::setElevation, "elevation"_a);
60 
61  return mod.ptr();
62 }
63 }
64 }
65 } // namespace lsst::afw::coord
Hold the location of an observatory.
Definition: Observatory.h:41
PYBIND11_PLUGIN(_observatory)
Definition: observatory.cc:34
A base class for image defects.
Definition: cameraGeom.dox:3