LSST Applications 29.1.1,g0fba68d861+94d977d4f8,g1fd858c14a+0a42b1a450,g21d47ad084+bae5d1592d,g35bb328faa+fcb1d3bbc8,g36ff55ed5b+4036fd6440,g4e0f332c67+abab7ee1ee,g53246c7159+fcb1d3bbc8,g60b5630c4e+4036fd6440,g67b6fd64d1+31de10a2f7,g72a202582f+7a25662ef1,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g86c591e316+1a75853d69,g8852436030+8220ab3cb6,g88f4e072da+7005418d1d,g89139ef638+31de10a2f7,g8b8da53e10+8f7b08dc1c,g9125e01d80+fcb1d3bbc8,g989de1cb63+31de10a2f7,g9f1445be69+4036fd6440,g9f33ca652e+fcef3ba435,ga9baa6287d+4036fd6440,ga9e4eb89a6+a41a34c2ba,gabe3b4be73+1e0a283bba,gb0b61e0e8e+d456af7c26,gb1101e3267+f17a9d70ea,gb58c049af0+f03b321e39,gb89ab40317+31de10a2f7,gce29eb0867+05ed69485a,gcf25f946ba+8220ab3cb6,gd6cbbdb0b4+11317e7a17,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+b4f50ea554,ge278dab8ac+50e2446c94,ge410e46f29+31de10a2f7,ge80e9994a3+32bb9bc1c9,gf5e32f922b+fcb1d3bbc8,gf67bdafdda+31de10a2f7
LSST Data Management Base Package
Loading...
Searching...
No Matches
frameSet.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
24namespace py = pybind11;
25using namespace pybind11::literals;
26
27#include "astshim/Frame.h"
28#include "astshim/FrameSet.h"
30
31namespace ast {
32
34 using PyFrameSet = py::class_<FrameSet, std::shared_ptr<FrameSet>, Frame>;
35 wrappers.wrapType(PyFrameSet(wrappers.module, "FrameSet"), [](auto &mod, auto &cls) {
36 cls.def(py::init<Frame const &, std::string const &>(), "frame"_a, "options"_a = "");
37 cls.def(py::init<Frame const &, Mapping const &, Frame const &, std::string const &>(), "baseFrame"_a,
38 "mapping"_a, "currentFrame"_a, "options"_a = "");
39 cls.def(py::init<Frame const &>());
40
41 // def_readonly_static makes in only available in the class, not instances, so...
42 cls.attr("BASE") = py::cast(AST__BASE);
43 cls.attr("CURRENT") = py::cast(AST__CURRENT);
44 cls.attr("NOFRAME") = py::cast(AST__NOFRAME);
45
46 cls.def_property("base", &FrameSet::getBase, &FrameSet::setBase);
47 cls.def_property("current", &FrameSet::getCurrent, &FrameSet::setCurrent);
48 cls.def_property_readonly("nFrame", &FrameSet::getNFrame);
49
50 cls.def("copy", &FrameSet::copy);
51 cls.def("addAxes", &FrameSet::addAxes);
52 cls.def("addFrame", &FrameSet::addFrame, "iframe"_a, "map"_a, "frame"_a);
53 cls.def("addVariant", &FrameSet::addVariant, "map"_a, "name"_a);
54 cls.def("getAllVariants", &FrameSet::getAllVariants);
55 cls.def("getFrame", &FrameSet::getFrame, "iframe"_a, "copy"_a = true);
56 cls.def("getMapping", &FrameSet::getMapping, "from"_a = FrameSet::BASE, "to"_a = FrameSet::CURRENT);
57 cls.def("getVariant", &FrameSet::getVariant);
58 cls.def("mirrorVariants", &FrameSet::mirrorVariants, "iframe"_a);
59 cls.def("remapFrame", &FrameSet::remapFrame, "iframe"_a, "map"_a);
60 cls.def("removeFrame", &FrameSet::removeFrame, "iframe"_a);
61 cls.def("renameVariant", &FrameSet::renameVariant, "name"_a);
62 });
63}
64
65} // namespace ast
Frame is used to represent a coordinate system.
Definition Frame.h:157
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
pybind11::module module
The module object passed to the PYBIND11_MODULE block that contains this WrapperCollection.
Definition python.h:448
AST wrapper classes and functions.
void wrapFrameSet(WrapperCollection &)
Definition frameSet.cc:33