22 #include <pybind11/pybind11.h>
23 #include <pybind11/stl.h>
33 using namespace pybind11::literals;
39 py::class_<DirectionPoint> cls(mod,
"DirectionPoint");
41 cls.def(py::init<double, PointD>(),
"direction"_a,
"point"_a);
43 cls.def_readwrite(
"direction", &DirectionPoint::direction);
44 cls.def_readwrite(
"point", &DirectionPoint::point);
48 py::class_<NReadValue> cls(mod,
"NReadValue");
50 cls.def(py::init<int, double>(),
"nread"_a,
"value"_a);
52 cls.def_readwrite(
"nread", &NReadValue::nread);
53 cls.def_readwrite(
"value", &NReadValue::value);
57 py::class_<ResolvedPoint> cls(mod,
"ResolvedPoint");
59 cls.def(py::init<int>(),
"naxes"_a);
61 cls.def_readwrite(
"point", &ResolvedPoint::point);
62 cls.def_readwrite(
"d1", &ResolvedPoint::d1);
63 cls.def_readwrite(
"d2", &ResolvedPoint::d2);
67 py::class_<FrameMapping> cls(mod,
"FrameMapping");
71 cls.def_readwrite(
"frame", &FrameMapping::frame);
72 cls.def_readwrite(
"mapping", &FrameMapping::mapping);
76 py::module::import(
"astshim.mapping");
78 wrapDirectionPoint(mod);
80 wrapResolvedPoint(mod);
81 wrapFrameMapping(mod);
83 py::class_<Frame, std::shared_ptr<Frame>, Mapping> cls(mod,
"Frame");
85 cls.def(py::init<int, std::string const &>(),
"naxes"_a,
"options"_a =
"");
86 cls.def(py::init<Frame const &>());
88 cls.def_property(
"activeUnit", &Frame::getActiveUnit, &Frame::setActiveUnit);
89 cls.def_property(
"alignSystem", &Frame::getAlignSystem, &Frame::setAlignSystem);
90 cls.def_property(
"domain", &Frame::getDomain, &Frame::setDomain);
91 cls.def_property(
"dut1", &Frame::getDut1, &Frame::setDut1);
92 cls.def_property(
"epoch", &Frame::getEpoch, py::overload_cast<double>(&Frame::setEpoch));
93 cls.def_property(
"matchEnd", &Frame::getMatchEnd, &Frame::setMatchEnd);
94 cls.def_property(
"maxAxes", &Frame::getMaxAxes, &Frame::setMaxAxes);
95 cls.def_property(
"minAxes", &Frame::getMinAxes, &Frame::setMinAxes);
96 cls.def_property_readonly(
"nAxes", &Frame::getNAxes);
97 cls.def_property(
"obsAlt", &Frame::getObsAlt, &Frame::setObsAlt);
98 cls.def_property(
"obsLat", &Frame::getObsLat, &Frame::setObsLat);
99 cls.def_property(
"obsLon", &Frame::getObsLon, &Frame::setObsLon);
100 cls.def_property(
"permute", &Frame::getPermute, &Frame::setPermute);
101 cls.def_property(
"preserveAxes", &Frame::getPreserveAxes, &Frame::setPreserveAxes);
102 cls.def_property(
"system", &Frame::getSystem, &Frame::setSystem);
103 cls.def_property(
"title", &Frame::getTitle, &Frame::setTitle);
105 cls.def(
"copy", &Frame::copy);
107 cls.def(
"axAngle", &Frame::axAngle,
"a"_a,
"b"_a,
"axis"_a);
108 cls.def(
"axDistance", &Frame::axDistance,
"axis"_a,
"v1"_a,
"v2"_a);
109 cls.def(
"axOffset", &Frame::axOffset,
"axis"_a,
"v1"_a,
"dist"_a);
110 cls.def(
"convert", &Frame::convert,
"to"_a,
"domainlist"_a =
"");
112 cls.def(
"findFrame", &Frame::findFrame,
"template"_a,
"domainlist"_a =
"");
114 cls.def(
"getBottom", &Frame::getBottom,
"axis"_a);
115 cls.def(
"getDigits", py::overload_cast<>(&Frame::getDigits, py::const_));
116 cls.def(
"getDigits", py::overload_cast<int>(&Frame::getDigits, py::const_),
"axis"_a);
117 cls.def(
"getDirection", &Frame::getDirection,
"axis"_a);
118 cls.def(
"getFormat", &Frame::getFormat,
"axis"_a);
119 cls.def(
"getInternalUnit", &Frame::getInternalUnit);
120 cls.def(
"getLabel", &Frame::getLabel);
121 cls.def(
"getSymbol", &Frame::getSymbol,
"axis"_a);
122 cls.def(
"getNormUnit", &Frame::getNormUnit,
"axis"_a);
123 cls.def(
"getSymbol", &Frame::getSymbol,
"axis"_a);
124 cls.def(
"getTop", &Frame::getTop,
"axis"_a);
125 cls.def(
"getUnit", &Frame::getUnit,
"axis"_a);
126 cls.def(
"intersect", &Frame::intersect,
"a1"_a,
"a2"_a,
"b1"_a,
"b2"_a);
127 cls.def(
"matchAxes", &Frame::matchAxes,
"other"_a);
128 cls.def(
"under", &Frame::under,
"next"_a);
130 cls.def(
"offset", &Frame::offset,
"point1"_a,
"point2"_a,
"offset"_a);
131 cls.def(
"offset2", &Frame::offset2,
"point1"_a,
"angle"_a,
"offset"_a);
132 cls.def(
"permAxes", &Frame::permAxes,
"perm"_a);
133 cls.def(
"pickAxes", &Frame::pickAxes,
"axes"_a);
134 cls.def(
"resolve", &Frame::resolve,
"point1"_a,
"point2"_a,
"point3"_a);
135 cls.def(
"setDigits", py::overload_cast<int>(&Frame::setDigits),
"digits"_a);
136 cls.def(
"setDigits", py::overload_cast<int, int>(&Frame::setDigits),
"axis"_a,
"digits"_a);
137 cls.def(
"setDirection", &Frame::setDirection,
"direction"_a,
"axis"_a);
139 cls.def(
"setEpoch", py::overload_cast<std::string const &>(&Frame::setEpoch),
"epoch"_a);
140 cls.def(
"setFormat", &Frame::setFormat,
"axis"_a,
143 cls.def(
"setLabel", &Frame::setLabel,
"axis"_a,
"label"_a);
144 cls.def(
"setSymbol", &Frame::setSymbol,
"axis"_a,
"symbol"_a);
145 cls.def(
"setTop", &Frame::setTop,
"axis"_a,
"top"_a);
146 cls.def(
"setUnit", &Frame::setUnit,
"axis"_a,
"unit"_a);
147 cls.def(
"unformat", &Frame::unformat,
"axis"_a,
"str"_a);
table::Key< double > angle
PYBIND11_MODULE(imageUtils, mod)
AST wrapper classes and functions.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)