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
|
Go to the documentation of this file.
22 #ifndef ASTSHIM_FRAME_H
23 #define ASTSHIM_FRAME_H
169 :
Mapping(reinterpret_cast<AstMapping *>(astFrame(naxes,
"%s", options.c_str()))) {
202 assertPointLength(
a,
"a");
203 assertPointLength(
b,
"b");
204 assertPointLength(c,
"c");
230 assertPointLength(
a,
"a");
231 assertPointLength(
b,
"b");
263 double axOffset(
int axis,
double v1,
double dist)
const {
475 assertPointLength(point1,
"point1");
476 assertPointLength(point2,
"point2");
783 char const *rawstr = astFormat(
getRawPtr(), axis, value);
793 bool ret = astGetActiveUnit(
getRawPtr());
1076 assertPointLength(point1,
"point1");
1077 assertPointLength(point2,
"point2");
1119 assertPointLength(point1,
"point1");
1519 explicit Frame(AstFrame *rawPtr) :
Mapping(reinterpret_cast<AstMapping *>(rawPtr)) {
1522 os <<
"This is a " <<
getClassName() <<
", which is not a Frame";
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";
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...
bool getPreserveAxes() const
Get PreserveAxes: preserve axes?
void setDut1(double dut1)
Set Dut1: difference between the UT1 and UTC timescale (sec)
void setEpoch(std::string const &epoch)
Set Epoch: Epoch of observation as a string.
void setPreserveAxes(bool preserve)
Set PreserveAxes: preserve axes?
std::string format(int axis, double value) const
Return a string containing the formatted (character) version of a coordinate value for a Frame axis.
std::string getLabel(int axis) const
Get Label(axis) for one axis: axis label.
virtual void setDomain(std::string const &domain)
Set Domain: coordinate system domain.
Struct returned by Frame::unformat containing the number of characters read and corresponding value.
double value
Value that was read.
double distance(PointD const &point1, PointD const &point2) const
Find the distance between two points whose Frame coordinates are given.
Struct returned by Frame::pickAxes containing a frame and a mapping.
void setLabel(int axis, std::string const &label)
Set Label(axis) for one axis: axis label.
bool getB(std::string const &attrib) const
Get the value of an attribute as a bool.
A FrameSet consists of a set of one or more Frames (which describe coordinate systems),...
std::vector< int > matchAxes(Frame const &other) const
Look for corresponding axes between this frame and another.
void setD(std::string const &attrib, double value)
Set the value of an attribute as a double.
bool getPermute() const
Get Permute: allow axis permutation when used as a template?
bool getDirection(int axis) const
Get Direction for one axis: display axis in conventional direction?
std::string getInternalUnit(int axis) const
Get InternalUnit(axis) read-only attribute for one axis: physical units for unformated axis values.
void setSymbol(int axis, std::string const &symbol)
Set Symbol(axis) for one axis: axis symbol.
int getMaxAxes() const
Get MaxAxes: the maximum axes a frame found by findFrame may have.
int nread
Number of characters that was read.
std::string getObsLon() const
Get ObsLon: Geodetic longitude of observer.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
std::string getObsLat() const
Get ObsLat: Geodetic latitude of observer.
std::string getAlignSystem() const
Get AlignSystem: the coordinate system used by convert and findFrame to align Frames.
void setB(std::string const &attrib, bool value)
Set the value of an attribute as a bool.
std::shared_ptr< Frame > copy() const
Return a deep copy of this object.
void setEpoch(double epoch)
Set Epoch: Epoch of observation as a double (years)
An abstract base class for objects which transform one set of coordinates to another.
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.
Frame & operator=(Frame const &)=delete
void setObsAlt(double alt)
Set ObsAlt: Geodetic altitude of observer (m).
Abstract base class for all AST objects.
double direction
Direction, an angle in radians.
void astBadToNan(std::vector< double > &p)
Replace AST__BAD with a quiet NaN in a vector.
void setMinAxes(int minAxes)
Get MinAxes: the minimum number of axes a frame found by findFrame may have.
std::string getNormUnit(int axis) const
Get NormUnit(axis) read-only attribute for one frame: normalised physical units for formatted axis va...
int getDigits() const
Get Digits: the default used if no specific value specified for an axis.
Frame & operator=(Frame &&)=default
void setMatchEnd(bool match)
Set MatchEnd: match trailing axes?
std::string getSystem() const
Get System: coordinate system used to describe positions within the domain.
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,...
std::shared_ptr< Frame > frame
Frame.
Frame(Frame const &)=default
Copy constructor: make a deep copy.
Frame(int naxes, std::string const &options="")
Construct a Frame.
ResolvedPoint(int naxes)
Construct an empty ResolvedPoint.
std::string getSymbol(int axis) const
Get Symbol(axis) for one axis: axis symbol.
int getNAxes() const
Get NAxes: the number of axes in the frame (i.e.
DirectionPoint(double direction, PointD const &point)
Construct a DirectionPoint.
void setFormat(int axis, std::string const &format)
Set Format for one axis: format specification for axis values.
std::string getClassName() const
Get Class: the name of the class (e.g.
bool getActiveUnit() const
Get ActiveUnit: pay attention to units when one Frame is used to match another?
Frame is used to represent a coordinate system.
int getI(std::string const &attrib) const
Get the value of an attribute as an int.
void setActiveUnit(bool enable)
Set ActiveUnit: pay attention to units when one Frame is used to match another?
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...
Struct returned by Frame::resolve containing a point and the resolved vector components.
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,...
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.
FrameMapping(std::shared_ptr< Frame > frame, std::shared_ptr< Mapping > mapping)
Construct a FrameMapping.
std::string getFormat(int axis) const
Get Format for one axis: format specification for axis values.
double getTop(int axis) const
Get Top: the highest axis value to display.
ItemVariant const * other
void permAxes(std::vector< int > perm)
Permute the order in which a Frame's axes occur.
double d2
Resolved vector component 2.
Struct returned by Frame::offset2 containing a direction and a point.
int getDigits(int axis) const
Get Digits for one axis.
void setSystem(std::string const &system)
Set System: coordinate system used to describe positions within the domain.
PointD norm(PointD value) const
Normalise a set of Frame coordinate values which might be unsuitable for display (e....
bool getMatchEnd() const
Get MatchEnd: match trailing axes?
void setDigits(int axis, int digits)
Set Digits for one axis: number of digits of precision.
std::string getTitle() const
Get Title: frame title.
double getBottom(int axis) const
Get Bottom for one axis: the lowest axis value to display.
double getDut1() const
Get Dut1: difference between the UT1 and UTC timescale (sec)
CmpFrame under(Frame const &next) const
Combine this frame with another to form a compound frame (CmpFrame), with the axes of this frame foll...
virtual std::shared_ptr< Object > copyPolymorphic() const override
Return a deep copy of this object.
NReadValue(int nread, double value)
Construct an NReadValue.
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.
double safeDouble(double val)
Return a double value after checking status and replacing AST__BAD with nan
double getEpoch() const
Get Epoch: Epoch of observation.
AST wrapper classes and functions.
int getNIn() const
Get NIn: the number of input axes.
double getD(std::string const &attrib) const
Get the value of an attribute as a double.
std::shared_ptr< Mapping > mapping
Mapping.
void setC(std::string const &attrib, std::string const &value)
Set the value of an attribute as a string.
void setObsLat(std::string const &lat)
Set ObsLat: frame title.
void setMaxAxes(int maxAxes)
Get MaxAxes: the maximum number of axes a frame found by findFrame may have.
void setTop(int axis, double top)
Set Top for one axis: the highest axis value to display.
int getMinAxes() const
Get MinAxes: the maximum axes a frame found by findFrame may have.
std::string getDomain() const
Get Domain: coordinate system domain.
void setTitle(std::string const &title)
Set Title: frame title.
void setI(std::string const &attrib, int value)
Set the value of an attribute as an int.
void setDigits(int digits)
Set Digits for all axes: number of digits of precision.
std::string getUnit(int axis) const
Get Unit(axis) for one axis: physical units for formatted axis values.
void setAlignSystem(std::string const &system)
Set AlignSystem: the coordinate system used by convert and findFrame to align Frames.
std::string const getC(std::string const &attrib) const
Get the value of an attribute as a string.
std::vector< double > point
Point.
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.
void setUnit(int axis, std::string const &unit)
Set Unit(axis) for one axis: physical units for formatted axis values.
void setBottom(int axis, double bottom)
Set Bottom: the lowest axis value to display.
AstObject const * getRawPtr() const
Get the raw AST pointer.
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 ...
Frame(AstFrame *rawPtr)
Construct a Frame from a pointer to a raw AstFrame.
double d1
Resolved vector component 1.
A CmpFrame is a compound Frame which allows two component Frames (of any class) to be merged together...
void assertEqual(T1 val1, std::string const &descr1, T2 val2, std::string const &descr2)
void setDirection(bool direction, int axis)
Set Direction for one axis: display axis in conventional direction?
double getObsAlt() const
Get ObsAlt: Geodetic altitude of observer (m).
void setPermute(bool permute)
Set Permute: allow axis permutation when used as a template?
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 ...
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.
void setObsLon(std::string const &lon)
Set ObsLon: Geodetic longitude of observer.
std::shared_ptr< FrameSet > findFrame(Frame const &tmplt, std::string const &domainlist="")
Find a coordinate system with specified characteristics.
std::string formatAxisAttr(std::string const &name, int axis)
Format an axis-specific attribute by appending the axis index.