LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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  // These are inline functions and are defined at the end of this header file
102  lsst::afw::geom::Angle operator[](int const index) const;
103  bool operator==(Coord const &rhs) const;
111  inline lsst::afw::geom::Angle getLongitude() const { return _longitude; };
118  inline lsst::afw::geom::Angle getLatitude() const { return _latitude; };
119  inline std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const;
120  inline std::string getLatitudeStr() const;
121 
122 
123  Coord transform(Coord const &poleFrom, Coord const &poleTo) const;
125 
126  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getOffsetFrom(Coord const &c) const;
127  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getTangentPlaneOffset(Coord const &c) const;
128 
129  void rotate(Coord const &axis, lsst::afw::geom::Angle const theta);
131 
132  Coord::Ptr convert(CoordSystem system) const;
133 
134  virtual Fk5Coord toFk5(double const epoch) const;
135  virtual Fk5Coord toFk5() const;
136  virtual IcrsCoord toIcrs() const;
137  virtual GalacticCoord toGalactic() const;
138  virtual EclipticCoord toEcliptic(double const epoch) const;
139  virtual EclipticCoord toEcliptic() const;
140  virtual TopocentricCoord toTopocentric(Observatory const &obs,
141  lsst::daf::base::DateTime const &obsDate) const;
142 
143 private:
146  double _epoch;
147 
148  void _verifyValues() const;
149 };
150 
155 class IcrsCoord : public Coord {
156 public:
157  typedef boost::shared_ptr<IcrsCoord> Ptr;
158 
160  IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.)) :
161  Coord(p3d, 2000.0, normalize, defaultLongitude) {}
162  IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec) : Coord(ra, dec, 2000.0) {}
163  IcrsCoord(std::string const ra, std::string const dec) : Coord(ra, dec, 2000.0) {}
164  IcrsCoord() : Coord() {}
165 
166  virtual Coord::Ptr clone() const { return IcrsCoord::Ptr(new IcrsCoord(*this)); }
167 
168  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude);
169 
172  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
173  std::string getDecStr() const { return getLatitudeStr(); }
174 
175  virtual Fk5Coord toFk5(double const epoch) const;
176  virtual Fk5Coord toFk5() const;
177  virtual IcrsCoord toIcrs() const;
178 
179 private:
180 };
181 
182 
187 class Fk5Coord : public Coord {
188 public:
189 
190  typedef boost::shared_ptr<Fk5Coord> Ptr;
191 
193  Coord(p2d, unit, epoch) {}
194  Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
195  bool normalize=true,
196  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
197  Coord(p3d, epoch, normalize, defaultLongitude) {}
198  Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0) :
199  Coord(ra, dec, epoch) {}
200  Fk5Coord(std::string const ra, std::string const dec, double const epoch = 2000.0) :
201  Coord(ra, dec, epoch) {}
202  Fk5Coord() : Coord() {}
203 
204  virtual Coord::Ptr clone() const { return Fk5Coord::Ptr(new Fk5Coord(*this)); }
205 
206  Fk5Coord precess(double const epochTo) const;
207 
210  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
211  std::string getDecStr() const { return getLatitudeStr(); }
212 
213  virtual Fk5Coord toFk5(double const epoch) const;
214  virtual Fk5Coord toFk5() const;
215  virtual IcrsCoord toIcrs() const;
216  virtual GalacticCoord toGalactic() const;
217  virtual EclipticCoord toEcliptic(double const epoch) const;
218  virtual EclipticCoord toEcliptic() const;
219  virtual TopocentricCoord toTopocentric(Observatory const &obs,
220  lsst::daf::base::DateTime const &obsDate) const;
221 
222 
223 private:
224 };
225 
226 
231 class GalacticCoord : public Coord {
232 public:
233 
234  typedef boost::shared_ptr<GalacticCoord> Ptr;
235 
238  bool normalize=true, lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
239  Coord(p3d, normalize, defaultLongitude) {}
241  GalacticCoord(std::string const l, std::string const b) : Coord(l, b) {}
243 
244  virtual Coord::Ptr clone() const { return GalacticCoord::Ptr(new GalacticCoord(*this)); }
245 
246  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude);
247 
248  virtual std::pair<std::string, std::string> getCoordNames() const {
249  return std::pair<std::string, std::string>("L", "B");
250  }
251 
252  lsst::afw::geom::Angle getL() const { return getLongitude(); }
253  lsst::afw::geom::Angle getB() const { return getLatitude(); }
254  std::string getLStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
255  std::string getBStr() const { return getLatitudeStr(); }
256 
257  virtual Fk5Coord toFk5(double const epoch) const;
258  virtual Fk5Coord toFk5() const ;
259  virtual GalacticCoord toGalactic() const;
260 
261 private:
262 };
263 
264 
265 
270 class EclipticCoord : public Coord {
271 public:
272 
273  typedef boost::shared_ptr<EclipticCoord> Ptr;
274 
277  double const epoch = 2000.0) :
278  Coord(p2d, unit, epoch) {}
279  EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
280  bool normalize=true,
281  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
282  Coord(p3d, epoch, normalize, defaultLongitude) {}
283 
284  // note the abbreviation of lambda -> lamd to avoid swig warnings for python keyword 'lambda'
286  double const epoch = 2000.0) :
287  Coord(lamb, beta, epoch) {}
288  EclipticCoord(std::string const lamb, std::string const beta, double const epoch = 2000.0) :
289  Coord(lamb, beta, epoch) {}
290 
292 
293  virtual Coord::Ptr clone() const { return EclipticCoord::Ptr(new EclipticCoord(*this)); }
294 
295  virtual std::pair<std::string, std::string> getCoordNames() const {
296  return std::pair<std::string, std::string>("Lambda", "Beta");
297  }
300  std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
301  std::string getBetaStr() const { return getLatitudeStr(); }
302 
303 
304  virtual Fk5Coord toFk5(double const epoch) const;
305  virtual Fk5Coord toFk5() const;
306  virtual EclipticCoord toEcliptic(double const epoch) const;
307  virtual EclipticCoord toEcliptic() const;
308 
309  EclipticCoord precess(double const epochTo) const;
310 
311 private:
312 };
313 
314 
319 class TopocentricCoord : public Coord {
320 public:
321 
322  typedef boost::shared_ptr<TopocentricCoord> Ptr;
323 
325  Observatory const &obs) : Coord(p2d, unit, epoch), _obs(obs) {}
326  TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch,
327  Observatory const &obs, bool normalize=true,
328  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
329  Coord(p3d, epoch, normalize, defaultLongitude), _obs(obs) {}
330  TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch,
331  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
332  TopocentricCoord(std::string const az, std::string const alt, double const epoch,
333  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
334 
335  virtual Coord::Ptr clone() const { return TopocentricCoord::Ptr(new TopocentricCoord(*this)); }
336 
337  virtual std::pair<std::string, std::string> getCoordNames() const {
338  return std::pair<std::string, std::string>("Az", "Alt");
339  }
342  std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
343  std::string getAltitudeStr() const { return getLatitudeStr(); }
344 
345  virtual Fk5Coord toFk5(double const epoch) const;
346  virtual Fk5Coord toFk5() const;
347  virtual TopocentricCoord toTopocentric(Observatory const &obs,
348  lsst::daf::base::DateTime const &date) const;
349  virtual TopocentricCoord toTopocentric() const;
350 
351 private:
353 };
354 
355 
356 /*
357  * Factory Functions
358  *
359  */
360 Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch);
361 Coord::Ptr makeCoord(CoordSystem const system, std::string const ra, std::string const dec,
362  double const epoch);
364  double const epoch);
365 Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Point3D const &p3d, double const epoch,
366  bool normalize=true,
367  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
368 Coord::Ptr makeCoord(CoordSystem const system);
369 
371 Coord::Ptr makeCoord(CoordSystem const system, std::string const ra, std::string const dec);
374  bool normalize=true,
375  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
376 
377 /*
378  * Utility functions
379  *
380  */
382 
383 lsst::afw::geom::Angle dmsStringToAngle(std::string const dms);
384 lsst::afw::geom::Angle hmsStringToAngle(std::string const hms);
385 std::string angleToDmsString(lsst::afw::geom::Angle const deg);
386 std::string angleToHmsString(lsst::afw::geom::Angle const deg);
387 
388 std::ostream & operator<<(std::ostream & os, Coord const & coord);
389 
390 }}}
391 
392 
393 /* ==============================================================
394  *
395  * Definitions of inline functions
396  *
397  * ============================================================== */
398 
399 
405 
406  switch (index) {
407  case 0:
408  return _longitude;
409  break;
410  case 1:
411  return _latitude;
412  break;
413  default:
414  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
415  "Index must be 0 or 1.");
416  break;
417  }
418 }
419 
430  if (unit == lsst::afw::geom::hours) {
431  return angleToHmsString(getLongitude());
432  } else if (unit == lsst::afw::geom::degrees) {
433  return angleToDmsString(getLongitude());
434  } else {
435  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
436  "Units must be 'degrees' or 'hours'");
437  }
438 }
446 inline std::string lsst::afw::coord::Coord::getLatitudeStr() const {
447  return angleToDmsString(getLatitude());
448 }
449 
454  return (_longitude == rhs._longitude) &&
455  (_latitude == rhs._latitude) &&
456  (_epoch == rhs._epoch);
457 }
458 
462 inline bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs) {
463  return !(lhs == rhs);
464 }
465 
466 #endif
virtual Fk5Coord toFk5() const
Convert ourself from Ecliptic to Fk5 (use current epoch)
Definition: Coord.cc:1096
GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:237
virtual IcrsCoord toIcrs() const
Icrs converter for IcrsCoord. (ie. a no-op)
Definition: Coord.cc:1016
boost::shared_ptr< Coord > Ptr
Definition: Coord.h:72
std::string getAltitudeStr() const
Definition: Coord.h:343
lsst::afw::geom::Angle getB() const
Definition: Coord.h:253
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
Definition: Coord.cc:811
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:192
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:288
lsst::afw::geom::Angle _longitude
Definition: Coord.h:144
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:798
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:171
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:996
A class to handle Galactic coordinates (inherits from Coord)
Definition: Coord.h:231
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:236
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:295
lsst::afw::geom::Angle hmsStringToAngle(std::string const hms)
Convert a hh:mm:ss string to Angle.
Definition: Coord.cc:334
virtual Fk5Coord toFk5() const
Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)
Definition: Coord.cc:844
Store information about an observatory ... lat/long, elevation.
Definition: Observatory.h:48
virtual Coord::Ptr clone() const
Definition: Coord.h:84
boost::shared_ptr< Fk5Coord > Ptr
Definition: Coord.h:190
boost::shared_ptr< TopocentricCoord > Ptr
Definition: Coord.h:322
lsst::afw::geom::Angle getAzimuth() const
Definition: Coord.h:340
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
Definition: Coord.h:429
bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs)
Inequality; the complement of equality.
Definition: Coord.h:462
EclipticCoord precess(double const epochTo) const
precess to new epoch
Definition: Coord.cc:1106
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
Definition: Coord.cc:1154
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:902
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:747
IcrsCoord(std::string const ra, std::string const dec)
Definition: Coord.h:163
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:946
lsst::afw::geom::Angle getLambda() const
Definition: Coord.h:298
virtual TopocentricCoord toTopocentric() const
Convert ourself from Topocentric to Topocentric with no observatory or date arguments.
Definition: Coord.cc:1184
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:440
lsst::afw::geom::Angle getAltitude() const
Definition: Coord.h:341
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getOffsetFrom(Coord const &c) const
Compute the offset from a coordinate.
Definition: Coord.cc:712
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:41
Class to hold observatory information.
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:852
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:194
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
Definition: Coord.cc:528
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:446
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
Definition: Coord.h:86
std::ostream & operator<<(std::ostream &os, Coord const &coord)
Definition: Coord.cc:1417
lsst::afw::geom::Angle _latitude
Definition: Coord.h:145
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:337
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:330
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:300
virtual Coord::Ptr clone() const
Definition: Coord.h:293
AngleUnit const degrees
Definition: Angle.h:92
std::string getBetaStr() const
Definition: Coord.h:301
virtual Fk5Coord toFk5() const
Convert ourself from galactic to Fk5 (no epoch specified)
Definition: Coord.cc:1048
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
Definition: Coord.h:319
boost::shared_ptr< IcrsCoord > Ptr
Definition: Coord.h:157
std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:342
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
Definition: Coord.cc:783
IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:160
GalacticCoord(std::string const l, std::string const b)
Definition: Coord.h:241
EclipticCoord(lsst::afw::geom::Angle const lamb, lsst::afw::geom::Angle const beta, double const epoch=2000.0)
Definition: Coord.h:285
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
Definition: Coord.cc:895
virtual Coord::Ptr clone() const
Definition: Coord.h:204
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:326
virtual Coord::Ptr clone() const
Definition: Coord.h:335
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:209
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:1210
EclipticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:275
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
Definition: Coord.h:453
lsst::afw::geom::Angle getBeta() const
Definition: Coord.h:299
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:292
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:565
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:299
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:172
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition: Coord.h:446
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:1032
A class to handle Fk5 coordinates (inherits from Coord)
Definition: Coord.h:187
A coordinate class intended to represent absolute positions.
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:210
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:867
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
A class to handle Ecliptic coordinates (inherits from Coord)
Definition: Coord.h:270
boost::shared_ptr< EclipticCoord > Ptr
Definition: Coord.h:273
double _epoch
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:97
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:208
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:111
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:791
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:332
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
Definition: Coord.h:240
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
Definition: Coord.h:404
afw::table::Key< double > b
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
Definition: Coord.h:162
virtual Coord::Ptr clone() const
Definition: Coord.h:244
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:116
std::string getDecStr() const
Definition: Coord.h:211
virtual Fk5Coord toFk5() const
Fk5 converter for IcrsCoord. (no epoch specified)
Definition: Coord.cc:1009
lsst::afw::geom::Angle getL() const
Definition: Coord.h:252
virtual GalacticCoord toGalactic() const
Convert ourself from Galactic to Galactic ... a no-op.
Definition: Coord.cc:1055
Coord::Ptr convert(CoordSystem system) const
Convert to a specified Coord type.
Definition: Coord.cc:636
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:490
virtual Coord::Ptr clone() const
Definition: Coord.h:166
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
Definition: Coord.h:198
std::string getBStr() const
Definition: Coord.h:255
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:118
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:279
Fk5Coord(std::string const ra, std::string const dec, double const epoch=2000.0)
Definition: Coord.h:200
std::string getDecStr() const
Definition: Coord.h:173
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:170
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:155
lsst::afw::geom::Angle dmsStringToAngle(std::string const dms)
Convert a dd:mm:ss string to Angle.
Definition: Coord.cc:343
Vector beta
boost::shared_ptr< GalacticCoord > Ptr
Definition: Coord.h:234
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:248
virtual EclipticCoord toEcliptic() const
Convert ourself from Ecliptic to Ecliptic ... a no-op (use the current epoch)
Definition: Coord.cc:1077
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:254
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:476
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:324
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
Definition: Coord.cc:353
IcrsCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:159
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
Definition: Coord.cc:506
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
Definition: Coord.cc:688
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:818