lsst.afw  16.0-51-gb4b4a8566+2
Observatory.h
Go to the documentation of this file.
1 // -*- lsst-c++ -*-
2 
3 /*
4  * LSST Data Management System
5  * Copyright 2008-2016 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_OBSERVATORY_H)
26 #define LSST_AFW_COORD_OBSERVATORY_H
27 /*
28  * Class to hold observatory/telescope location
29  */
30 
31 #include <iostream>
32 #include "lsst/geom/Angle.h"
33 
34 namespace lsst {
35 namespace afw {
36 namespace coord {
37 
41 class Observatory final {
42 public:
51 
60  Observatory(std::string const& longitude, std::string const& latitude, double const elevation);
61 
62  ~Observatory() noexcept;
63  Observatory(Observatory const&) noexcept;
64  Observatory(Observatory&&) noexcept;
65  Observatory& operator=(Observatory const&) noexcept;
66  Observatory& operator=(Observatory&&) noexcept;
67 
69  void setLongitude(lsst::geom::Angle const longitude);
71  void setLatitude(lsst::geom::Angle const latitude);
73  void setElevation(double const elevation);
74 
76  lsst::geom::Angle getLongitude() const noexcept;
78  lsst::geom::Angle getLatitude() const noexcept;
80  double getElevation() const noexcept { return _elevation; }
81 
83  std::string toString() const;
84 
85  bool operator==(Observatory const& rhs) const noexcept {
86  auto deltaLongitude = (_latitude - rhs.getLatitude()).wrapCtr();
87  auto deltaLatitude = (_longitude - rhs.getLongitude()).wrapCtr();
88  return (deltaLongitude == 0.0 * lsst::geom::degrees) &&
89  (deltaLatitude == 0.0 * lsst::geom::degrees) && ((_elevation - rhs._elevation) == 0.0);
90  }
91  bool operator!=(Observatory const& rhs) const noexcept { return !(*this == rhs); }
92 
93 private:
94  lsst::geom::Angle _latitude;
95  lsst::geom::Angle _longitude;
96  double _elevation;
97 };
98 
106 } // namespace coord
107 } // namespace afw
108 } // namespace lsst
109 
110 #endif
bool operator==(Observatory const &rhs) const noexcept
Definition: Observatory.h:85
void setElevation(double const elevation)
set telescope elevation (meters above reference spheroid)
Definition: Observatory.cc:56
std::string toString() const
get string representation
Definition: Observatory.cc:58
Observatory(lsst::geom::Angle const longitude, lsst::geom::Angle const latitude, double const elevation)
Construct an Observatory with longitude and latitude specified as lsst::geom::Angle.
Definition: Observatory.cc:37
double getElevation() const noexcept
get telescope elevation (meters above reference spheroid)
Definition: Observatory.h:80
Hold the location of an observatory.
Definition: Observatory.h:41
table::Key< lsst::geom::Angle > longitude
Definition: VisitInfo.cc:171
void setLongitude(lsst::geom::Angle const longitude)
set telescope longitude
Definition: Observatory.cc:54
STL class.
lsst::geom::Angle getLatitude() const noexcept
get telescope latitude
Definition: Observatory.cc:50
std::ostream & operator<<(std::ostream &os, Observatory const &obs)
Print an Observatory to the stream.
Definition: Observatory.cc:64
table::Key< lsst::geom::Angle > latitude
Definition: VisitInfo.cc:170
lsst::geom::Angle getLongitude() const noexcept
get telescope longitude (positive values are E of Greenwich)
Definition: Observatory.cc:48
AngleUnit constexpr degrees
A base class for image defects.
bool operator!=(Observatory const &rhs) const noexcept
Definition: Observatory.h:91
Observatory & operator=(Observatory const &) noexcept
std::ostream * os
Definition: Schema.cc:737
void setLatitude(lsst::geom::Angle const latitude)
set telescope latitude (positive values are E of Greenwich)
Definition: Observatory.cc:52
STL class.
table::Key< double > elevation
Definition: VisitInfo.cc:172