CARMA C++
Source.h
1 
9 #ifndef CARMA_SERVICES_SOURCE_H
10 #define CARMA_SERVICES_SOURCE_H
11 
13 #include "carma/services/Angle.h"
16 
17 namespace carma {
18 namespace services {
23  class Source : public carma::services::CatalogEntry {
24  public:
29  Source();
30 
35  Source(const std::string& name);
36 
71  Source(const std::string& name,
72  const Angle& xCoord,
73  const Angle& yCoord,
74  const Velocity& velocity,
75  const Angle& parallax,
76  coordSysType coordSys = COORDSYS_RADEC,
77  double xProperMotion = 0.0,
78  double yProperMotion = 0.0,
79  const std::string& catalogFormat = "CARMA",
80  unsigned long idNo = 0,
81  sourcePntType pntType = PNT_RADIO,
82  const std::string& comments = "This Space For Rent"
83  );
84 
119  Source(const std::string& name,
120  const Angle& xCoord,
121  const Angle& yCoord,
122  const Velocity& velocity,
123  const Distance& distance,
124  coordSysType coordSys = COORDSYS_RADEC,
125  double xProperMotion = 0.0,
126  double yProperMotion = 0.0,
127  const std::string& catalogFormat = "CARMA",
128  unsigned long idNo = 0,
129  sourcePntType pntType = PNT_RADIO,
130  const std::string& comments = "This Space For Rent"
131  );
132 
133 
135  virtual ~Source();
136 
142  void setXCoordinate(const Angle& xcoord);
143 
149  void setYCoordinate(const Angle& ycoord);
150 
156  void setXProperMotion(double xProperMotion);
157 
163  void setYProperMotion(double yProperMotion);
164 
170  void setVelocity(const Velocity& velocity);
171 
176  void setParallax(const Angle& parallax);
177 
182  void setCatalogFormat(const std::string& catalogFormat);
183 
188  void setIdNo(unsigned long idNo);
189 
195  pntType_ = type;
196  }
197 
202  void setComments(const std::string& comments);
203 
204  // inline all the accessor methods
205 
211  return x_;
212  }
213 
219  return y_;
220  }
221 
225  double getXProperMotion() const {
226  return xProperMotion_;
227  }
228 
233  return coordSys_;
234  }
235 
239  double getYProperMotion() const {
240  return yProperMotion_;
241  }
242 
248  return velocity_;
249  }
250 
254  Angle getParallax() const {
255  return parallax_;
256  }
257 
261  std::string getComments() const {
262  return comments_;
263  }
264 
268  std::string getCatalogFormat() const {
269  return catalogFormat_;
270  }
271 
275  unsigned long getIdNo() const {
276  return idNo_;
277  }
278 
284  return pntType_;
285  }
286 
287  bool isOptical() const
288  {
289  return ( pntType_ == PNT_OPTICAL || pntType_ == PNT_BOTH );
290  }
291 
292  bool isRadio() const {
293  return ( pntType_ == PNT_RADIO || pntType_ == PNT_BOTH );
294  }
295 
300  bool isPlanet() const
301  {
302  return Source::isPlanet(getName());
303  }
304 
310  return Distance::getDistance(parallax_);
311  }
312 
318  static bool isPlanet(const std::string& sourceName);
319 
320  private:
321  Angle x_; // x coordinate
322  Angle y_; // y coordinate
323  Velocity velocity_; // velocity value, frame, definition
324  Angle parallax_; // trigonometric parallax
325  coordSysType coordSys_; // coordinate system
326  double xProperMotion_; // milli arcsec (mas) per year
327  double yProperMotion_; // milli arcsec (mas) per year
328  std::string catalogFormat_; // catalog format (for NOVAS)
329  unsigned long idNo_; // source ID number (for NOVAS)
330  sourcePntType pntType_; // This is a RADIO and/or OPTICAL source.
331  std::string comments_; // additional comments
332 
333  // number of elements in this CatalogEntry
334  static const unsigned int NELEMENTS = 11;
335 
336  }; // end class Source
337 
341 std::ostream& operator<<(std::ostream& os, carma::services::Source& source);
342 
343 } // end services
344 } // end carma
345 
346 #endif // CARMA_SERVICES_SOURCE_H
Representation of Distance in any units.
Angle getXCoordinate() const
Definition: Source.h:210
double getYProperMotion() const
Definition: Source.h:239
Right Ascension, Declination.
Definition: Types.h:88
Source()
Default Constructor.
void setIdNo(unsigned long idNo)
Set an ID number for this Source.
Representation of an angle, return values are always modulo 2PI radians.
void setCatalogFormat(const std::string &catalogFormat)
Set the catalog format style (this is used by NOVAS).
Source is derived from CatalogEntry and is used to hold information for a particular entry from a sou...
Definition: Source.h:23
The Distance class can represent an distance in any units.
Definition: Distance.h:43
std::string getComments() const
Definition: Source.h:261
void setYCoordinate(const Angle &ycoord)
Set the Y coordinate of this Source.
void setParallax(const Angle &parallax)
Set the parallax of this Source.
The Velocity class can represent an velocity in any units.
Definition: Velocity.h:42
enum carma::services::sourcePntEnum sourcePntType
Can this source be used for RADIO and/or OPTICAL pointing?
Source can be used only for optical pointing.
Definition: Types.h:115
Angle getYCoordinate() const
Definition: Source.h:218
coordSysType getCoordSysType() const
Definition: Source.h:232
unsigned long getIdNo() const
Definition: Source.h:275
Source can be used only for both radio and optical pointing.
Definition: Types.h:120
std::string getCatalogFormat() const
Definition: Source.h:268
void setXProperMotion(double xProperMotion)
Set the X proper motion of this Source.
void setXCoordinate(const Angle &xcoord)
Set the X coordinate of this Source.
The Angle class can represent any angle in any units.
Definition: Angle.h:38
sourcePntType getPntType() const
Definition: Source.h:283
Source can be used only for radio pointing.
Definition: Types.h:110
enum carma::services::coordSysEnum coordSysType
The coordinate systems.
double getXProperMotion() const
Definition: Source.h:225
virtual ~Source()
Destructor.
void setVelocity(const Velocity &velocity)
Set the radial velocity of this Source.
static Distance getDistance(const Angle &parallax)
Given an parallax angle, return the equivalent distance.
Distance getDistance() const
Definition: Source.h:309
std::ostream & operator<<(std::ostream &os, const carma::services::Angle &angle)
Define the &lt;&lt; operator to allow, e.g.
bool isPlanet() const
Definition: Source.h:300
Representation of Velocity in any units.
Velocity getVelocity() const
Definition: Source.h:247
void setPntType(sourcePntType type)
Set the pointing type for this source.
Definition: Source.h:194
Angle getParallax() const
Definition: Source.h:254
void setYProperMotion(double yProperMotion)
Set the Y proper motion of this Source.
void setComments(const std::string &comments)
Set any additional comments about this Source.