LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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"
43 #include "lsst/afw/coord/Utils.h"
45 #include "lsst/daf/base.h"
46 
47 namespace lsst {
48 namespace afw {
49 namespace coord {
50 
51 
52 /*
53  * Information about the coordinate system we support
54  */
56 CoordSystem makeCoordEnum(std::string const system);
57 
58 class IcrsCoord;
59 class Fk5Coord;
60 class GalacticCoord;
61 class EclipticCoord;
62 class TopocentricCoord;
63 
64 
70 class Coord {
71 public:
72 
73  typedef boost::shared_ptr<Coord> Ptr;
74  typedef boost::shared_ptr<Coord const> ConstPtr;
75 
76  Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit = lsst::afw::geom::degrees, double const epoch = 2000.0);
77  Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
78  bool normalize=true,
79  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.));
80  Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0);
81  Coord(std::string const ra, std::string const dec, double const epoch = 2000.0);
82  Coord();
83  virtual ~Coord() {}
84 
85  virtual Coord::Ptr clone() const { return Coord::Ptr(new Coord(*this)); }
86 
87  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude) {
88  double const epoch = 2000.0;
89  reset(longitude, latitude, epoch);
90  }
91  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude,
92  double const epoch);
93 
94  double getEpoch() const { return _epoch; }
95 
98  virtual std::pair<std::string, std::string> getCoordNames() const {
99  return std::pair<std::string, std::string>("RA", "Dec");
100  }
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  Coord::Ptr convert(CoordSystem system) 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:
147  double _epoch;
148 
149  void _verifyValues() const;
150 };
151 
156 class IcrsCoord : public Coord {
157 public:
158  typedef boost::shared_ptr<IcrsCoord> Ptr;
159 
161  IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.)) :
162  Coord(p3d, 2000.0, normalize, defaultLongitude) {}
163  IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec) : Coord(ra, dec, 2000.0) {}
164  IcrsCoord(std::string const ra, std::string const dec) : Coord(ra, dec, 2000.0) {}
165  IcrsCoord() : Coord() {}
166 
167  virtual Coord::Ptr clone() const { return IcrsCoord::Ptr(new IcrsCoord(*this)); }
168 
169  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude);
170 
173  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
174  std::string getDecStr() const { return getLatitudeStr(); }
175 
176  virtual Fk5Coord toFk5(double const epoch) const;
177  virtual Fk5Coord toFk5() const;
178  virtual IcrsCoord toIcrs() const;
179 
180 private:
181 };
182 
183 
188 class Fk5Coord : public Coord {
189 public:
190 
191  typedef boost::shared_ptr<Fk5Coord> Ptr;
192 
194  Coord(p2d, unit, epoch) {}
195  Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
196  bool normalize=true,
197  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
198  Coord(p3d, epoch, normalize, defaultLongitude) {}
199  Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0) :
200  Coord(ra, dec, epoch) {}
201  Fk5Coord(std::string const ra, std::string const dec, double const epoch = 2000.0) :
202  Coord(ra, dec, epoch) {}
203  Fk5Coord() : Coord() {}
204 
205  virtual Coord::Ptr clone() const { return Fk5Coord::Ptr(new Fk5Coord(*this)); }
206 
207  Fk5Coord precess(double const epochTo) const;
208 
211  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
212  std::string getDecStr() const { return getLatitudeStr(); }
213 
214  virtual Fk5Coord toFk5(double const epoch) const;
215  virtual Fk5Coord toFk5() const;
216  virtual IcrsCoord toIcrs() const;
217  virtual GalacticCoord toGalactic() const;
218  virtual EclipticCoord toEcliptic(double const epoch) const;
219  virtual EclipticCoord toEcliptic() const;
220  virtual TopocentricCoord toTopocentric(Observatory const &obs,
221  lsst::daf::base::DateTime const &obsDate) const;
222 
223 
224 private:
225 };
226 
227 
232 class GalacticCoord : public Coord {
233 public:
234 
235  typedef boost::shared_ptr<GalacticCoord> Ptr;
236 
239  bool normalize=true, lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
240  Coord(p3d, normalize, defaultLongitude) {}
242  GalacticCoord(std::string const l, std::string const b) : Coord(l, b) {}
244 
245  virtual Coord::Ptr clone() const { return GalacticCoord::Ptr(new GalacticCoord(*this)); }
246 
247  virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude);
248 
249  virtual std::pair<std::string, std::string> getCoordNames() const {
250  return std::pair<std::string, std::string>("L", "B");
251  }
252 
253  lsst::afw::geom::Angle getL() const { return getLongitude(); }
254  lsst::afw::geom::Angle getB() const { return getLatitude(); }
255  std::string getLStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
256  std::string getBStr() const { return getLatitudeStr(); }
257 
258  virtual Fk5Coord toFk5(double const epoch) const;
259  virtual Fk5Coord toFk5() const ;
260  virtual GalacticCoord toGalactic() const;
261 
262 private:
263 };
264 
265 
266 
271 class EclipticCoord : public Coord {
272 public:
273 
274  typedef boost::shared_ptr<EclipticCoord> Ptr;
275 
278  double const epoch = 2000.0) :
279  Coord(p2d, unit, epoch) {}
280  EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0,
281  bool normalize=true,
282  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
283  Coord(p3d, epoch, normalize, defaultLongitude) {}
284 
285  // note the abbreviation of lambda -> lamd to avoid swig warnings for python keyword 'lambda'
287  double const epoch = 2000.0) :
288  Coord(lamb, beta, epoch) {}
289  EclipticCoord(std::string const lamb, std::string const beta, double const epoch = 2000.0) :
290  Coord(lamb, beta, epoch) {}
291 
293 
294  virtual Coord::Ptr clone() const { return EclipticCoord::Ptr(new EclipticCoord(*this)); }
295 
296  virtual std::pair<std::string, std::string> getCoordNames() const {
297  return std::pair<std::string, std::string>("Lambda", "Beta");
298  }
301  std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
302  std::string getBetaStr() const { return getLatitudeStr(); }
303 
304 
305  virtual Fk5Coord toFk5(double const epoch) const;
306  virtual Fk5Coord toFk5() const;
307  virtual EclipticCoord toEcliptic(double const epoch) const;
308  virtual EclipticCoord toEcliptic() const;
309 
310  EclipticCoord precess(double const epochTo) const;
311 
312 private:
313 };
314 
315 
320 class TopocentricCoord : public Coord {
321 public:
322 
323  typedef boost::shared_ptr<TopocentricCoord> Ptr;
324 
326  Observatory const &obs) : Coord(p2d, unit, epoch), _obs(obs) {}
327  TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch,
328  Observatory const &obs, bool normalize=true,
329  lsst::afw::geom::Angle const defaultLongitude= lsst::afw::geom::Angle(0.)) :
330  Coord(p3d, epoch, normalize, defaultLongitude), _obs(obs) {}
331  TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch,
332  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
333  TopocentricCoord(std::string const az, std::string const alt, double const epoch,
334  Observatory const &obs) : Coord(az, alt, epoch), _obs(obs) {}
335 
336  virtual Coord::Ptr clone() const { return TopocentricCoord::Ptr(new TopocentricCoord(*this)); }
337 
338  virtual std::pair<std::string, std::string> getCoordNames() const {
339  return std::pair<std::string, std::string>("Az", "Alt");
340  }
343  std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
344  std::string getAltitudeStr() const { return getLatitudeStr(); }
345 
346  virtual Fk5Coord toFk5(double const epoch) const;
347  virtual Fk5Coord toFk5() const;
348  virtual TopocentricCoord toTopocentric(Observatory const &obs,
349  lsst::daf::base::DateTime const &date) const;
350  virtual TopocentricCoord toTopocentric() const;
351 
352 private:
354 };
355 
356 
357 /*
358  * Factory Functions
359  *
360  */
361 Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch);
362 Coord::Ptr makeCoord(CoordSystem const system, std::string const ra, std::string const dec,
363  double const epoch);
365  double const epoch);
366 Coord::Ptr makeCoord(CoordSystem const system, lsst::afw::geom::Point3D const &p3d, double const epoch,
367  bool normalize=true,
368  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
369 Coord::Ptr makeCoord(CoordSystem const system);
370 
372 Coord::Ptr makeCoord(CoordSystem const system, std::string const ra, std::string const dec);
375  bool normalize=true,
376  lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.));
377 
378 /*
379  * Utility functions
380  *
381  */
383 
384 lsst::afw::geom::Angle dmsStringToAngle(std::string const dms);
385 lsst::afw::geom::Angle hmsStringToAngle(std::string const hms);
386 std::string angleToDmsString(lsst::afw::geom::Angle const deg);
387 std::string angleToHmsString(lsst::afw::geom::Angle const deg);
388 
389 std::ostream & operator<<(std::ostream & os, Coord const & coord);
390 
391 }}}
392 
393 
394 /* ==============================================================
395  *
396  * Definitions of inline functions
397  *
398  * ============================================================== */
399 
400 
406 
407  switch (index) {
408  case 0:
409  return _longitude;
410  break;
411  case 1:
412  return _latitude;
413  break;
414  default:
415  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
416  "Index must be 0 or 1.");
417  break;
418  }
419 }
420 
431  if (unit == lsst::afw::geom::hours) {
432  return angleToHmsString(getLongitude());
433  } else if (unit == lsst::afw::geom::degrees) {
434  return angleToDmsString(getLongitude());
435  } else {
436  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError,
437  "Units must be 'degrees' or 'hours'");
438  }
439 }
447 inline std::string lsst::afw::coord::Coord::getLatitudeStr() const {
448  return angleToDmsString(getLatitude());
449 }
450 
455  return (_longitude == rhs._longitude) &&
456  (_latitude == rhs._latitude) &&
457  (_epoch == rhs._epoch);
458 }
459 
460 #endif
GalacticCoord(std::string const l, std::string const b)
Definition: Coord.h:242
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
AngleUnit const hours
Definition: Angle.h:93
virtual Coord::Ptr clone() const
Definition: Coord.h:294
boost::shared_ptr< Coord const > ConstPtr
Definition: Coord.h:74
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:276
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
Definition: Coord.cc:783
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
Definition: Coord.h:430
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
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:58
lsst::afw::geom::Angle getL() const
Definition: Coord.h:253
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:333
A class to handle Galactic coordinates (inherits from Coord)
Definition: Coord.h:232
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:334
std::string getAltitudeStr() const
Definition: Coord.h:344
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
Definition: Coord.cc:688
lsst::afw::geom::Angle getAltitude() const
Definition: Coord.h:342
lsst::afw::geom::Angle getAzimuth() const
Definition: Coord.h:341
boost::shared_ptr< Coord > Ptr
Definition: Coord.h:73
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
Store information about an observatory ... lat/long, elevation.
Definition: Observatory.h:49
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:867
lsst::afw::geom::Angle getBeta() const
Definition: Coord.h:300
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
Definition: Coord.h:163
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:280
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:171
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:112
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
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:798
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:286
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:852
GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:238
Fk5Coord(std::string const ra, std::string const dec, double const epoch=2000.0)
Definition: Coord.h:201
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:331
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
Definition: Coord.h:199
Class to hold observatory information.
A class used to convert scalar POD types such as double to Angle.
Definition: Angle.h:71
std::string getBetaStr() const
Definition: Coord.h:302
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:211
EclipticCoord(std::string const lamb, std::string const beta, double const epoch=2000.0)
Definition: Coord.h:289
virtual Fk5Coord toFk5() const
Convert ourself from galactic to Fk5 (no epoch specified)
Definition: Coord.cc:1048
IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:161
virtual ~Coord()
Definition: Coord.h:83
std::ostream & operator<<(std::ostream &os, Coord const &coord)
Definition: Coord.cc:1417
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::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:343
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:946
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:98
Coord::Ptr convert(CoordSystem system) const
Convert to a specified Coord type.
Definition: Coord.cc:636
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:325
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
Definition: Coord.h:320
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
Definition: Coord.cc:528
boost::shared_ptr< EclipticCoord > Ptr
Definition: Coord.h:274
Vector beta
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:36
boost::shared_ptr< TopocentricCoord > Ptr
Definition: Coord.h:323
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
lsst::afw::geom::Point3D getVector() const
Return our contents in a position vector.
Definition: Coord.cc:490
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:173
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:338
IcrsCoord(std::string const ra, std::string const dec)
Definition: Coord.h:164
std::string getDecStr() const
Definition: Coord.h:212
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
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:193
virtual TopocentricCoord toTopocentric() const
Convert ourself from Topocentric to Topocentric with no observatory or date arguments.
Definition: Coord.cc:1184
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
Definition: Coord.cc:1154
std::string getBStr() const
Definition: Coord.h:256
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
Definition: Coord.h:454
virtual Coord::Ptr clone() const
Definition: Coord.h:205
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:327
Header to declare constants and enums for Coord and Observatory.
virtual Fk5Coord toFk5() const
Convert ourself to Fk5 (ie. a no-op): RA, Dec (keep current epoch)
Definition: Coord.cc:844
virtual IcrsCoord toIcrs() const
Icrs converter for IcrsCoord. (ie. a no-op)
Definition: Coord.cc:1016
boost::shared_ptr< Fk5Coord > Ptr
Definition: Coord.h:191
virtual Fk5Coord toFk5() const
Convert ourself from Ecliptic to Fk5 (use current epoch)
Definition: Coord.cc:1096
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
lsst::afw::geom::Angle getB() const
Definition: Coord.h:254
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
virtual EclipticCoord toEcliptic() const
Convert ourself from Ecliptic to Ecliptic ... a no-op (use the current epoch)
Definition: Coord.cc:1077
boost::shared_ptr< IcrsCoord > Ptr
Definition: Coord.h:158
A class to handle Fk5 coordinates (inherits from Coord)
Definition: Coord.h:188
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
Definition: Coord.h:241
virtual Coord::Ptr clone() const
Definition: Coord.h:167
void _verifyValues() const
Make sure the values we&#39;ve got are in the range 0 &lt;= x &lt; 2PI.
Definition: Coord.cc:446
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
A class to handle Ecliptic coordinates (inherits from Coord)
Definition: Coord.h:271
double getEpoch() const
Definition: Coord.h:94
EclipticCoord precess(double const epochTo) const
precess to new epoch
Definition: Coord.cc:1106
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
Definition: Coord.h:87
double _epoch
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:249
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition: Coord.h:447
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:440
virtual Coord::Ptr clone() const
Definition: Coord.h:336
std::string getDecStr() const
Definition: Coord.h:174
virtual Fk5Coord toFk5() const
Fk5 converter for IcrsCoord. (no epoch specified)
Definition: Coord.cc:1009
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:818
boost::shared_ptr< GalacticCoord > Ptr
Definition: Coord.h:235
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:210
afw::table::Key< double > b
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
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
Definition: Coord.cc:811
AngleUnit const degrees
Definition: Angle.h:92
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
Definition: Coord.cc:895
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:791
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:160
lsst::afw::geom::Angle getLambda() const
Definition: Coord.h:299
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:209
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:237
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:255
virtual Coord::Ptr clone() const
Definition: Coord.h:245
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:343
virtual Coord::Ptr clone() const
Definition: Coord.h:85
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
Definition: Coord.h:405
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:296
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:172
virtual GalacticCoord toGalactic() const
Convert ourself from Galactic to Galactic ... a no-op.
Definition: Coord.cc:1055
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
Definition: Coord.cc:353
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:301
Coord transform(Coord const &poleFrom, Coord const &poleTo) const
Tranform our current coords to another spherical polar system.
Definition: Coord.cc:506
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:195