22#include <pybind11/pybind11.h>
23#include <pybind11/stl.h>
33using namespace pybind11::literals;
38void wrapDirectionPoint(py::module &mod) {
39 py::class_<DirectionPoint>
cls(mod,
"DirectionPoint");
41 cls.def(py::init<double, PointD>(),
"direction"_a,
"point"_a);
47void wrapNReadValue(py::module &mod) {
48 py::class_<NReadValue>
cls(mod,
"NReadValue");
50 cls.def(py::init<int, double>(),
"nread"_a,
"value"_a);
56void wrapResolvedPoint(py::module &mod) {
57 py::class_<ResolvedPoint>
cls(mod,
"ResolvedPoint");
59 cls.def(py::init<int>(),
"naxes"_a);
66void wrapFrameMapping(py::module &mod) {
67 py::class_<FrameMapping>
cls(mod,
"FrameMapping");
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 &>());
136 cls.def(
"setDigits", py::overload_cast<int, int>(&
Frame::setDigits),
"axis"_a,
"digits"_a);
139 cls.def(
"setEpoch", py::overload_cast<std::string const &>(&
Frame::setEpoch),
"epoch"_a);
double direction
Direction, an angle in radians.
void permAxes(std::vector< int > perm)
Permute the order in which a Frame's axes occur.
NReadValue unformat(int axis, std::string const &str) const
Read a formatted coordinate value (given as a character string) for a Frame axis and return the numbe...
double axDistance(int axis, double v1, double v2) const
Return a signed value representing the axis increment from axis value v1 to axis value v2.
std::string getFormat(int axis) const
Get Format for one axis: format specification for axis values.
int getMaxAxes() const
Get MaxAxes: the maximum axes a frame found by findFrame may have.
double getDut1() const
Get Dut1: difference between the UT1 and UTC timescale (sec)
void setSymbol(int axis, std::string const &symbol)
Set Symbol(axis) for one axis: axis symbol.
void setActiveUnit(bool enable)
Set ActiveUnit: pay attention to units when one Frame is used to match another?
std::string getObsLat() const
Get ObsLat: Geodetic latitude of observer.
int getMinAxes() const
Get MinAxes: the maximum axes a frame found by findFrame may have.
void setMaxAxes(int maxAxes)
Get MaxAxes: the maximum number of axes a frame found by findFrame may have.
virtual void setDomain(std::string const &domain)
Set Domain: coordinate system domain.
double axOffset(int axis, double v1, double dist) const
Return an axis value formed by adding a signed axis increment onto a supplied axis value.
std::string getSymbol(int axis) const
Get Symbol(axis) for one axis: axis symbol.
double axAngle(PointD const &a, PointD const &b, int axis) const
Find the angle, as seen from point A, between the positive direction of a specified axis,...
double getBottom(int axis) const
Get Bottom for one axis: the lowest axis value to display.
void setPermute(bool permute)
Set Permute: allow axis permutation when used as a template?
bool getPermute() const
Get Permute: allow axis permutation when used as a template?
int getDigits() const
Get Digits: the default used if no specific value specified for an axis.
int getNAxes() const
Get NAxes: the number of axes in the frame (i.e.
std::string getAlignSystem() const
Get AlignSystem: the coordinate system used by convert and findFrame to align Frames.
double distance(PointD const &point1, PointD const &point2) const
Find the distance between two points whose Frame coordinates are given.
void setDigits(int digits)
Set Digits for all axes: number of digits of precision.
std::string getDomain() const
Get Domain: coordinate system domain.
void setFormat(int axis, std::string const &format)
Set Format for one axis: format specification for axis values.
std::string getSystem() const
Get System: coordinate system used to describe positions within the domain.
void setDirection(bool direction, int axis)
Set Direction for one axis: display axis in conventional direction?
std::shared_ptr< FrameSet > findFrame(Frame const &tmplt, std::string const &domainlist="")
Find a coordinate system with specified characteristics.
PointD offset(PointD point1, PointD point2, double offset) const
Find the point which is offset a specified distance along the geodesic curve between two other points...
double angle(PointD const &a, PointD const &b, PointD const &c) const
Find the angle at point B between the line joining points A and B, and the line joining points C and ...
std::string getNormUnit(int axis) const
Get NormUnit(axis) read-only attribute for one frame: normalised physical units for formatted axis va...
std::shared_ptr< Frame > copy() const
Return a deep copy of this object.
double getObsAlt() const
Get ObsAlt: Geodetic altitude of observer (m).
std::string getInternalUnit(int axis) const
Get InternalUnit(axis) read-only attribute for one axis: physical units for unformated axis values.
void setPreserveAxes(bool preserve)
Set PreserveAxes: preserve axes?
void setMatchEnd(bool match)
Set MatchEnd: match trailing axes?
void setObsAlt(double alt)
Set ObsAlt: Geodetic altitude of observer (m).
void setAlignSystem(std::string const &system)
Set AlignSystem: the coordinate system used by convert and findFrame to align Frames.
std::vector< double > intersect(std::vector< double > const &a1, std::vector< double > const &a2, std::vector< double > const &b1, std::vector< double > const &b2) const
Find the point of intersection between two geodesic curves.
std::vector< int > matchAxes(Frame const &other) const
Look for corresponding axes between this frame and another.
bool getPreserveAxes() const
Get PreserveAxes: preserve axes?
CmpFrame under(Frame const &next) const
Combine this frame with another to form a compound frame (CmpFrame), with the axes of this frame foll...
void setTitle(std::string const &title)
Set Title: frame title.
bool getMatchEnd() const
Get MatchEnd: match trailing axes?
void setObsLon(std::string const &lon)
Set ObsLon: Geodetic longitude of observer.
void setTop(int axis, double top)
Set Top for one axis: the highest axis value to display.
PointD norm(PointD value) const
Normalise a set of Frame coordinate values which might be unsuitable for display (e....
std::string getObsLon() const
Get ObsLon: Geodetic longitude of observer.
void setDut1(double dut1)
Set Dut1: difference between the UT1 and UTC timescale (sec)
std::string getUnit(int axis) const
Get Unit(axis) for one axis: physical units for formatted axis values.
double getTop(int axis) const
Get Top: the highest axis value to display.
bool getActiveUnit() const
Get ActiveUnit: pay attention to units when one Frame is used to match another?
bool getDirection(int axis) const
Get Direction for one axis: display axis in conventional direction?
void setUnit(int axis, std::string const &unit)
Set Unit(axis) for one axis: physical units for formatted axis values.
void setObsLat(std::string const &lat)
Set ObsLat: frame title.
DirectionPoint offset2(PointD const &point1, double angle, double offset) const
Find the point which is offset a specified distance along the geodesic curve at a given angle from a ...
std::string getLabel(int axis) const
Get Label(axis) for one axis: axis label.
FrameMapping pickAxes(std::vector< int > const &axes) const
Create a new Frame whose axes are copied from an existing Frame along with other Frame attributes,...
void setLabel(int axis, std::string const &label)
Set Label(axis) for one axis: axis label.
void setSystem(std::string const &system)
Set System: coordinate system used to describe positions within the domain.
std::string format(int axis, double value) const
Return a string containing the formatted (character) version of a coordinate value for a Frame axis.
void setEpoch(double epoch)
Set Epoch: Epoch of observation as a double (years)
std::string getTitle() const
Get Title: frame title.
void setMinAxes(int minAxes)
Get MinAxes: the minimum number of axes a frame found by findFrame may have.
ResolvedPoint resolve(std::vector< double > const &point1, std::vector< double > const &point2, std::vector< double > const &point3) const
Resolve a vector into two orthogonal components.
double getEpoch() const
Get Epoch: Epoch of observation.
std::shared_ptr< FrameSet > convert(Frame const &to, std::string const &domainlist="")
Compute a frameset that describes the conversion between this frame and another frame.
std::shared_ptr< Mapping > mapping
Mapping.
std::shared_ptr< Frame > frame
Frame.
double value
Value that was read.
int nread
Number of characters that was read.
std::vector< double > point
Point.
double d2
Resolved vector component 2.
double d1
Resolved vector component 1.
AST wrapper classes and functions.
PYBIND11_MODULE(_cameraGeom, mod)