lsst.afw  13.0-73-gb2a4e38
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 /*
28  * Functions to handle coordinates
29  */
30 #include <iostream>
31 #include <limits>
32 #include <map>
33 #include <memory>
34 
35 #include "lsst/base.h"
36 #include "lsst/afw/geom/Point.h"
37 #include "lsst/afw/geom/Angle.h"
39 #include "lsst/daf/base.h"
40 
41 namespace lsst {
42 namespace afw {
43 namespace coord {
44 
45 /*
46  * Information about the coordinate system we support
47  */
52 CoordSystem makeCoordEnum(std::string const system);
53 
54 class IcrsCoord;
55 class Fk5Coord;
56 class GalacticCoord;
57 class EclipticCoord;
58 class TopocentricCoord;
59 
63 class Coord {
64 public:
73  double const epoch = 2000.0);
82  Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0, bool normalize = true,
83  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.));
91  Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0);
99  Coord(std::string const ra, std::string const dec, double const epoch = 2000.0);
107  Coord();
108  virtual ~Coord() {}
109 
110  virtual std::shared_ptr<Coord> clone() const { return std::shared_ptr<Coord>(new Coord(*this)); }
111 
113  double const epoch = 2000.0;
114  reset(longitude, latitude, epoch);
115  }
126  double const epoch);
127 
128  double getEpoch() const { return _epoch; }
129 
140  virtual std::pair<std::string, std::string> getCoordNames() const {
141  return std::pair<std::string, std::string>("RA", "Dec");
142  }
143 
144  virtual std::string getClassName() const { return "Coord"; }
145 
146  virtual CoordSystem getCoordSystem() const { return UNKNOWN; }
147 
151  virtual std::string toString() const;
152 
153  // These are inline functions and are defined at the end of this header file
154  lsst::afw::geom::Angle operator[](int const index) const;
155  bool operator==(Coord const &rhs) const;
163  inline lsst::afw::geom::Angle getLongitude() const { return _longitude; };
170  inline lsst::afw::geom::Angle getLatitude() const { return _latitude; };
171  inline std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const;
172  inline std::string getLatitudeStr() const;
173 
183  Coord transform(Coord const &poleTo, Coord const &poleFrom) const;
190 
199  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getOffsetFrom(Coord const &c) const;
208  std::pair<lsst::afw::geom::Angle, lsst::afw::geom::Angle> getTangentPlaneOffset(Coord const &c) const;
209 
216  void rotate(Coord const &axis, lsst::afw::geom::Angle const theta);
228 
238  std::shared_ptr<Coord> convert(CoordSystem system, double epoch = 2000) const;
239 
243  virtual Fk5Coord toFk5(double const epoch) const;
247  virtual Fk5Coord toFk5() const;
252  virtual IcrsCoord toIcrs() const;
256  virtual GalacticCoord toGalactic() const;
260  virtual EclipticCoord toEcliptic(double const epoch) const;
264  virtual EclipticCoord toEcliptic() const;
271  virtual TopocentricCoord toTopocentric(Observatory const &obs,
272  lsst::daf::base::DateTime const &obsDate) const;
273 
274 private:
275  lsst::afw::geom::Angle _longitude;
276  lsst::afw::geom::Angle _latitude;
277  double _epoch;
278 
282  void _verifyValues() const;
283 };
284 
288 class IcrsCoord : public Coord {
289 public:
291  : Coord(p2d, unit, 2000.0) {}
292  IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize = true,
293  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.))
294  : Coord(p3d, 2000.0, normalize, defaultLongitude) {}
295  IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec) : Coord(ra, dec, 2000.0) {}
296  IcrsCoord(std::string const ra, std::string const dec) : Coord(ra, dec, 2000.0) {}
297  IcrsCoord() : Coord() {}
298 
299  virtual std::shared_ptr<Coord> clone() const { return std::shared_ptr<IcrsCoord>(new IcrsCoord(*this)); }
300 
301  virtual std::string getClassName() const { return "IcrsCoord"; }
302 
303  virtual CoordSystem getCoordSystem() const { return ICRS; }
304 
308  virtual std::string toString() const;
309 
314 
317  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
318  std::string getDecStr() const { return getLatitudeStr(); }
319 
323  virtual Fk5Coord toFk5(double const epoch) const;
327  virtual Fk5Coord toFk5() const;
331  virtual IcrsCoord toIcrs() const;
332 
333 private:
334 };
335 
339 class Fk5Coord : public Coord {
340 public:
342  double const epoch = 2000.0)
343  : Coord(p2d, unit, epoch) {}
344  Fk5Coord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0, bool normalize = true,
345  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.))
346  : Coord(p3d, epoch, normalize, defaultLongitude) {}
347  Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch = 2000.0)
348  : Coord(ra, dec, epoch) {}
349  Fk5Coord(std::string const ra, std::string const dec, double const epoch = 2000.0)
350  : Coord(ra, dec, epoch) {}
351  Fk5Coord() : Coord() {}
352 
353  virtual std::shared_ptr<Coord> clone() const { return std::shared_ptr<Fk5Coord>(new Fk5Coord(*this)); }
354 
355  virtual std::string getClassName() const { return "Fk5Coord"; }
356 
357  virtual CoordSystem getCoordSystem() const { return FK5; }
358 
364  Fk5Coord precess(double const epochTo) const;
365 
368  std::string getRaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
369  std::string getDecStr() const { return getLatitudeStr(); }
370 
374  virtual Fk5Coord toFk5(double const epoch) const;
378  virtual Fk5Coord toFk5() const;
383  virtual IcrsCoord toIcrs() const;
387  virtual GalacticCoord toGalactic() const;
391  virtual EclipticCoord toEcliptic(double const epoch) const;
395  virtual EclipticCoord toEcliptic() const;
402  virtual TopocentricCoord toTopocentric(Observatory const &obs,
403  lsst::daf::base::DateTime const &obsDate) const;
404 
405 private:
406 };
407 
411 class GalacticCoord : public Coord {
412 public:
415  : Coord(p2d, unit) {}
416  GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize = true,
417  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.))
418  : Coord(p3d, normalize, defaultLongitude) {}
420  GalacticCoord(std::string const l, std::string const b) : Coord(l, b) {}
422 
423  virtual std::shared_ptr<Coord> clone() const {
424  return std::shared_ptr<GalacticCoord>(new GalacticCoord(*this));
425  }
426 
427  virtual std::string getClassName() const { return "GalacticCoord"; }
428 
429  virtual CoordSystem getCoordSystem() const { return GALACTIC; }
430 
434  virtual std::string toString() const;
435 
440 
441  virtual std::pair<std::string, std::string> getCoordNames() const {
442  return std::pair<std::string, std::string>("L", "B");
443  }
444 
447  std::string getLStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
448  std::string getBStr() const { return getLatitudeStr(); }
449 
453  virtual Fk5Coord toFk5(double const epoch) const;
457  virtual Fk5Coord toFk5() const;
461  virtual GalacticCoord toGalactic() const;
462 
463 private:
464 };
465 
469 class EclipticCoord : public Coord {
470 public:
472  lsst::afw::geom::AngleUnit unit = lsst::afw::geom::degrees, double const epoch = 2000.0)
473  : Coord(p2d, unit, epoch) {}
474  EclipticCoord(lsst::afw::geom::Point3D const &p3d, double const epoch = 2000.0, bool normalize = true,
475  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.))
476  : Coord(p3d, epoch, normalize, defaultLongitude) {}
477 
478  // note the abbreviation of lambda -> lamd to avoid swig warnings for python keyword 'lambda'
480  double const epoch = 2000.0)
481  : Coord(lamb, beta, epoch) {}
482  EclipticCoord(std::string const lamb, std::string const beta, double const epoch = 2000.0)
483  : Coord(lamb, beta, epoch) {}
484 
486 
487  virtual std::shared_ptr<Coord> clone() const {
488  return std::shared_ptr<EclipticCoord>(new EclipticCoord(*this));
489  }
490 
491  virtual std::string getClassName() const { return "EclipticCoord"; }
492 
493  virtual CoordSystem getCoordSystem() const { return ECLIPTIC; }
494 
495  virtual std::pair<std::string, std::string> getCoordNames() const {
496  return std::pair<std::string, std::string>("Lambda", "Beta");
497  }
500  std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
501  std::string getBetaStr() const { return getLatitudeStr(); }
502 
506  virtual Fk5Coord toFk5(double const epoch) const;
510  virtual Fk5Coord toFk5() const;
514  virtual EclipticCoord toEcliptic(double const epoch) const;
518  virtual EclipticCoord toEcliptic() const;
519 
527  EclipticCoord precess(double const epochTo) const;
528 
529 private:
530 };
531 
535 class TopocentricCoord : public Coord {
536 public:
538  Observatory const &obs)
539  : Coord(p2d, unit, epoch), _obs(obs) {}
540  TopocentricCoord(lsst::afw::geom::Point3D const &p3d, double const epoch, Observatory const &obs,
541  bool normalize = true,
542  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.))
543  : Coord(p3d, epoch, normalize, defaultLongitude), _obs(obs) {}
544  TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch,
545  Observatory const &obs)
546  : Coord(az, alt, epoch), _obs(obs) {}
547  TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
548  : Coord(az, alt, epoch), _obs(obs) {}
549 
550  virtual std::shared_ptr<Coord> clone() const {
551  return std::shared_ptr<TopocentricCoord>(new TopocentricCoord(*this));
552  }
553 
554  virtual std::string getClassName() const { return "TopocentricCoord"; }
555 
556  virtual CoordSystem getCoordSystem() const { return TOPOCENTRIC; }
557 
561  virtual std::string toString() const;
562 
563  Observatory getObservatory() const { return _obs; }
564 
565  virtual std::pair<std::string, std::string> getCoordNames() const {
566  return std::pair<std::string, std::string>("Az", "Alt");
567  }
570  std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const { return getLongitudeStr(unit); }
571  std::string getAltitudeStr() const { return getLatitudeStr(); }
572 
576  virtual Fk5Coord toFk5(double const epoch) const;
580  virtual Fk5Coord toFk5() const;
587  virtual TopocentricCoord toTopocentric(Observatory const &obs,
588  lsst::daf::base::DateTime const &date) const;
594  virtual TopocentricCoord toTopocentric() const;
595 
596 private:
597  Observatory _obs;
598 };
599 
600 /*
601  * Factory Functions
602  *
603  */
616 std::shared_ptr<Coord> makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra,
617  lsst::afw::geom::Angle const dec, double const epoch);
628 std::shared_ptr<Coord> makeCoord(CoordSystem const system, std::string const ra, std::string const dec,
629  double const epoch);
640 std::shared_ptr<Coord> makeCoord(CoordSystem const system, lsst::afw::geom::Point2D const &p2d,
641  lsst::afw::geom::AngleUnit unit, double const epoch);
654 std::shared_ptr<Coord> makeCoord(CoordSystem const system, lsst::afw::geom::Point3D const &p3d,
655  double const epoch, bool normalize = true,
656  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.));
662 std::shared_ptr<Coord> makeCoord(CoordSystem const system);
663 
674 std::shared_ptr<Coord> makeCoord(CoordSystem const system, lsst::afw::geom::Angle const ra,
675  lsst::afw::geom::Angle const dec);
685 std::shared_ptr<Coord> makeCoord(CoordSystem const system, std::string const ra, std::string const dec);
696 std::shared_ptr<Coord> makeCoord(CoordSystem const system, lsst::afw::geom::Point2D const &p2d,
709 std::shared_ptr<Coord> makeCoord(CoordSystem const system, lsst::afw::geom::Point3D const &p3d,
710  bool normalize = true,
711  lsst::afw::geom::Angle const defaultLongitude = lsst::afw::geom::Angle(0.));
712 
724 std::shared_ptr<Coord> averageCoord(std::vector<std::shared_ptr<Coord const>> const coords,
725  CoordSystem system = UNKNOWN);
726 
727 /*
728  * Utility functions
729  *
730  */
737 
743 lsst::afw::geom::Angle dmsStringToAngle(std::string const dms);
745 lsst::afw::geom::Angle hmsStringToAngle(std::string const hms);
751 std::string angleToDmsString(lsst::afw::geom::Angle const deg);
753 std::string angleToHmsString(lsst::afw::geom::Angle const deg);
754 
755 std::ostream &operator<<(std::ostream &os, Coord const &coord);
756 
757 /* ==============================================================
758  *
759  * Definitions of inline functions
760  *
761  * ============================================================== */
762 
767 inline geom::Angle Coord::operator[](int const index) const {
768  switch (index) {
769  case 0:
770  return _longitude;
771  break;
772  case 1:
773  return _latitude;
774  break;
775  default:
776  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError, "Index must be 0 or 1.");
777  break;
778  }
779 }
780 
790 inline std::string Coord::getLongitudeStr(geom::AngleUnit unit) const {
791  if (unit == lsst::afw::geom::hours) {
792  return angleToHmsString(getLongitude());
793  } else if (unit == lsst::afw::geom::degrees) {
794  return angleToDmsString(getLongitude());
795  } else {
796  throw LSST_EXCEPT(lsst::pex::exceptions::InvalidParameterError, "Units must be 'degrees' or 'hours'");
797  }
798 }
806 inline std::string Coord::getLatitudeStr() const { return angleToDmsString(getLatitude()); }
807 
811 inline bool Coord::operator==(Coord const &rhs) const {
812  return (_longitude == rhs._longitude) && (_latitude == rhs._latitude) && (_epoch == rhs._epoch);
813 }
814 
818 inline bool operator!=(Coord const &lhs, Coord const &rhs) { return !(lhs == rhs); }
819 }
820 }
821 }
822 
823 #endif
std::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:840
virtual std::string getClassName() const
Definition: Coord.h:554
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:599
GalacticCoord(std::string const l, std::string const b)
Definition: Coord.h:420
virtual std::shared_ptr< Coord > clone() const
Definition: Coord.h:353
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:146
EclipticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:471
std::string getLongitudeStr(lsst::afw::geom::AngleUnit unit) const
Allow quick access to the longitudinal coordinate as a string.
Definition: Coord.h:790
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:725
virtual Fk5Coord toFk5() const
Convert outself from Topocentric to Fk5 (use current epoch)
Definition: Coord.cc:801
lsst::afw::geom::Angle getL() const
Definition: Coord.h:445
lsst::afw::coord::Coord Coord
Definition: misc.h:33
virtual std::string toString() const
Get string representation.
Definition: Coord.cc:713
TopocentricCoord(std::string const az, std::string const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:547
table::Key< geom::Angle > longitude
Definition: VisitInfo.cc:166
A class to handle Galactic coordinates (inherits from Coord)
Definition: Coord.h:411
lsst::afw::geom::Angle dmsStringToAngle(std::string const dms)
Convert a dd:mm:ss string to Angle.
Definition: Coord.cc:284
bool operator!=(Coord const &lhs, Coord const &rhs)
Inequality; the complement of equality.
Definition: Coord.h:818
std::string getAltitudeStr() const
Definition: Coord.h:571
lsst::afw::geom::Angle getAltitude() const
Definition: Coord.h:569
lsst::afw::geom::Angle getAzimuth() const
Definition: Coord.h:568
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:621
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:537
Hold the location of an observatory.
Definition: Observatory.h:41
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:340
lsst::afw::geom::Angle getBeta() const
Definition: Coord.h:499
IcrsCoord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec)
Definition: Coord.h:295
virtual Fk5Coord toFk5() const
Convert ourself from Ecliptic to Fk5 (use current epoch)
Definition: Coord.cc:766
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:474
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:315
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition: Coord.h:163
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:403
virtual GalacticCoord toGalactic() const
Convert ourself to Galactic: l, b.
Definition: Coord.cc:568
AngleUnit constexpr degrees
constant with units of degrees
Definition: Angle.h:88
lsst::afw::geom::Angle eclipticPoleInclination(double const epoch)
get the inclination of the ecliptic pole (obliquity) at epoch
Definition: Coord.cc:286
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:702
EclipticCoord(lsst::afw::geom::Angle const lamb, lsst::afw::geom::Angle const beta, double const epoch=2000.0)
Definition: Coord.h:479
virtual std::string toString() const
Get string representation.
Definition: Coord.cc:821
virtual Fk5Coord toFk5() const
Convert ourself from galactic to Fk5 (no epoch specified)
Definition: Coord.cc:735
virtual Fk5Coord toFk5() const
Convert ourself to Fk5 (ie.
Definition: Coord.cc:587
virtual std::string toString() const
Get string representation.
Definition: Coord.cc:961
GalacticCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:416
virtual Fk5Coord toFk5() const
Convert ourself to Fk5: RA, Dec (use current epoch)
Definition: Coord.cc:564
Fk5Coord(std::string const ra, std::string const dec, double const epoch=2000.0)
Definition: Coord.h:349
TopocentricCoord(lsst::afw::geom::Angle const az, lsst::afw::geom::Angle const alt, double const epoch, Observatory const &obs)
Definition: Coord.h:544
Fk5Coord(lsst::afw::geom::Angle const ra, lsst::afw::geom::Angle const dec, double const epoch=2000.0)
Definition: Coord.h:347
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:589
A class used to convert scalar POD types such as double to Angle.
Definition: Angle.h:52
std::shared_ptr< Coord > convert(CoordSystem system, double epoch=2000) const
Convert to a specified Coord type at a specified epoch.
Definition: Coord.cc:465
std::string getBetaStr() const
Definition: Coord.h:501
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:368
EclipticCoord precess(double const epochTo) const
precess to new epoch
Definition: Coord.cc:768
EclipticCoord(std::string const lamb, std::string const beta, double const epoch=2000.0)
Definition: Coord.h:482
virtual TopocentricCoord toTopocentric() const
Convert ourself from Topocentric to Topocentric with no observatory or date arguments.
Definition: Coord.cc:817
virtual std::string getClassName() const
Definition: Coord.h:355
IcrsCoord(lsst::afw::geom::Point3D const &p3d, bool normalize=true, lsst::afw::geom::Angle const defaultLongitude=lsst::afw::geom::Angle(0.))
Definition: Coord.h:292
virtual ~Coord()
Definition: Coord.h:108
Coord transform(Coord const &poleTo, Coord const &poleFrom) const
Transform our current coords to another spherical polar system.
Definition: Coord.cc:358
std::ostream & operator<<(std::ostream &os, Coord const &coord)
Definition: Coord.cc:967
virtual std::string getClassName() const
Definition: Coord.h:301
std::string getAzimuthStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:570
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:140
virtual std::string getClassName() const
Definition: Coord.h:491
TopocentricCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit, double const epoch, Observatory const &obs)
Definition: Coord.h:537
A class representing an angle.
Definition: Angle.h:102
A class to handle topocentric (AltAz) coordinates (inherits from Coord)
Definition: Coord.h:535
void rotate(Coord const &axis, lsst::afw::geom::Angle const theta)
Rotate our current coords about a pole.
Definition: Coord.cc:376
lsst::afw::geom::Angle angularSeparation(Coord const &c) const
compute the angular separation between two Coords
Definition: Coord.cc:500
virtual std::shared_ptr< Coord > clone() const
Definition: Coord.h:487
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:35
table::Key< geom::Angle > latitude
Definition: VisitInfo.cc:165
std::string getRaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:317
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:565
IcrsCoord(std::string const ra, std::string const dec)
Definition: Coord.h:296
std::string getDecStr() const
Definition: Coord.h:369
virtual GalacticCoord toGalactic() const
Convert ourself from Galactic to Galactic ...
Definition: Coord.cc:737
Fk5Coord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees, double const epoch=2000.0)
Definition: Coord.h:341
std::string getBStr() const
Definition: Coord.h:448
virtual std::string getClassName() const
Definition: Coord.h:427
bool operator==(Coord const &rhs) const
Equality operator, compares each element directly.
Definition: Coord.h:811
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:540
virtual std::shared_ptr< Coord > clone() const
Definition: Coord.h:299
virtual std::shared_ptr< Coord > clone() const
Definition: Coord.h:550
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:249
AngleUnit constexpr hours
constant with units of hours
Definition: Angle.h:89
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:429
lsst::afw::geom::Angle getB() const
Definition: Coord.h:446
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:251
lsst::afw::geom::Point3D getVector() const
Return our contents in a position vector.
Definition: Coord.cc:349
Fk5Coord precess(double const epochTo) const
Precess ourselves from whence we are to a new epoch.
Definition: Coord.cc:654
A class to handle Fk5 coordinates (inherits from Coord)
Definition: Coord.h:339
GalacticCoord(lsst::afw::geom::Angle const l, lsst::afw::geom::Angle const b)
Definition: Coord.h:419
virtual std::string toString() const
Get string representation.
Definition: Coord.cc:739
A class to handle Ecliptic coordinates (inherits from Coord)
Definition: Coord.h:469
Observatory getObservatory() const
Definition: Coord.h:563
double getEpoch() const
Definition: Coord.h:128
int deg
Definition: Coord.cc:159
virtual void reset(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude)
Definition: Coord.h:112
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:441
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition: Coord.h:806
virtual IcrsCoord toIcrs() const
Convert ourself to ICRS: RA, Dec (basically J2000)
Definition: Coord.cc:566
lsst::afw::geom::Angle hmsStringToAngle(std::string const hms)
Convert a hh:mm:ss string to Angle.
Definition: Coord.cc:282
Coord()
Default constructor for the Coord base class.
Definition: Coord.cc:323
std::string getDecStr() const
Definition: Coord.h:318
std::shared_ptr< Coord > averageCoord(std::vector< std::shared_ptr< Coord const >> const coords, CoordSystem system=UNKNOWN)
Return average of a list of coordinates.
Definition: Coord.cc:995
std::pair< lsst::afw::geom::Angle, lsst::afw::geom::Angle > getOffsetFrom(Coord const &c) const
Compute the offset from a coordinate.
Definition: Coord.cc:512
lsst::afw::geom::Angle operator[](int const index) const
Provide access to our contents via an index.
Definition: Coord.h:767
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:367
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:112
virtual std::string getClassName() const
Definition: Coord.h:144
virtual TopocentricCoord toTopocentric(Observatory const &obs, lsst::daf::base::DateTime const &obsDate) const
Convert ourself to Altitude/Azimuth: alt, az.
Definition: Coord.cc:573
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:493
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:357
virtual IcrsCoord toIcrs() const
Icrs converter for IcrsCoord.
Definition: Coord.cc:711
lsst::afw::geom::Angle getLatitude() const
The main access method for the latitudinal coordinate.
Definition: Coord.h:170
IcrsCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:290
lsst::afw::geom::Angle getLambda() const
Definition: Coord.h:498
virtual std::shared_ptr< Coord > clone() const
Definition: Coord.h:423
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use current epoch)
Definition: Coord.cc:619
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:303
lsst::afw::geom::Angle getRa() const
Definition: Coord.h:366
This is the base class for spherical coordinates.
Definition: Coord.h:63
GalacticCoord(lsst::afw::geom::Point2D const &p2d, lsst::afw::geom::AngleUnit unit=lsst::afw::geom::degrees)
Definition: Coord.h:413
std::string getLStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:447
virtual std::shared_ptr< Coord > clone() const
Definition: Coord.h:110
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:288
virtual std::pair< std::string, std::string > getCoordNames() const
Definition: Coord.h:495
lsst::afw::geom::Angle getDec() const
Definition: Coord.h:316
virtual EclipticCoord toEcliptic() const
Convert ourself to Ecliptic: lambda, beta (use existing epoch)
Definition: Coord.cc:571
std::string getLambdaStr(lsst::afw::geom::AngleUnit unit) const
Definition: Coord.h:500
virtual EclipticCoord toEcliptic() const
Convert ourself from Ecliptic to Ecliptic ...
Definition: Coord.cc:754
virtual CoordSystem getCoordSystem() const
Definition: Coord.h:556
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:344
virtual Fk5Coord toFk5() const
Fk5 converter for IcrsCoord.
Definition: Coord.cc:709