22 #ifndef ASTSHIM_SKYFRAME_H
23 #define ASTSHIM_SKYFRAME_H
28 #include "astshim/Frame.h"
125 Frame(reinterpret_cast<AstFrame *>(astSkyFrame(options.c_str())))
136 std::shared_ptr<SkyFrame>
copy()
const {
144 bool getAsTime(
int axis)
const {
return getB(detail::formatAxisAttr(
"AsTime", axis)); }
150 bool getIsLatAxis(
int axis)
const {
return getB(detail::formatAxisAttr(
"IsLatAxis", axis)); }
153 bool getIsLonAxis(
int axis)
const {
return getB(detail::formatAxisAttr(
"IsLonAxis", axis)); }
170 std::vector<double> ret;
171 for (
int axis = 1; axis < 3; ++axis) {
172 ret.push_back(
getD(detail::formatAxisAttr(
"SkyRef", axis)));
183 std::vector<double> ret;
184 for (
int axis = 1; axis < 3; ++axis) {
185 ret.push_back(
getD(detail::formatAxisAttr(
"SkyRefP", axis)));
198 void setAsTime(
int axis,
bool asTime) {
setB(detail::formatAxisAttr(
"AsTime", axis), asTime); }
211 detail::assertEqual(skyRef.size(),
"skyRef length", 2,
"number of axes");
212 for (
int i = 0; i < 2; ++i) {
213 setD(detail::formatAxisAttr(
"SkyRef", i + 1), skyRef[i]);
222 detail::assertEqual(skyRefP.size(),
"skyRefP length", 2,
"number of axes");
223 for (
int i = 0; i < 2; ++i) {
224 setD(detail::formatAxisAttr(
"SkyRefP", i + 1), skyRefP[i]);
240 auto * rawMap =
reinterpret_cast<AstObject *
>(astSkyOffsetMap(
getRawPtr()));
241 return Object::fromAstObject<Mapping>(rawMap,
false);
246 return _copyImpl<SkyFrame, AstSkyFrame>();
251 Frame(reinterpret_cast<AstFrame *>(rawptr))
254 std::ostringstream os;
255 os <<
"this is a " <<
getClass() <<
", which is not a SkyFrame";
256 throw std::invalid_argument(os.str());
std::string getSkyRefIs() const
Get SkyRefIs: selects the nature of the offset coordinate system.
Definition: SkyFrame.h:178
bool getAsTime(int axis) const
Get AsTime(axis) for one axis: format celestial coordinates as times?
Definition: SkyFrame.h:144
void setSkyTol(double skyTol)
Set SkyTol: smallest significant shift in sky coordinates.
Definition: SkyFrame.h:229
void setAlignOffset(bool alignOffset)
Set AlignOffset: align SkyFrames using the offset coordinate system?
Definition: SkyFrame.h:195
std::string getClass() const
Definition: Object.h:117
std::string const getC(std::string const &attrib) const
Definition: Object.h:347
void setSkyRef(std::vector< double > const &skyRef)
Set SkyRef: position defining location of the offset coordinate system.
Definition: SkyFrame.h:210
bool getAlignOffset() const
Get AlignOffset: align SkyFrames using the offset coordinate system?
Definition: SkyFrame.h:141
void setB(std::string const &attrib, bool value)
Definition: Object.h:435
double getSkyTol() const
Get SkyTol: smallest significant shift in sky coordinates.
Definition: SkyFrame.h:191
void setSkyRefIs(std::string const &skyRefIs)
Set SkyRefIs: selects the nature of the offset coordinate system.
Definition: SkyFrame.h:218
Definition: SkyFrame.h:66
void setAsTime(int axis, bool asTime)
Set AsTime(axis) for one axis: format celestial coordinates as times?
Definition: SkyFrame.h:198
void setC(std::string const &attrib, std::string const &value)
Definition: Object.h:447
void setSkyRefP(std::vector< double > const &skyRefP)
Set SkyRefP: position defining orientation of the offset coordinate system.
Definition: SkyFrame.h:221
std::vector< double > getSkyRef() const
Definition: SkyFrame.h:169
void setProjection(std::string const &projection)
Set Projection: sky projection description.
Definition: SkyFrame.h:207
std::shared_ptr< Mapping > skyOffsetMap()
Definition: SkyFrame.h:239
SkyFrame(AstSkyFrame *rawptr)
Construct a SkyFrame from a raw AST pointer.
Definition: SkyFrame.h:250
bool getIsLonAxis(int axis) const
Get IsLonAxis(axis) for one axis: is the specified axis the longitude axis?
Definition: SkyFrame.h:153
std::vector< double > getSkyRefP() const
Definition: SkyFrame.h:182
double getD(std::string const &attrib) const
Definition: Object.h:360
virtual std::shared_ptr< Object > _copyPolymorphic() const override
Definition: SkyFrame.h:245
double getEquinox() const
Get Equinox: epoch of the mean equinox.
Definition: SkyFrame.h:147
std::string getProjection() const
Get Projection: sky projection description.
Definition: SkyFrame.h:165
void setD(std::string const &attrib, double value)
Definition: Object.h:459
void setNegLon(bool negLon)
Set NegLon: display longitude values in the range [-pi,pi]?
Definition: SkyFrame.h:204
void setEquinox(double equinox)
Set Equinox: epoch of the mean equinox.
Definition: SkyFrame.h:201
int getI(std::string const &attrib) const
Definition: Object.h:386
int getLatAxis() const
Get LatAxis: index of the latitude axis.
Definition: SkyFrame.h:156
bool getB(std::string const &attrib) const
Definition: Object.h:334
bool getNegLon() const
Get NegLon: display longitude values in the range [-pi,pi]?
Definition: SkyFrame.h:162
int getLonAxis() const
Get LonAxis: index of the longitude axis.
Definition: SkyFrame.h:159
SkyFrame(std::string const &options="")
Definition: SkyFrame.h:123
bool getIsLatAxis(int axis) const
Get IsLatAxis(axis) for one axis: is the specified axis the latitude axis?
Definition: SkyFrame.h:150
std::shared_ptr< SkyFrame > copy() const
Return a deep copy of this object.
Definition: SkyFrame.h:136
AstObject const * getRawPtr() const
Definition: Object.h:260