LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
home
lsstsw
stack
Linux64
afw
11.0-2-g04d2804
src
coord
Observatory.cc
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
32
#include <sstream>
33
#include <cmath>
34
35
#include "
lsst/pex/exceptions.h
"
36
#include "boost/format.hpp"
37
#include "boost/algorithm/string.hpp"
38
#include "boost/tuple/tuple.hpp"
39
40
#include "
lsst/afw/geom/Angle.h
"
41
#include "
lsst/afw/coord/Coord.h
"
42
#include "
lsst/afw/coord/Observatory.h
"
43
44
namespace
coord = lsst::afw::coord;
45
namespace
ex = lsst::pex::exceptions;
46
namespace
afwGeom = lsst::afw::geom;
47
48
49
53
coord::Observatory::Observatory
(
54
afwGeom::Angle
const
longitude,
55
afwGeom::Angle
const
latitude,
56
double
const
elevation
57
) :
58
_latitude(latitude),
59
_longitude(longitude),
60
_elevation(elevation) {
61
}
62
63
64
65
/*
66
* @brief Constructor for the observatory with lat/long as strings
67
*
68
* @note RA is assumed to be in DMS, not HMS!
69
*
70
*/
71
coord::Observatory::Observatory
(
72
std::string
const
longitude,
73
std::string
const
latitude,
74
double
const
elevation
75
) :
76
_latitude(
dmsStringToAngle
(latitude)),
77
_longitude(
dmsStringToAngle
(longitude)),
78
_elevation(elevation) {
79
}
80
81
82
83
88
afwGeom::Angle
coord::Observatory::getLongitude
()
const
{
89
return
_longitude;
90
}
91
99
afwGeom::Angle
coord::Observatory::getLatitude
()
const
{
100
return
_latitude;
101
}
102
103
107
void
coord::Observatory::setLatitude
(
108
afwGeom::Angle
const
latitude
109
) {
110
_latitude = latitude;
111
}
112
116
void
coord::Observatory::setLongitude
(
117
afwGeom::Angle
const
longitude
118
) {
119
_longitude = longitude;
120
}
121
122
126
void
coord::Observatory::setElevation
(
127
double
const
elevation
128
) {
129
_elevation = elevation;
130
}
131
132
133
141
std::string
coord::Observatory::getLongitudeStr
()
const
{
142
return
angleToDmsString
(_longitude);
143
}
151
std::string
coord::Observatory::getLatitudeStr
()
const
{
152
return
angleToDmsString
(_latitude);
153
}
154
158
std::ostream &
coord::operator<<
(std::ostream &os,
159
coord::Observatory
const
& obs
160
)
161
{
162
return
os << (
boost::format
(
"%gW, %gN %g"
)
163
% obs.
getLatitude
().
asDegrees
()
164
% obs.
getLongitude
().
asDegrees
()
165
% obs.
getElevation
()).str();
166
}
167
168
/************************************************************************************************************/
lsst::pex.config.history.format
def format
Definition:
history.py:127
lsst::afw::coord::Observatory::setElevation
void setElevation(double const elevation)
Set the Elevation.
Definition:
Observatory.cc:126
lsst::afw::coord::Observatory::setLongitude
void setLongitude(lsst::afw::geom::Angle const longitude)
Set the longitude.
Definition:
Observatory.cc:116
lsst::afw::coord::Observatory
Store information about an observatory ... lat/long, elevation.
Definition:
Observatory.h:48
exceptions.h
Include files required for standard LSST Exception handling.
lsst::afw::coord::Observatory::Observatory
Observatory(lsst::afw::geom::Angle const longitude, lsst::afw::geom::Angle const latitude, double const elevation)
Constructor for the observatory with lat/long as afwGeom::Angles.
Definition:
Observatory.cc:53
lsst::afw::coord::Observatory::getLongitudeStr
std::string getLongitudeStr() const
Allow quick access to the longitudinal coordinate as a string.
Definition:
Observatory.cc:141
lsst::afw::coord::Observatory::setLatitude
void setLatitude(lsst::afw::geom::Angle const latitude)
Set the latitude.
Definition:
Observatory.cc:107
Observatory.h
Class to hold observatory information.
lsst::afw::geom::Angle::asDegrees
double asDegrees() const
Definition:
Angle.h:124
lsst::afw::coord::operator<<
std::ostream & operator<<(std::ostream &os, Coord const &coord)
Definition:
Coord.cc:1418
lsst::afw::geom::Angle
Definition:
Angle.h:104
lsst::afw::coord::Observatory::getLongitude
lsst::afw::geom::Angle getLongitude() const
The main access method for the longitudinal coordinate.
Definition:
Observatory.cc:88
lsst::afw::coord::Observatory::getLatitude
lsst::afw::geom::Angle getLatitude() const
The main access method for the longitudinal coordinate.
Definition:
Observatory.cc:99
lsst::afw::coord::angleToDmsString
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
Angle.h
lsst::afw::coord::Observatory::getLatitudeStr
std::string getLatitudeStr() const
Allow quick access to the longitude coordinate as a string.
Definition:
Observatory.cc:151
lsst::afw::coord::Observatory::getElevation
double getElevation() const
Definition:
Observatory.h:60
lsst::afw::coord::dmsStringToAngle
lsst::afw::geom::Angle dmsStringToAngle(std::string const dms)
Convert a dd:mm:ss string to Angle.
Definition:
Coord.cc:344
Coord.h
Functions to handle coordinates.
Generated on Thu Sep 24 2015 02:29:16 for LSSTApplications by
1.8.5