LSSTApplications  19.0.0-10-g4a5fae6+14,19.0.0-10-g920eed2+3,19.0.0-11-g48a0200+5,19.0.0-19-g32a200e+8,19.0.0-2-g3b2f90d+5,19.0.0-2-gd671419+10,19.0.0-21-g2644856+27,19.0.0-22-g92e20685,19.0.0-24-g878c510+13,19.0.0-25-g1f84a6d+9,19.0.0-27-gbc613e1+5,19.0.0-27-gf99403173,19.0.0-3-g2b32d65+10,19.0.0-3-g8227491+24,19.0.0-3-g9c54d0d+24,19.0.0-3-gca68e65+21,19.0.0-3-gcfc5f51+10,19.0.0-3-ge110943+23,19.0.0-3-ge74d124,19.0.0-34-gfa6e18e+2,19.0.0-4-g06f5963+10,19.0.0-4-g10df615+9,19.0.0-4-g3d16501+28,19.0.0-4-g4a9c019+10,19.0.0-4-g5a8b323+3,19.0.0-4-g66397f0+4,19.0.0-4-g8557e14+3,19.0.0-4-ge404a01+24,19.0.0-5-g4db63b3+3,19.0.0-5-gb9eeb60+3,19.0.0-5-gc96f8cb+5,19.0.0-5-gfb03ce7+26,19.0.0-6-gbaebbfb+25,19.0.0-65-gd489f3fc,19.0.0-7-g039c0b5+26,19.0.0-7-gbea9075+7,19.0.0-7-gc567de5+26,19.0.0-8-g082faa5,19.0.0-80-g3c4dce0+1,19.0.0-9-g463f923+24,w.2020.25
LSSTDataManagementBasePackage
Frame.h
Go to the documentation of this file.
1 /*
2  * LSST Data Management System
3  * Copyright 2017 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 #ifndef ASTSHIM_FRAME_H
23 #define ASTSHIM_FRAME_H
24 
25 #include <memory>
26 #include <sstream>
27 #include <stdexcept>
28 #include <utility>
29 
30 #include "astshim/Mapping.h"
31 #include "astshim/Object.h"
32 #include "astshim/base.h"
33 #include "astshim/detail/utils.h"
34 
35 namespace ast {
36 
37 class CmpFrame;
38 class Frame;
39 
44 public:
52  double direction;
54 };
55 
59 class NReadValue {
60 public:
67  NReadValue(int nread, double value) : nread(nread), value(value){};
68  int nread;
69  double value;
70 };
71 
76 public:
82  explicit ResolvedPoint(int naxes) : point(naxes), d1(), d2() {}
84  double d1;
85  double d2;
86 };
87 
91 class FrameMapping {
92 public:
100  : frame(frame), mapping(mapping) {}
103 };
104 
105 class FrameSet;
106 
157 class Frame : public Mapping {
158  friend class Object;
159 
160 public:
168  explicit Frame(int naxes, std::string const &options = "")
169  : Mapping(reinterpret_cast<AstMapping *>(astFrame(naxes, "%s", options.c_str()))) {
170  assertOK();
171  }
172 
173  virtual ~Frame() {}
174 
176  Frame(Frame const &) = default;
177  Frame(Frame &&) = default;
178  Frame &operator=(Frame const &) = delete;
179  Frame &operator=(Frame &&) = default;
180 
182  std::shared_ptr<Frame> copy() const { return std::static_pointer_cast<Frame>(copyPolymorphic()); }
183 
201  double angle(PointD const &a, PointD const &b, PointD const &c) const {
202  assertPointLength(a, "a");
203  assertPointLength(b, "b");
204  assertPointLength(c, "c");
205  return detail::safeDouble(astAngle(getRawPtr(), a.data(), b.data(), c.data()));
206  }
207 
229  double axAngle(PointD const &a, PointD const &b, int axis) const {
230  assertPointLength(a, "a");
231  assertPointLength(b, "b");
232  return detail::safeDouble(astAxAngle(getRawPtr(), a.data(), b.data(), axis));
233  }
234 
247  double axDistance(int axis, double v1, double v2) const {
248  return detail::safeDouble(astAxDistance(getRawPtr(), axis, v1, v2));
249  }
250 
263  double axOffset(int axis, double v1, double dist) const {
264  return detail::safeDouble(astAxOffset(getRawPtr(), axis, v1, dist));
265  }
266 
459  std::shared_ptr<FrameSet> convert(Frame const &to, std::string const &domainlist = "");
460 
474  double distance(PointD const &point1, PointD const &point2) const {
475  assertPointLength(point1, "point1");
476  assertPointLength(point2, "point2");
477  return detail::safeDouble(astDistance(getRawPtr(), point1.data(), point2.data()));
478  }
479 
769  std::shared_ptr<FrameSet> findFrame(Frame const &tmplt, std::string const &domainlist = "");
770 
782  std::string format(int axis, double value) const {
783  char const *rawstr = astFormat(getRawPtr(), axis, value);
784  assertOK();
785  return std::string(rawstr);
786  }
787 
792  bool getActiveUnit() const {
793  bool ret = astGetActiveUnit(getRawPtr());
794  assertOK();
795  return ret;
796  }
797 
802  std::string getAlignSystem() const { return getC("AlignSystem"); }
803 
807  double getBottom(int axis) const { return getD(detail::formatAxisAttr("Bottom", axis)); }
808 
812  int getDigits() const { return getI("Digits"); }
813 
817  int getDigits(int axis) const { return getI(detail::formatAxisAttr("Digits", axis)); }
818 
822  bool getDirection(int axis) const { return getB(detail::formatAxisAttr("Direction", axis)); }
823 
827  std::string getDomain() const { return getC("Domain"); }
828 
832  double getDut1() const { return getD("Dut1"); }
833 
837  double getEpoch() const { return getD("Epoch"); }
838 
842  std::string getFormat(int axis) const { return getC(detail::formatAxisAttr("Format", axis)); }
843 
848  std::string getInternalUnit(int axis) const { return getC(detail::formatAxisAttr("InternalUnit", axis)); }
849 
853  std::string getLabel(int axis) const { return getC(detail::formatAxisAttr("Label", axis)); }
854 
858  bool getMatchEnd() const { return getB("MatchEnd"); }
859 
864  int getMaxAxes() const { return getI("MaxAxes"); }
865 
870  int getMinAxes() const { return getI("MinAxes"); }
871 
876  int getNAxes() const { return getI("NAxes"); }
877 
882  std::string getNormUnit(int axis) const { return getC(detail::formatAxisAttr("NormUnit", axis)); }
883 
887  double getObsAlt() const { return getD("ObsAlt"); }
888 
892  std::string getObsLat() const { return getC("ObsLat"); }
893 
897  std::string getObsLon() const { return getC("ObsLon"); }
898 
902  bool getPermute() const { return getB("Permute"); }
903 
907  bool getPreserveAxes() const { return getB("PreserveAxes"); }
908 
912  std::string getSymbol(int axis) const { return getC(detail::formatAxisAttr("Symbol", axis)); }
913 
918  std::string getSystem() const { return getC("System"); }
919 
923  std::string getTitle() const { return getC("Title"); }
924 
928  double getTop(int axis) const { return getD(detail::formatAxisAttr("Top", axis)); }
929 
933  std::string getUnit(int axis) const { return getC(detail::formatAxisAttr("Unit", axis)); }
934 
967  std::vector<double> const &b1, std::vector<double> const &b2) const;
968 
986  std::vector<int> ret(other.getNIn());
987  astMatchAxes(getRawPtr(), other.getRawPtr(), ret.data());
988  assertOK();
989  return ret;
990  }
991 
1023  CmpFrame under(Frame const &next) const;
1024 
1045  PointD norm(PointD value) const {
1046  astNorm(getRawPtr(), value.data());
1047  assertOK();
1048  detail::astBadToNan(value);
1049  return value;
1050  }
1051 
1075  PointD offset(PointD point1, PointD point2, double offset) const {
1076  assertPointLength(point1, "point1");
1077  assertPointLength(point2, "point2");
1078  PointD ret(getNIn());
1079  astOffset(getRawPtr(), point1.data(), point2.data(), offset, ret.data());
1080  assertOK();
1081  detail::astBadToNan(ret);
1082  return ret;
1083  }
1084 
1117  DirectionPoint offset2(PointD const &point1, double angle, double offset) const {
1118  detail::assertEqual(getNIn(), "naxes", 2, " cannot call offset2");
1119  assertPointLength(point1, "point1");
1120  PointD point2(getNIn());
1121  double offsetAngle = astOffset2(getRawPtr(), point1.data(), angle, offset, point2.data());
1122  assertOK();
1123  detail::astBadToNan(point2);
1124  return DirectionPoint(detail::safeDouble(offsetAngle), point2);
1125  }
1126 
1139  detail::assertEqual(perm.size(), "perm.size()", static_cast<std::size_t>(getNAxes()), "naxes");
1140  astPermAxes(getRawPtr(), perm.data());
1141  assertOK();
1142  }
1143 
1163  FrameMapping pickAxes(std::vector<int> const &axes) const;
1164 
1196  ResolvedPoint resolve(std::vector<double> const &point1, std::vector<double> const &point2,
1197  std::vector<double> const &point3) const;
1198 
1203  void setAlignSystem(std::string const &system) { setC("AlignSystem", system); }
1204 
1208  void setBottom(int axis, double bottom) { setD(detail::formatAxisAttr("Bottom", axis), bottom); }
1209 
1213  void setDigits(int digits) { setI("Digits", digits); }
1214 
1218  void setDigits(int axis, int digits) { setD(detail::formatAxisAttr("Digits", axis), digits); }
1219 
1223  void setDirection(bool direction, int axis) {
1224  setB(detail::formatAxisAttr("Direction", axis), direction);
1225  }
1226 
1230  virtual void setDomain(std::string const &domain) { setC("Domain", domain); }
1231 
1235  void setDut1(double dut1) { setD("Dut1", dut1); }
1236 
1240  void setEpoch(double epoch) { setD("Epoch", epoch); }
1241 
1245  void setEpoch(std::string const &epoch) { setC("Epoch", epoch); }
1246 
1250  void setFormat(int axis, std::string const &format) {
1251  setC(detail::formatAxisAttr("Format", axis), format);
1252  }
1253 
1257  void setLabel(int axis, std::string const &label) { setC(detail::formatAxisAttr("Label", axis), label); }
1258 
1262  void setMatchEnd(bool match) { setB("MatchEnd", match); }
1263 
1268  void setMaxAxes(int maxAxes) { setI("MaxAxes", maxAxes); }
1269 
1274  void setMinAxes(int minAxes) { setI("MinAxes", minAxes); }
1275 
1279  void setObsAlt(double alt) { setD("ObsAlt", alt); }
1280 
1284  void setObsLat(std::string const &lat) { setC("ObsLat", lat); }
1285 
1289  void setObsLon(std::string const &lon) { setC("ObsLon", lon); }
1290 
1295  void setActiveUnit(bool enable) {
1296  astSetActiveUnit(getRawPtr(), enable);
1297  assertOK();
1298  }
1299 
1303  void setPermute(bool permute) { setB("Permute", permute); }
1304 
1308  void setPreserveAxes(bool preserve) { setB("PreserveAxes", preserve); }
1309 
1313  void setSymbol(int axis, std::string const &symbol) {
1314  setC(detail::formatAxisAttr("Symbol", axis), symbol);
1315  }
1316 
1321  void setSystem(std::string const &system) { setC("System", system); }
1322 
1326  void setTitle(std::string const &title) { setC("Title", title); }
1327 
1331  void setTop(int axis, double top) { setD(detail::formatAxisAttr("Top", axis), top); }
1332 
1336  void setUnit(int axis, std::string const &unit) { setC(detail::formatAxisAttr("Unit", axis), unit); }
1337 
1502  NReadValue unformat(int axis, std::string const &str) const {
1503  double value;
1504  int nread = astUnformat(getRawPtr(), axis, str.c_str(), &value);
1505  assertOK();
1506  return NReadValue(nread, detail::safeDouble(value));
1507  }
1508 
1509 protected:
1519  explicit Frame(AstFrame *rawPtr) : Mapping(reinterpret_cast<AstMapping *>(rawPtr)) {
1520  if (!astIsAFrame(getRawPtr())) {
1522  os << "This is a " << getClassName() << ", which is not a Frame";
1523  throw std::invalid_argument(os.str());
1524  }
1525  }
1526 
1527  virtual std::shared_ptr<Object> copyPolymorphic() const override { return copyImpl<Frame, AstFrame>(); }
1528 
1529 private:
1536  template <typename T>
1537  void assertPointLength(T const &p, char const *name) const {
1538  if (static_cast<int>(p.size()) != getNIn()) {
1540  os << "point " << name << " has " << p.size() << " axes, but " << getNIn() << " required";
1541  throw std::invalid_argument(os.str());
1542  }
1543  }
1544 };
1545 
1546 } // namespace ast
1547 
1548 #endif
ast::Frame::unformat
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...
Definition: Frame.h:1502
ast::Frame::getPreserveAxes
bool getPreserveAxes() const
Get PreserveAxes: preserve axes?
Definition: Frame.h:907
ast::Frame::setDut1
void setDut1(double dut1)
Set Dut1: difference between the UT1 and UTC timescale (sec)
Definition: Frame.h:1235
ast::Frame::setEpoch
void setEpoch(std::string const &epoch)
Set Epoch: Epoch of observation as a string.
Definition: Frame.h:1245
ast::Frame::setPreserveAxes
void setPreserveAxes(bool preserve)
Set PreserveAxes: preserve axes?
Definition: Frame.h:1308
ast::Frame::format
std::string format(int axis, double value) const
Return a string containing the formatted (character) version of a coordinate value for a Frame axis.
Definition: Frame.h:782
astshim.fitsChanContinued.next
def next(self)
Definition: fitsChanContinued.py:105
ast::Frame::getLabel
std::string getLabel(int axis) const
Get Label(axis) for one axis: axis label.
Definition: Frame.h:853
ast::Frame::setDomain
virtual void setDomain(std::string const &domain)
Set Domain: coordinate system domain.
Definition: Frame.h:1230
ast::NReadValue
Struct returned by Frame::unformat containing the number of characters read and corresponding value.
Definition: Frame.h:59
ast::NReadValue::value
double value
Value that was read.
Definition: Frame.h:69
ast::Frame::distance
double distance(PointD const &point1, PointD const &point2) const
Find the distance between two points whose Frame coordinates are given.
Definition: Frame.h:474
ast::FrameMapping
Struct returned by Frame::pickAxes containing a frame and a mapping.
Definition: Frame.h:91
ast::Frame::setLabel
void setLabel(int axis, std::string const &label)
Set Label(axis) for one axis: axis label.
Definition: Frame.h:1257
ast::Object::getB
bool getB(std::string const &attrib) const
Get the value of an attribute as a bool.
Definition: Object.h:348
ast::FrameSet
A FrameSet consists of a set of one or more Frames (which describe coordinate systems),...
Definition: FrameSet.h:99
std::string
STL class.
std::shared_ptr
STL class.
ast::Frame::matchAxes
std::vector< int > matchAxes(Frame const &other) const
Look for corresponding axes between this frame and another.
Definition: Frame.h:985
ast::Object::setD
void setD(std::string const &attrib, double value)
Set the value of an attribute as a double.
Definition: Object.h:476
ast::Frame::getPermute
bool getPermute() const
Get Permute: allow axis permutation when used as a template?
Definition: Frame.h:902
ast::Frame::getDirection
bool getDirection(int axis) const
Get Direction for one axis: display axis in conventional direction?
Definition: Frame.h:822
ast::Frame::getInternalUnit
std::string getInternalUnit(int axis) const
Get InternalUnit(axis) read-only attribute for one axis: physical units for unformated axis values.
Definition: Frame.h:848
ast::Frame::setSymbol
void setSymbol(int axis, std::string const &symbol)
Set Symbol(axis) for one axis: axis symbol.
Definition: Frame.h:1313
ast::Frame::getMaxAxes
int getMaxAxes() const
Get MaxAxes: the maximum axes a frame found by findFrame may have.
Definition: Frame.h:864
ast::NReadValue::nread
int nread
Number of characters that was read.
Definition: Frame.h:67
ast::Frame::getObsLon
std::string getObsLon() const
Get ObsLon: Geodetic longitude of observer.
Definition: Frame.h:897
ast::assertOK
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
Definition: base.cc:49
ast::Frame::getObsLat
std::string getObsLat() const
Get ObsLat: Geodetic latitude of observer.
Definition: Frame.h:892
ast::Frame::getAlignSystem
std::string getAlignSystem() const
Get AlignSystem: the coordinate system used by convert and findFrame to align Frames.
Definition: Frame.h:802
ast::Object::setB
void setB(std::string const &attrib, bool value)
Set the value of an attribute as a bool.
Definition: Object.h:452
std::vector< double >
std::vector::size
T size(T... args)
ast::Frame::copy
std::shared_ptr< Frame > copy() const
Return a deep copy of this object.
Definition: Frame.h:182
ast::Frame::setEpoch
void setEpoch(double epoch)
Set Epoch: Epoch of observation as a double (years)
Definition: Frame.h:1240
ast::Mapping
An abstract base class for objects which transform one set of coordinates to another.
Definition: Mapping.h:59
ast::Frame::convert
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.
Definition: Frame.cc:31
ast::Frame::operator=
Frame & operator=(Frame const &)=delete
ast::Frame::setObsAlt
void setObsAlt(double alt)
Set ObsAlt: Geodetic altitude of observer (m).
Definition: Frame.h:1279
ast::Object
Abstract base class for all AST objects.
Definition: Object.h:51
ast::DirectionPoint::direction
double direction
Direction, an angle in radians.
Definition: Frame.h:51
ast::Frame::Frame
Frame(Frame &&)=default
ast::detail::astBadToNan
void astBadToNan(std::vector< double > &p)
Replace AST__BAD with a quiet NaN in a vector.
Definition: utils.h:59
ast::Frame::setMinAxes
void setMinAxes(int minAxes)
Get MinAxes: the minimum number of axes a frame found by findFrame may have.
Definition: Frame.h:1274
ast::Frame::getNormUnit
std::string getNormUnit(int axis) const
Get NormUnit(axis) read-only attribute for one frame: normalised physical units for formatted axis va...
Definition: Frame.h:882
ast::Frame::getDigits
int getDigits() const
Get Digits: the default used if no specific value specified for an axis.
Definition: Frame.h:812
ast::Frame::operator=
Frame & operator=(Frame &&)=default
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
ast::Frame::setMatchEnd
void setMatchEnd(bool match)
Set MatchEnd: match trailing axes?
Definition: Frame.h:1262
ast::Frame::getSystem
std::string getSystem() const
Get System: coordinate system used to describe positions within the domain.
Definition: Frame.h:918
ast::Frame::axAngle
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,...
Definition: Frame.h:229
ast::FrameMapping::frame
std::shared_ptr< Frame > frame
Frame.
Definition: Frame.h:101
ast::Frame::Frame
Frame(Frame const &)=default
Copy constructor: make a deep copy.
ast::Frame::Frame
Frame(int naxes, std::string const &options="")
Construct a Frame.
Definition: Frame.h:168
ast::ResolvedPoint::ResolvedPoint
ResolvedPoint(int naxes)
Construct an empty ResolvedPoint.
Definition: Frame.h:82
ast::Frame::getSymbol
std::string getSymbol(int axis) const
Get Symbol(axis) for one axis: axis symbol.
Definition: Frame.h:912
ast::Frame::getNAxes
int getNAxes() const
Get NAxes: the number of axes in the frame (i.e.
Definition: Frame.h:876
ast::DirectionPoint::DirectionPoint
DirectionPoint(double direction, PointD const &point)
Construct a DirectionPoint.
Definition: Frame.h:51
ast::Frame::setFormat
void setFormat(int axis, std::string const &format)
Set Format for one axis: format specification for axis values.
Definition: Frame.h:1250
ast::Object::getClassName
std::string getClassName() const
Get Class: the name of the class (e.g.
Definition: Object.h:139
ast::Frame::getActiveUnit
bool getActiveUnit() const
Get ActiveUnit: pay attention to units when one Frame is used to match another?
Definition: Frame.h:792
ast::Frame
Frame is used to represent a coordinate system.
Definition: Frame.h:157
ast::Object::getI
int getI(std::string const &attrib) const
Get the value of an attribute as an int.
Definition: Object.h:400
ast::DirectionPoint::point
PointD point
Point.
Definition: Frame.h:53
ast::Frame::setActiveUnit
void setActiveUnit(bool enable)
Set ActiveUnit: pay attention to units when one Frame is used to match another?
Definition: Frame.h:1295
utils.h
ast::Frame::offset
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...
Definition: Frame.h:1075
ast::ResolvedPoint
Struct returned by Frame::resolve containing a point and the resolved vector components.
Definition: Frame.h:75
ast::Frame::pickAxes
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,...
Definition: Frame.cc:68
ast::Frame::resolve
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.
Definition: Frame.cc:84
ast::FrameMapping::FrameMapping
FrameMapping(std::shared_ptr< Frame > frame, std::shared_ptr< Mapping > mapping)
Construct a FrameMapping.
Definition: Frame.h:99
ast::Frame::getFormat
std::string getFormat(int axis) const
Get Format for one axis: format specification for axis values.
Definition: Frame.h:842
std::string::c_str
T c_str(T... args)
ast::Frame::getTop
double getTop(int axis) const
Get Top: the highest axis value to display.
Definition: Frame.h:928
other
ItemVariant const * other
Definition: Schema.cc:56
ast::Frame::permAxes
void permAxes(std::vector< int > perm)
Permute the order in which a Frame's axes occur.
Definition: Frame.h:1138
ast::ResolvedPoint::d2
double d2
Resolved vector component 2.
Definition: Frame.h:85
ast::DirectionPoint
Struct returned by Frame::offset2 containing a direction and a point.
Definition: Frame.h:43
ast::Frame::getDigits
int getDigits(int axis) const
Get Digits for one axis.
Definition: Frame.h:817
std::invalid_argument
STL class.
ast::Frame::setSystem
void setSystem(std::string const &system)
Set System: coordinate system used to describe positions within the domain.
Definition: Frame.h:1321
ast::Frame::norm
PointD norm(PointD value) const
Normalise a set of Frame coordinate values which might be unsuitable for display (e....
Definition: Frame.h:1045
ast::Frame::getMatchEnd
bool getMatchEnd() const
Get MatchEnd: match trailing axes?
Definition: Frame.h:858
b
table::Key< int > b
Definition: TransmissionCurve.cc:467
ast::Frame::setDigits
void setDigits(int axis, int digits)
Set Digits for one axis: number of digits of precision.
Definition: Frame.h:1218
ast::Frame::getTitle
std::string getTitle() const
Get Title: frame title.
Definition: Frame.h:923
ast::Frame::getBottom
double getBottom(int axis) const
Get Bottom for one axis: the lowest axis value to display.
Definition: Frame.h:807
ast::Frame::getDut1
double getDut1() const
Get Dut1: difference between the UT1 and UTC timescale (sec)
Definition: Frame.h:832
ast::Frame::under
CmpFrame under(Frame const &next) const
Combine this frame with another to form a compound frame (CmpFrame), with the axes of this frame foll...
Definition: Frame.cc:66
ast::Frame::copyPolymorphic
virtual std::shared_ptr< Object > copyPolymorphic() const override
Return a deep copy of this object.
Definition: Frame.h:1527
ast::NReadValue::NReadValue
NReadValue(int nread, double value)
Construct an NReadValue.
Definition: Frame.h:67
std::ostringstream
STL class.
ast::Frame::intersect
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.
Definition: Frame.cc:51
ast::detail::safeDouble
double safeDouble(double val)
Return a double value after checking status and replacing AST__BAD with nan
Definition: utils.h:100
to
table::Key< int > to
Definition: TransformMap.cc:349
ast::Frame::getEpoch
double getEpoch() const
Get Epoch: Epoch of observation.
Definition: Frame.h:837
ast
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
ast::Mapping::getNIn
int getNIn() const
Get NIn: the number of input axes.
Definition: Mapping.h:77
os
std::ostream * os
Definition: Schema.cc:746
ast::Object::getD
double getD(std::string const &attrib) const
Get the value of an attribute as a double.
Definition: Object.h:374
ast::FrameMapping::mapping
std::shared_ptr< Mapping > mapping
Mapping.
Definition: Frame.h:102
ast::Object::setC
void setC(std::string const &attrib, std::string const &value)
Set the value of an attribute as a string.
Definition: Object.h:464
ast::Frame::~Frame
virtual ~Frame()
Definition: Frame.h:173
ast::Frame::setObsLat
void setObsLat(std::string const &lat)
Set ObsLat: frame title.
Definition: Frame.h:1284
Mapping.h
ast::Frame::setMaxAxes
void setMaxAxes(int maxAxes)
Get MaxAxes: the maximum number of axes a frame found by findFrame may have.
Definition: Frame.h:1268
ast::Frame::setTop
void setTop(int axis, double top)
Set Top for one axis: the highest axis value to display.
Definition: Frame.h:1331
a
table::Key< int > a
Definition: TransmissionCurve.cc:466
ast::Frame::getMinAxes
int getMinAxes() const
Get MinAxes: the maximum axes a frame found by findFrame may have.
Definition: Frame.h:870
ast::Frame::getDomain
std::string getDomain() const
Get Domain: coordinate system domain.
Definition: Frame.h:827
ast::Frame::setTitle
void setTitle(std::string const &title)
Set Title: frame title.
Definition: Frame.h:1326
ast::Object::setI
void setI(std::string const &attrib, int value)
Set the value of an attribute as an int.
Definition: Object.h:500
ast::Frame::setDigits
void setDigits(int digits)
Set Digits for all axes: number of digits of precision.
Definition: Frame.h:1213
ast::Frame::getUnit
std::string getUnit(int axis) const
Get Unit(axis) for one axis: physical units for formatted axis values.
Definition: Frame.h:933
ast::Frame::setAlignSystem
void setAlignSystem(std::string const &system)
Set AlignSystem: the coordinate system used by convert and findFrame to align Frames.
Definition: Frame.h:1203
ast::Object::getC
std::string const getC(std::string const &attrib) const
Get the value of an attribute as a string.
Definition: Object.h:361
ast::ResolvedPoint::point
std::vector< double > point
Point.
Definition: Frame.h:83
ast::Frame::axOffset
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.
Definition: Frame.h:263
ast::Frame::setUnit
void setUnit(int axis, std::string const &unit)
Set Unit(axis) for one axis: physical units for formatted axis values.
Definition: Frame.h:1336
ast::Frame::setBottom
void setBottom(int axis, double bottom)
Set Bottom: the lowest axis value to display.
Definition: Frame.h:1208
ast::Object::getRawPtr
AstObject const * getRawPtr() const
Get the raw AST pointer.
Definition: Object.h:292
std::size_t
ast::Frame::offset2
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 ...
Definition: Frame.h:1117
ast::Frame::Frame
Frame(AstFrame *rawPtr)
Construct a Frame from a pointer to a raw AstFrame.
Definition: Frame.h:1519
ast::ResolvedPoint::d1
double d1
Resolved vector component 1.
Definition: Frame.h:84
ast::CmpFrame
A CmpFrame is a compound Frame which allows two component Frames (of any class) to be merged together...
Definition: CmpFrame.h:60
ast::detail::assertEqual
void assertEqual(T1 val1, std::string const &descr1, T2 val2, std::string const &descr2)
Definition: utils.h:48
ast::Frame::setDirection
void setDirection(bool direction, int axis)
Set Direction for one axis: display axis in conventional direction?
Definition: Frame.h:1223
ast::Frame::getObsAlt
double getObsAlt() const
Get ObsAlt: Geodetic altitude of observer (m).
Definition: Frame.h:887
ast::Frame::setPermute
void setPermute(bool permute)
Set Permute: allow axis permutation when used as a template?
Definition: Frame.h:1303
Object.h
ast::Frame::angle
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 ...
Definition: Frame.h:201
base.h
std::vector::data
T data(T... args)
ast::Frame::axDistance
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.
Definition: Frame.h:247
ast::Frame::setObsLon
void setObsLon(std::string const &lon)
Set ObsLon: Geodetic longitude of observer.
Definition: Frame.h:1289
ast::Frame::findFrame
std::shared_ptr< FrameSet > findFrame(Frame const &tmplt, std::string const &domainlist="")
Find a coordinate system with specified characteristics.
Definition: Frame.cc:41
ast::detail::formatAxisAttr
std::string formatAxisAttr(std::string const &name, int axis)
Format an axis-specific attribute by appending the axis index.
Definition: utils.h:79