LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Coord.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008, 2009, 2010 LSST Corporation.
6  *
7  * This product includes software developed by the
8  * LSST Project (http://www.lsst.org/).
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the LSST License Statement and
21  * the GNU General Public License along with this program. If not,
22  * see <http://www.lsstcorp.org/LegalNotices/>.
23  */
24 
25 #if !defined(LSST_AFW_COORD_COORD_H)
26 #define LSST_AFW_COORD_COORD_H
27 
35 #include <iostream>
36 #include <limits>
37 #include <map>
38 
39 #include "boost/shared_ptr.hpp"
40 
41 #include "lsst/afw/geom/Point.h"
42 #include "lsst/afw/geom/Angle.h"
44 #include "lsst/daf/base.h"
45 
46 namespace lsst {
47 namespace afw {
48 namespace coord {
49 
50 
51 /*
52  * Information about the coordinate system we support
53  */
55 CoordSystem makeCoordEnum(std::string const system);
56 
57 class IcrsCoord;
58 class Fk5Coord;
59 class GalacticCoord;
60 class EclipticCoord;
61 class TopocentricCoord;
62 
63 
69 class Coord {
70 public:
71 
72  typedef boost::shared_ptr<Coord> Ptr;
73  typedef boost::shared_ptr<Coord const> ConstPtr;
74 
75  Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit = lsst::afw::geom::degrees, double const epoch = 2000.0);
76  Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
77  bool normalize=true,
78  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.));
79  Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0);
80  Coord(std::string const ra, std::string const dec, double const epoch = 2000.0);
81  Coord();
82  virtual ~Coord() {}
83 
84  virtual Coord::Ptr clone() const { return Coord::Ptr(new Coord(*this)); }
85 
86  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude) {
87  double const epoch = 2000.0;
88  reset(longitude, latitude, epoch);
89  }
90  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude,
91  double const epoch);
92 
93  double getEpoch() const { return _epoch; }
94 
97  virtual std::pair<std::string, std::string> getCoordNames() const {
98  return std::pair<std::string, std::string>("RA", "Dec");
99  }
100 
101  virtual std::string getClassName() const { return "Coord"; }
102 
103  // These are inline functions and are defined at the end of this header file
104  lsst::afw::geom::Angle operator[](int const index) const;
105  bool operator==(Coord const &rhs) const;
113  inline lsst::afw::geom::Angle getLongitude() const { return _longitude; };
120  inline lsst::afw::geom::Angle getLatitude() const { return _latitude; };
121  inline std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const;
122  inline std::string getLatitudeStr() const;
123 
124 
125  Coord transform(Coord const &poleFrom, Coord const &poleTo) const;
127 
128  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getOffsetFrom(Coord const &c) const;
129  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getTangentPlaneOffset(Coord const &c) const;
130 
131  void rotate(Coord const &axis, lsst::afw::geom::Angle const theta);
133 
134  Coord::Ptr convert(CoordSystem system) const;
135 
136  virtual Fk5Coord toFk5(double const epoch) const;
137  virtual Fk5Coord toFk5() const;
138  virtual IcrsCoord toIcrs() const;
139  virtual GalacticCoord toGalactic() const;
140  virtual EclipticCoord toEcliptic(double const epoch) const;
141  virtual EclipticCoord toEcliptic() const;
142  virtual TopocentricCoord toTopocentric(Observatory const &obs,
143  lsst::daf::base::DateTime const &obsDate) const;
144 
145 private:
148  double _epoch;
149 
150  void _verifyValues() const;
151 };
152 
157 class IcrsCoord : public Coord {
158 public:
159  typedef boost::shared_ptr<IcrsCoord> Ptr;
160 
162  IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.)) :
163  Coord(p3d, 2000.0, normalize, defaultLongitude) {}
164  IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec) : Coord(ra, dec, 2000.0) {}
165  IcrsCoord(std::string const ra, std::string const dec) : Coord(ra, dec, 2000.0) {}
166  IcrsCoord() : Coord() {}
167 
168  virtual Coord::Ptr clone() const { return IcrsCoord::Ptr(new IcrsCoord(*this)); }
169 
170  virtual std::string getClassName() const { return "IcrsCoord"; }
171 
172  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude);
173 
176  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
177  std::string getDecStr() const { return getLatitudeStr(); }
178 
179  virtual Fk5Coord toFk5(double const epoch) const;
180  virtual Fk5Coord toFk5() const;
181  virtual IcrsCoord toIcrs() const;
182 
183 private:
184 };
185 
186 
191 class Fk5Coord : public Coord {
192 public:
193 
194  typedef boost::shared_ptr<Fk5Coord> Ptr;
195 
197  Coord(p2d, unit, epoch) {}
198  Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
199  bool normalize=true,
200  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
201  Coord(p3d, epoch, normalize, defaultLongitude) {}
202  Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0) :
203  Coord(ra, dec, epoch) {}
204  Fk5Coord(std::string const ra, std::string const dec, double const epoch = 2000.0) :
205  Coord(ra, dec, epoch) {}
206  Fk5Coord() : Coord() {}
207 
208  virtual Coord::Ptr clone() const { return Fk5Coord::Ptr(new Fk5Coord(*this)); }
209 
210  virtual std::string getClassName() const { return "Fk5Coord"; }
211 
212  Fk5Coord precess(double const epochTo) const;
213 
216  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
217  std::string getDecStr() const { return getLatitudeStr(); }
218 
219  virtual Fk5Coord toFk5(double const epoch) const;
220  virtual Fk5Coord toFk5() const;
221  virtual IcrsCoord toIcrs() const;
222  virtual GalacticCoord toGalactic() const;
223  virtual EclipticCoord toEcliptic(double const epoch) const;
224  virtual EclipticCoord toEcliptic() const;
225  virtual TopocentricCoord toTopocentric(Observatory const &obs,
226  lsst::daf::base::DateTime const &obsDate) const;
227 
228 
229 private:
230 };
231 
232 
237 class GalacticCoord : public Coord {
238 public:
239 
240  typedef boost::shared_ptr<GalacticCoord> Ptr;
241 
244  bool normalize=true, lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
245  Coord(p3d, normalize, defaultLongitude) {}
247  GalacticCoord(std::string const l, std::string const b) : Coord(l, b) {}
249 
250  virtual Coord::Ptr clone() const { return GalacticCoord::Ptr(new GalacticCoord(*this)); }
251 
252  virtual std::string getClassName() const { return "GalacticCoord"; }
253 
254  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude);
255 
256  virtual std::pair<std::string, std::string> getCoordNames() const {
257  return std::pair<std::string, std::string>("L", "B");
258  }
259 
260  lsst::afw::geom::Angle getL() const { return getLongitude(); }
261  lsst::afw::geom::Angle getB() const { return getLatitude(); }
262  std::string getLStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
263  std::string getBStr() const { return getLatitudeStr(); }
264 
265  virtual Fk5Coord toFk5(double const epoch) const;
266  virtual Fk5Coord toFk5() const ;
267  virtual GalacticCoord toGalactic() const;
268 
269 private:
270 };
271 
272 
273 
278 class EclipticCoord : public Coord {
279 public:
280 
281  typedef boost::shared_ptr<EclipticCoord> Ptr;
282 
285  double const epoch = 2000.0) :
286  Coord(p2d, unit, epoch) {}
287  EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
288  bool normalize=true,
289  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
290  Coord(p3d, epoch, normalize, defaultLongitude) {}
291 
292  // note the abbreviation of lambda -> lamd to avoid swig warnings for python keyword 'lambda'
294  double const epoch = 2000.0) :
295  Coord(lamb, beta, epoch) {}
296  EclipticCoord(std::string const lamb, std::string const beta, double const epoch = 2000.0) :
297  Coord(lamb, beta, epoch) {}
298 
300 
301  virtual Coord::Ptr clone() const { return EclipticCoord::Ptr(new EclipticCoord(*this)); }
302 
303  virtual std::string getClassName() const { return "EclipticCoord"; }
304 
305  virtual std::pair<std::string, std::string> getCoordNames() const {
306  return std::pair<std::string, std::string>("Lambda", "Beta");
307  }
310  std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
311  std::string getBetaStr() const { return getLatitudeStr(); }
312 
313 
314  virtual Fk5Coord toFk5(double const epoch) const;
315  virtual Fk5Coord toFk5() const;
316  virtual EclipticCoord toEcliptic(double const epoch) const;
317  virtual EclipticCoord toEcliptic() const;
318 
319  EclipticCoord precess(double const epochTo) const;
320 
321 private:
322 };
323 
324 
329 class TopocentricCoord : public Coord {
330 public:
331 
332  typedef boost::shared_ptr<TopocentricCoord> Ptr;
333 
335  Observatory const &obs) : Coord(p2d, unit, epoch), _obs(obs) {}
336  TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch,
337  Observatory const &obs, bool normalize=true,
338  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
339  Coord(p3d, epoch, normalize, defaultLongitude), _obs(obs) {}
340  TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch,
341  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
342  TopocentricCoord(std::string const az, std::string const alt, double const epoch,
343  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
344 
345  virtual Coord::Ptr clone() const { return TopocentricCoord::Ptr(new TopocentricCoord(*this)); }
346 
347  virtual std::string getClassName() const { return "TopocentricCoord"; }
348 
349  Observatory getObservatory() const { return _obs; }
350 
351  virtual std::pair<std::string, std::string> getCoordNames() const {
352  return std::pair<std::string, std::string>("Az", "Alt");
353  }
356  std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
357  std::string getAltitudeStr() const { return getLatitudeStr(); }
358 
359  virtual Fk5Coord toFk5(double const epoch) const;
360  virtual Fk5Coord toFk5() const;
361  virtual TopocentricCoord toTopocentric(Observatory const &obs,
362  lsst::daf::base::DateTime const &date) const;
363  virtual TopocentricCoord toTopocentric() const;
364 
365 private:
367 };
368 
369 
370 /*
371  * Factory Functions
372  *
373  */
374 Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch);
375 Coord::Ptr makeCoord(CoordSystem const system, std::string const ra, std::string const dec,
376  double const epoch);
378  double const epoch);
379 Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Point3D const &p3d, double const epoch,
380  bool normalize=true,
381  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
382 Coord::Ptr makeCoord(CoordSystem const system);
383 
385 Coord::Ptr makeCoord(CoordSystem const system, std::string const ra, std::string const dec);
388  bool normalize=true,
389  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
390 
391 /*
392  * Utility functions
393  *
394  */
396 
397 lsst::afw::geom::Angle dmsStringToAngle(std::string const dms);
398 lsst::afw::geom::Angle hmsStringToAngle(std::string const hms);
399 std::string angleToDmsString(lsst::afw::geom::Angle const deg);
400 std::string angleToHmsString(lsst::afw::geom::Angle const deg);
401 
402 std::ostream & operator<<(std::ostream & os, Coord const & coord);
403 
404 }}}
405 
406 
407 /* ==============================================================
408  *
409  * Definitions of inline functions
410  *
411  * ============================================================== */
412 
413 
419 
420  switch (index) {
421  case 0:
422  return _longitude;
423  break;
424  case 1:
425  return _latitude;
426  break;
427  default:
428  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
429  "Index must be 0 or 1.");
430  break;
431  }
432 }
433 
444  if (unit == lsst::afw::geom::hours) {
445  return angleToHmsString(getLongitude());
446  } else if (unit == lsst::afw::geom::degrees) {
447  return angleToDmsString(getLongitude());
448  } else {
449  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
450  "Units must be 'degrees' or 'hours'");
451  }
452 }
460 inline std::string lsst::afw::coord::Coord::getLatitudeStr() const {
461  return angleToDmsString(getLatitude());
462 }
463 
468  return (_longitude == rhs._longitude) &&
469  (_latitude == rhs._latitude) &&
470  (_epoch == rhs._epoch);
471 }
472 
476 inline bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs) {
477  return !(lhs == rhs);
478 }
479 
480 #endif
virtual Fk5Coord toFk5() const
Convert ourself from Ecliptic to Fk5 (use current epoch)
Definition: Coord.cc:1097
GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:243
virtual IcrsCoord toIcrs() const
Icrs converter for IcrsCoord. (ie. a no-op)
Definition: Coord.cc:1017
boost::shared_ptr< Coord > Ptr
Definition: Coord.h:72
std::string getAltitudeStr() const
Definition: Coord.h:357
lsst::afw::geom::Angle getB() const
Definition: Coord.h:261
A coordinate class intended to represent absolute positions.
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
Definition: Coord.cc:812
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:196
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:58
EclipticCoord(std::string const lamb, std::string const beta, double const epoch=2000.0)
Definition: Coord.h:296
lsst::afw::geom::Angle _longitude
Definition: Coord.h:146
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:799
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:175
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
special reset() overload to make sure no epoch can be set
Definition: Coord.cc:997
A class to handle Galactic coordinates (inherits from Coord)
Definition: Coord.h:237
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:242
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:305
lsst::afw::geom::Angle hmsStringToAngle(std::string const hms)
Convert a hh:mm:ss string to Angle.
Definition: Coord.cc:335
virtual Fk5Coord toFk5() const
Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)
Definition: Coord.cc:845
Store information about an observatory ... lat/long, elevation.
Definition: Observatory.h:48
virtual Coord::Ptr clone() const
Definition: Coord.h:84
virtual std::string getClassName() const
Definition: Coord.h:210
boost::shared_ptr< Fk5Coord > Ptr
Definition: Coord.h:194
boost::shared_ptr< TopocentricCoord > Ptr
Definition: Coord.h:332
lsst::afw::geom::Angle getAzimuth() const
Definition: Coord.h:354
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
Definition: Coord.h:443
bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs)
Inequality; the complement of equality.
Definition: Coord.h:476
EclipticCoord precess(double const epochTo) const
precess to new epoch
Definition: Coord.cc:1107
virtual std::string getClassName() const
Definition: Coord.h:170
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
Definition: Coord.cc:1155
AngleUnit const hours
Definition: Angle.h:93
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:903
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getTangentPlaneOffset(Coord const &c) const
Get the offset on the tangent plane.
Definition: Coord.cc:748
IcrsCoord(std::string const ra, std::string const dec)
Definition: Coord.h:165
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:947
lsst::afw::geom::Angle getLambda() const
Definition: Coord.h:308
virtual TopocentricCoord toTopocentric() const
Convert ourself from Topocentric to Topocentric with no observatory or date arguments.
Definition: Coord.cc:1185
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
lsst::afw::geom::Angle getAltitude() const
Definition: Coord.h:355
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getOffsetFrom(Coord const &c) const
Compute the offset from a coordinate.
Definition: Coord.cc:713
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:38
Class to hold observatory information.
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:853
virtual ~Coord()
Definition: Coord.h:82
Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch=2000.0, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:198
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
Definition: Coord.cc:529
A class used to convert scalar POD types such as double to Angle.
Definition: Angle.h:71
void _verifyValues() const
Make sure the values we&#39;ve got are in the range 0 &lt;= x &lt; 2PI.
Definition: Coord.cc:447
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
Definition: Coord.h:86
Observatory getObservatory() const
Definition: Coord.h:349
std::ostream & operator<<(std::ostream &os, Coord const &coord)
Definition: Coord.cc:1418
lsst::afw::geom::Angle _latitude
Definition: Coord.h:147
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:351
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:340
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:310
virtual Coord::Ptr clone() const
Definition: Coord.h:301
AngleUnit const degrees
Definition: Angle.h:92
std::string getBetaStr() const
Definition: Coord.h:311
virtual std::string getClassName() const
Definition: Coord.h:347
virtual Fk5Coord toFk5() const
Convert ourself from galactic to Fk5 (no epoch specified)
Definition: Coord.cc:1049
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
Definition: Coord.h:329
boost::shared_ptr< IcrsCoord > Ptr
Definition: Coord.h:159
std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:356
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
Definition: Coord.cc:784
IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:162
GalacticCoord(std::string const l, std::string const b)
Definition: Coord.h:247
EclipticCoord(lsst::afw::geom::Angle const lamb, lsst::afw::geom::Angle const beta, double const epoch=2000.0)
Definition: Coord.h:293
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
Definition: Coord.cc:896
virtual Coord::Ptr clone() const
Definition: Coord.h:208
TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch, Observatory const &obs, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:336
virtual Coord::Ptr clone() const
Definition: Coord.h:345
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:215
Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch)
Factory function to create a Coord of arbitrary type with decimal RA,Dec.
Definition: Coord.cc:1211
EclipticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:283
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
Definition: Coord.h:467
lsst::afw::geom::Angle getBeta() const
Definition: Coord.h:309
double getEpoch() const
Definition: Coord.h:93
std::string angleToDmsString(lsst::afw::geom::Angle const deg)
a Function to convert a coordinate in decimal degrees to a string with form dd:mm:ss ...
Definition: Coord.cc:293
lsst::afw::geom::Angle offset(lsst::afw::geom::Angle const phi, lsst::afw::geom::Angle const arcLen)
offset our current coords along a great circle defined by an angle wrt a declination parallel ...
Definition: Coord.cc:566
std::string angleToHmsString(lsst::afw::geom::Angle const deg)
a function to convert decimal degrees to a string with form hh:mm:ss.s
Definition: Coord.cc:300
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:176
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition: Coord.h:460
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
special reset() overload to make sure no epoch can be set
Definition: Coord.cc:1033
A class to handle Fk5 coordinates (inherits from Coord)
Definition: Coord.h:191
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:216
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:868
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
A class to handle Ecliptic coordinates (inherits from Coord)
Definition: Coord.h:278
virtual std::string getClassName() const
Definition: Coord.h:101
boost::shared_ptr< EclipticCoord > Ptr
Definition: Coord.h:281
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:97
virtual std::string getClassName() const
Definition: Coord.h:303
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:214
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:113
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:792
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:342
virtual std::string getClassName() const
Definition: Coord.h:252
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
Definition: Coord.h:246
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
Definition: Coord.h:418
afw::table::Key< double > b
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
Definition: Coord.h:164
virtual Coord::Ptr clone() const
Definition: Coord.h:250
CoordSystem makeCoordEnum(std::string const system)
A utility function to get the enum value of a coordinate system from a string name.
Definition: Coord.cc:117
std::string getDecStr() const
Definition: Coord.h:217
virtual Fk5Coord toFk5() const
Fk5 converter for IcrsCoord. (no epoch specified)
Definition: Coord.cc:1010
lsst::afw::geom::Angle getL() const
Definition: Coord.h:260
virtual GalacticCoord toGalactic() const
Convert ourself from Galactic to Galactic ... a no-op.
Definition: Coord.cc:1056
Coord::Ptr convert(CoordSystem system) const
Convert to a specified Coord type.
Definition: Coord.cc:637
boost::shared_ptr< Coord const > ConstPtr
Definition: Coord.h:73
lsst::afw::geom::Point3D getVector() const
Return our contents in a position vector.
Definition: Coord.cc:491
virtual Coord::Ptr clone() const
Definition: Coord.h:168
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
Definition: Coord.h:202
std::string getBStr() const
Definition: Coord.h:263
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:120
EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch=2000.0, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:287
Fk5Coord(std::string const ra, std::string const dec, double const epoch=2000.0)
Definition: Coord.h:204
std::string getDecStr() const
Definition: Coord.h:177
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:174
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:157
lsst::afw::geom::Angle dmsStringToAngle(std::string const dms)
Convert a dd:mm:ss string to Angle.
Definition: Coord.cc:344
Vector beta
boost::shared_ptr< GalacticCoord > Ptr
Definition: Coord.h:240
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:256
virtual EclipticCoord toEcliptic() const
Convert ourself from Ecliptic to Ecliptic ... a no-op (use the current epoch)
Definition: Coord.cc:1078
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:262
lsst::afw::geom::Point2D getPosition(lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees) const
Return our contents in a Point2D object.
Definition: Coord.cc:477
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:334
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
Definition: Coord.cc:354
IcrsCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:161
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
Definition: Coord.cc:507
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
Definition: Coord.cc:689
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:819