LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
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 #include <memory>
39 
40 #include "lsst/base.h"
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  Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit = lsst::afw::geom::degrees, double const epoch = 2000.0);
73  Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
74  bool normalize=true,
75  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.));
76  Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0);
77  Coord(std::string const ra, std::string const dec, double const epoch = 2000.0);
78  Coord();
79  virtual ~Coord() {}
80 
81  virtual PTR(Coord) clone() const { return PTR(Coord)(new Coord(*this)); }
82 
84  double const epoch = 2000.0;
85  reset(longitude, latitude, epoch);
86  }
88  double const epoch);
89 
90  double getEpoch() const { return _epoch; }
91 
94  virtual std::pair<std::string, std::string> getCoordNames() const {
95  return std::pair<std::string, std::string>("RA", "Dec");
96  }
97 
98  virtual std::string getClassName() const { return "Coord"; }
99 
100  virtual CoordSystem getCoordSystem() const { return UNKNOWN; }
101 
102  // These are inline functions and are defined at the end of this header file
103  lsst::afw::geom::Angle operator[](int const index) const;
104  bool operator==(Coord const &rhs) const;
112  inline lsst::afw::geom::Angle getLongitude() const { return _longitude; };
119  inline lsst::afw::geom::Angle getLatitude() const { return _latitude; };
120  inline std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const;
121  inline std::string getLatitudeStr() const;
122 
123 
124  Coord transform(Coord const &poleFrom, Coord const &poleTo) const;
126 
127  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getOffsetFrom(Coord const &c) const;
128  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getTangentPlaneOffset(Coord const &c) const;
129 
130  void rotate(Coord const &axis, lsst::afw::geom::Angle const theta);
132 
133  PTR(Coord) convert(CoordSystem system, double epoch=2000) const;
134 
135  virtual Fk5Coord toFk5(double const epoch) const;
136  virtual Fk5Coord toFk5() const;
137  virtual IcrsCoord toIcrs() const;
138  virtual GalacticCoord toGalactic() const;
139  virtual EclipticCoord toEcliptic(double const epoch) const;
140  virtual EclipticCoord toEcliptic() const;
141  virtual TopocentricCoord toTopocentric(Observatory const &obs,
142  lsst::daf::base::DateTime const &obsDate) const;
143 
144 private:
145  lsst::afw::geom::Angle _longitude;
146  lsst::afw::geom::Angle _latitude;
147  double _epoch;
148 
149  void _verifyValues() const;
150 };
151 
156 class IcrsCoord : public Coord {
157 public:
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 PTR(Coord) clone() const { return PTR(IcrsCoord)(new IcrsCoord(*this)); }
167 
168  virtual std::string getClassName() const { return "IcrsCoord"; }
169 
170  virtual CoordSystem getCoordSystem() const { return ICRS; }
171 
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 
195  Coord(p2d, unit, epoch) {}
196  Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
197  bool normalize=true,
198  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
199  Coord(p3d, epoch, normalize, defaultLongitude) {}
200  Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0) :
201  Coord(ra, dec, epoch) {}
202  Fk5Coord(std::string const ra, std::string const dec, double const epoch = 2000.0) :
203  Coord(ra, dec, epoch) {}
204  Fk5Coord() : Coord() {}
205 
206  virtual PTR(Coord) clone() const { return PTR(Fk5Coord)(new Fk5Coord(*this)); }
207 
208  virtual std::string getClassName() const { return "Fk5Coord"; }
209 
210  virtual CoordSystem getCoordSystem() const { return FK5; }
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 
242  bool normalize=true, lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
243  Coord(p3d, normalize, defaultLongitude) {}
245  GalacticCoord(std::string const l, std::string const b) : Coord(l, b) {}
246  GalacticCoord() : Coord() {}
247 
248  virtual PTR(Coord) clone() const { return PTR(GalacticCoord)(new GalacticCoord(*this)); }
249 
250  virtual std::string getClassName() const { return "GalacticCoord"; }
251 
252  virtual CoordSystem getCoordSystem() const { return GALACTIC; }
253 
255 
256  virtual std::pair<std::string, std::string> getCoordNames() const {
257  return std::pair<std::string, std::string>("L", "B");
258  }
259 
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 
283  double const epoch = 2000.0) :
284  Coord(p2d, unit, epoch) {}
285  EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
286  bool normalize=true,
287  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
288  Coord(p3d, epoch, normalize, defaultLongitude) {}
289 
290  // note the abbreviation of lambda -> lamd to avoid swig warnings for python keyword 'lambda'
292  double const epoch = 2000.0) :
293  Coord(lamb, beta, epoch) {}
294  EclipticCoord(std::string const lamb, std::string const beta, double const epoch = 2000.0) :
295  Coord(lamb, beta, epoch) {}
296 
297  EclipticCoord() : Coord() {}
298 
299  virtual PTR(Coord) clone() const { return PTR(EclipticCoord)(new EclipticCoord(*this)); }
300 
301  virtual std::string getClassName() const { return "EclipticCoord"; }
302 
303  virtual CoordSystem getCoordSystem() const { return ECLIPTIC; }
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 
333  Observatory const &obs) : Coord(p2d, unit, epoch), _obs(obs) {}
334  TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch,
335  Observatory const &obs, bool normalize=true,
336  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
337  Coord(p3d, epoch, normalize, defaultLongitude), _obs(obs) {}
338  TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch,
339  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
340  TopocentricCoord(std::string const az, std::string const alt, double const epoch,
341  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
342 
343  virtual PTR(Coord) clone() const { return PTR(TopocentricCoord)(new TopocentricCoord(*this)); }
344 
345  virtual std::string getClassName() const { return "TopocentricCoord"; }
346 
347  virtual CoordSystem getCoordSystem() const { return TOPOCENTRIC; }
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 PTR(Coord) makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch);
375 PTR(Coord) makeCoord(CoordSystem const system, std::string const ra, std::string const dec,
376  double const epoch);
377 PTR(Coord) makeCoord(CoordSystem const system, lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit,
378  double const epoch);
379 PTR(Coord) 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 PTR(Coord) makeCoord(CoordSystem const system);
383 
384 PTR(Coord) makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec);
385 PTR(Coord) makeCoord(CoordSystem const system, std::string const ra, std::string const dec);
386 PTR(Coord) makeCoord(CoordSystem const system, lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit);
387 PTR(Coord) makeCoord(CoordSystem const system, lsst::afw::geom::Point3D const &p3d,
388  bool normalize=true,
389  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
390 
402 PTR(Coord) averageCoord(
403  std::vector<PTR(Coord const)> const coords,
404  CoordSystem system=UNKNOWN
405  );
406 
407 /*
408  * Utility functions
409  *
410  */
411 lsst::afw::geom::Angle eclipticPoleInclination(double const epoch);
412 
413 lsst::afw::geom::Angle dmsStringToAngle(std::string const dms);
414 lsst::afw::geom::Angle hmsStringToAngle(std::string const hms);
415 std::string angleToDmsString(lsst::afw::geom::Angle const deg);
416 std::string angleToHmsString(lsst::afw::geom::Angle const deg);
417 
418 std::ostream & operator<<(std::ostream & os, Coord const & coord);
419 
420 }}}
421 
422 
423 /* ==============================================================
424  *
425  * Definitions of inline functions
426  *
427  * ============================================================== */
428 
429 
434 inline lsst::afw::geom::Angle lsst::afw::coord::Coord::operator[](int const index) const {
435 
436  switch (index) {
437  case 0:
438  return _longitude;
439  break;
440  case 1:
441  return _latitude;
442  break;
443  default:
444  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
445  "Index must be 0 or 1.");
446  break;
447  }
448 }
449 
460  if (unit == lsst::afw::geom::hours) {
461  return angleToHmsString(getLongitude());
462  } else if (unit == lsst::afw::geom::degrees) {
463  return angleToDmsString(getLongitude());
464  } else {
465  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
466  "Units must be 'degrees' or 'hours'");
467  }
468 }
476 inline std::string lsst::afw::coord::Coord::getLatitudeStr() const {
477  return angleToDmsString(getLatitude());
478 }
479 
484  return (_longitude == rhs._longitude) &&
485  (_latitude == rhs._latitude) &&
486  (_epoch == rhs._epoch);
487 }
488 
492 inline bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs) {
493  return !(lhs == rhs);
494 }
495 
496 #endif
virtual std::string getClassName() const
Definition: Coord.h:345
GalacticCoord(std::string const l, std::string const b)
Definition: Coord.h:245
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
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:100
A coordinate class intended to represent absolute positions.
EclipticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:281
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
Definition: Coord.cc:793
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
Definition: Coord.h:459
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:62
lsst::afw::geom::Angle getL() const
Definition: Coord.h:260
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:340
A class to handle Galactic coordinates (inherits from Coord)
Definition: Coord.h:237
lsst::afw::geom::Angle _latitude
Definition: Coord.h:146
lsst::afw::geom::Angle hmsStringToAngle(std::string const hms)
Convert a hh:mm:ss string to Angle.
Definition: Coord.cc:335
std::string getAltitudeStr() const
Definition: Coord.h:357
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
Definition: Coord.cc:698
lsst::afw::geom::Angle getAltitude() const
Definition: Coord.h:355
lsst::afw::geom::Angle getAzimuth() const
Definition: Coord.h:354
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getOffsetFrom(Coord const &c) const
Compute the offset from a coordinate.
Definition: Coord.cc:722
Hold the location of an observatory.
Definition: Observatory.h:47
lsst::afw::geom::Angle getBeta() const
Definition: Coord.h:309
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
Definition: Coord.h:162
bool operator!=(lsst::afw::coord::Coord const &lhs, lsst::afw::coord::Coord const &rhs)
Inequality; the complement of equality.
Definition: Coord.h:492
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:285
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:174
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:112
AngleUnit const hours
Definition: Angle.h:92
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:808
lsst::afw::geom::Angle _longitude
Definition: Coord.h:145
EclipticCoord(lsst::afw::geom::Angle const lamb, lsst::afw::geom::Angle const beta, double const epoch=2000.0)
Definition: Coord.h:291
GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:241
Fk5Coord(std::string const ra, std::string const dec, double const epoch=2000.0)
Definition: Coord.h:202
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:338
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
Definition: Coord.h:200
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:37
Class to hold observatory/telescope location.
table::Key< geom::Angle > latitude
Definition: VisitInfo.cc:172
A class used to convert scalar POD types such as double to Angle.
Definition: Angle.h:70
std::string getBetaStr() const
Definition: Coord.h:311
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:216
EclipticCoord(std::string const lamb, std::string const beta, double const epoch=2000.0)
Definition: Coord.h:294
virtual std::string getClassName() const
Definition: Coord.h:208
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
virtual ~Coord()
Definition: Coord.h:79
virtual std::string getClassName() const
Definition: Coord.h:168
std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:356
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:94
virtual std::string getClassName() const
Definition: Coord.h:301
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:332
AngleUnit const degrees
Definition: Angle.h:91
A class representing an Angle.
Definition: Angle.h:103
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
Definition: Coord.h:329
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
Definition: Coord.cc:529
table::Key< geom::Angle > longitude
Definition: VisitInfo.cc:173
boost::shared_ptr< Coord > averageCoord(std::vector< boost::shared_ptr< Coord const >> const coords, CoordSystem system=UNKNOWN)
Return average of a list of coordinates.
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:757
lsst::afw::geom::Point3D getVector() const
Return our contents in a position vector.
Definition: Coord.cc:491
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:176
virtual boost::shared_ptr< Coord > clone() const
Definition: Coord.h:81
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:351
IcrsCoord(std::string const ra, std::string const dec)
Definition: Coord.h:163
std::string getDecStr() const
Definition: Coord.h:217
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:194
std::string getBStr() const
Definition: Coord.h:263
virtual std::string getClassName() const
Definition: Coord.h:250
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
Definition: Coord.h:483
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:334
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
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:252
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
lsst::afw::geom::Angle getB() const
Definition: Coord.h:261
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
boost::shared_ptr< Coord > convert(CoordSystem system, double epoch=2000) const
Convert to a specified Coord type at a specified epoch.
Definition: Coord.cc:642
Point< double, 3 > Point3D
Definition: Point.h:289
A class to handle Fk5 coordinates (inherits from Coord)
Definition: Coord.h:191
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
Definition: Coord.h:244
void _verifyValues() const
Make sure the values we&#39;ve got are in the range 0 &lt;= x &lt; 2PI.
Definition: Coord.cc:447
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
A class to handle Ecliptic coordinates (inherits from Coord)
Definition: Coord.h:278
Observatory getObservatory() const
Definition: Coord.h:349
double getEpoch() const
Definition: Coord.h:90
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
Definition: Coord.h:83
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:256
lsst::afw::geom::Angle Angle
Definition: misc.h:38
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition: Coord.h:476
#define PTR(...)
Definition: base.h:41
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:441
std::string getDecStr() const
Definition: Coord.h:177
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:828
boost::shared_ptr< Coord > 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:1220
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:215
afw::table::Key< double > b
Point< double, 2 > Point2D
Definition: Point.h:288
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
virtual std::string getClassName() const
Definition: Coord.h:98
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
Definition: Coord.cc:821
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:303
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:210
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:801
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:119
IcrsCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:159
lsst::afw::geom::Angle getLambda() const
Definition: Coord.h:308
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:170
Basic LSST definitions.
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:214
This is the base class for spherical coordinates.
Definition: Coord.h:69
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:240
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:262
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:156
lsst::afw::geom::Angle dmsStringToAngle(std::string const dms)
Convert a dd:mm:ss string to Angle.
Definition: Coord.cc:344
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
Definition: Coord.h:434
Vector beta
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:305
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:175
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
Definition: Coord.cc:354
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:310
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
Definition: Coord.cc:507
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:347
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:196