22 #ifndef ASTSHIM_SKYFRAME_H 23 #define ASTSHIM_SKYFRAME_H 28 #include "astshim/Frame.h" 125 :
Frame(reinterpret_cast<AstFrame *>(astSkyFrame(
"%s", options.c_str()))) {}
141 bool getAsTime(
int axis)
const {
return getB(detail::formatAxisAttr(
"AsTime", axis)); }
147 bool getIsLatAxis(
int axis)
const {
return getB(detail::formatAxisAttr(
"IsLatAxis", axis)); }
150 bool getIsLonAxis(
int axis)
const {
return getB(detail::formatAxisAttr(
"IsLonAxis", axis)); }
167 std::vector<double> ret;
168 for (
int axis = 1; axis < 3; ++axis) {
169 ret.push_back(
getD(detail::formatAxisAttr(
"SkyRef", axis)));
180 std::vector<double> ret;
181 for (
int axis = 1; axis < 3; ++axis) {
182 ret.push_back(
getD(detail::formatAxisAttr(
"SkyRefP", axis)));
194 void setAsTime(
int axis,
bool asTime) {
setB(detail::formatAxisAttr(
"AsTime", axis), asTime); }
207 detail::assertEqual(skyRef.size(),
"skyRef length", 2u,
"number of axes");
208 for (
int i = 0; i < 2; ++i) {
209 setD(detail::formatAxisAttr(
"SkyRef", i + 1), skyRef[i]);
218 detail::assertEqual(skyRefP.size(),
"skyRefP length", 2u,
"number of axes");
219 for (
int i = 0; i < 2; ++i) {
220 setD(detail::formatAxisAttr(
"SkyRefP", i + 1), skyRefP[i]);
236 auto *rawMap =
reinterpret_cast<AstObject *
>(astSkyOffsetMap(
getRawPtr()));
237 return Object::fromAstObject<Mapping>(rawMap,
false);
242 return copyImpl<SkyFrame, AstSkyFrame>();
246 explicit SkyFrame(AstSkyFrame *rawptr) :
Frame(reinterpret_cast<AstFrame *>(rawptr)) {
248 std::ostringstream os;
249 os <<
"this is a " <<
getClassName() <<
", which is not a SkyFrame";
250 throw std::invalid_argument(os.str());
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: SkyFrame.h:241
std::shared_ptr< SkyFrame > copy() const
Return a deep copy of this object.
Definition: SkyFrame.h:135
bool getIsLatAxis(int axis) const
Get IsLatAxis(axis) for one axis: is the specified axis the latitude axis?
Definition: SkyFrame.h:147
AstObject const * getRawPtr() const
Definition: Object.h:289
bool getNegLon() const
Get NegLon: display longitude values in the range [-pi,pi]?
Definition: SkyFrame.h:159
void setB(std::string const &attrib, bool value)
Definition: Object.h:451
void setAlignOffset(bool alignOffset)
Set AlignOffset: align SkyFrames using the offset coordinate system?
Definition: SkyFrame.h:191
int getI(std::string const &attrib) const
Definition: Object.h:402
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
std::string getClassName() const
Definition: Object.h:136
std::string getSkyRefIs() const
Get SkyRefIs: selects the nature of the offset coordinate system.
Definition: SkyFrame.h:175
void setSkyTol(double skyTol)
Set SkyTol: smallest significant shift in sky coordinates.
Definition: SkyFrame.h:225
double getSkyTol() const
Get SkyTol: smallest significant shift in sky coordinates.
Definition: SkyFrame.h:188
void setNegLon(bool negLon)
Set NegLon: display longitude values in the range [-pi,pi]?
Definition: SkyFrame.h:200
int getLatAxis() const
Get LatAxis: index of the latitude axis.
Definition: SkyFrame.h:153
double getEquinox() const
Get Equinox: epoch of the mean equinox.
Definition: SkyFrame.h:144
SkyFrame(std::string const &options="")
Definition: SkyFrame.h:124
std::vector< double > getSkyRefP() const
Definition: SkyFrame.h:179
Definition: SkyFrame.h:66
bool getB(std::string const &attrib) const
Definition: Object.h:350
bool getAsTime(int axis) const
Get AsTime(axis) for one axis: format celestial coordinates as times?
Definition: SkyFrame.h:141
void setC(std::string const &attrib, std::string const &value)
Definition: Object.h:463
bool getIsLonAxis(int axis) const
Get IsLonAxis(axis) for one axis: is the specified axis the longitude axis?
Definition: SkyFrame.h:150
void setAsTime(int axis, bool asTime)
Set AsTime(axis) for one axis: format celestial coordinates as times?
Definition: SkyFrame.h:194
void setEquinox(double equinox)
Set Equinox: epoch of the mean equinox.
Definition: SkyFrame.h:197
int getLonAxis() const
Get LonAxis: index of the longitude axis.
Definition: SkyFrame.h:156
void setProjection(std::string const &projection)
Set Projection: sky projection description.
Definition: SkyFrame.h:203
void setD(std::string const &attrib, double value)
Definition: Object.h:475
void setSkyRefP(std::vector< double > const &skyRefP)
Set SkyRefP: position defining orientation of the offset coordinate system.
Definition: SkyFrame.h:217
double getD(std::string const &attrib) const
Definition: Object.h:376
std::shared_ptr< Mapping > skyOffsetMap()
Definition: SkyFrame.h:235
SkyFrame(AstSkyFrame *rawptr)
Construct a SkyFrame from a raw AST pointer.
Definition: SkyFrame.h:246
std::string const getC(std::string const &attrib) const
Definition: Object.h:363
void setSkyRefIs(std::string const &skyRefIs)
Set SkyRefIs: selects the nature of the offset coordinate system.
Definition: SkyFrame.h:214
void setSkyRef(std::vector< double > const &skyRef)
Set SkyRef: position defining location of the offset coordinate system.
Definition: SkyFrame.h:206
std::vector< double > getSkyRef() const
Definition: SkyFrame.h:166
std::string getProjection() const
Get Projection: sky projection description.
Definition: SkyFrame.h:162
bool getAlignOffset() const
Get AlignOffset: align SkyFrames using the offset coordinate system?
Definition: SkyFrame.h:138