lsst.afw
g3a5ebb7d8a+28b83bf6a5
Toggle main menu visibility
Loading...
Searching...
No Matches
src
coord
Observatory.cc
Go to the documentation of this file.
1
// -*- lsst-c++ -*-
2
3
/*
4
* This file is part of afw.
5
*
6
* Developed for the LSST Data Management System.
7
* This product includes software developed by the LSST Project
8
* (https://www.lsst.org).
9
* See the COPYRIGHT file at the top-level directory of this distribution
10
* for details of code ownership.
11
*
12
* This program is free software: you can redistribute it and/or modify
13
* it under the terms of the GNU General Public License as published by
14
* the Free Software Foundation, either version 3 of the License, or
15
* (at your option) any later version.
16
*
17
* This program is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
* GNU General Public License for more details.
21
*
22
* You should have received a copy of the LSST License Statement and
23
* the GNU General Public License along with this program. If not,
24
* see <http://www.lsstcorp.org/LegalNotices/>.
25
*/
26
27
#include <string>
28
#include <iostream>
29
30
#include "boost/format.hpp"
31
32
#include "
lsst/geom/Angle.h
"
33
#include "
lsst/afw/coord/Observatory.h
"
34
35
namespace
lsst
{
36
namespace
afw
{
37
namespace
coord
{
38
39
Observatory::Observatory
(
lsst::geom::Angle
const
longitude,
lsst::geom::Angle
const
latitude,
40
double
const
elevation)
41
: _latitude(latitude), _longitude(longitude), _elevation(elevation) {}
42
43
Observatory::~Observatory
() noexcept = default;
44
45
Observatory
::
Observatory
(
Observatory
const&) noexcept = default;
46
Observatory
::
Observatory
(
Observatory
&&) noexcept = default;
47
Observatory
&
Observatory
::operator=(
Observatory
const&) noexcept = default;
48
Observatory
&
Observatory
::operator=(
Observatory
&&) noexcept = default;
49
50
lsst
::
geom
::Angle
Observatory
::
getLongitude
() const noexcept {
return
_longitude; }
51
52
lsst::geom::Angle
Observatory::getLatitude
() const noexcept {
return
_latitude; }
53
54
void
Observatory::setLatitude
(
lsst::geom::Angle
const
latitude) { _latitude = latitude; }
55
56
void
Observatory::setLongitude
(
lsst::geom::Angle
const
longitude) { _longitude = longitude; }
57
58
void
Observatory::setElevation
(
double
const
elevation) { _elevation = elevation; }
59
60
std::string
Observatory::toString
()
const
{
61
// Follow ISO 6709 ordering and sign convention.
62
return
(boost::format(
"%gN, %gE %g"
) %
getLatitude
().asDegrees() %
getLongitude
().asDegrees() %
63
getElevation
())
64
.str();
65
}
66
67
std::ostream
&
operator<<
(
std::ostream
& os,
Observatory
const
& obs) {
68
os << obs.
toString
();
69
return
os;
70
}
71
}
// namespace coord
72
}
// namespace afw
73
}
// namespace lsst
Angle.h
Observatory.h
std::ostream
std::string
lsst::afw::coord::Observatory
Hold the location of an observatory.
Definition
Observatory.h:43
lsst::afw::coord::Observatory::setLatitude
void setLatitude(lsst::geom::Angle const latitude)
set telescope latitude (positive values are E of Greenwich)
Definition
Observatory.cc:54
lsst::afw::coord::Observatory::toString
std::string toString() const
get string representation
Definition
Observatory.cc:60
lsst::afw::coord::Observatory::getElevation
double getElevation() const noexcept
get telescope elevation (meters above reference spheroid)
Definition
Observatory.h:82
lsst::afw::coord::Observatory::setElevation
void setElevation(double const elevation)
set telescope elevation (meters above reference spheroid)
Definition
Observatory.cc:58
lsst::afw::coord::Observatory::~Observatory
~Observatory() noexcept
lsst::afw::coord::Observatory::setLongitude
void setLongitude(lsst::geom::Angle const longitude)
set telescope longitude
Definition
Observatory.cc:56
lsst::afw::coord::Observatory::getLatitude
lsst::geom::Angle getLatitude() const noexcept
get telescope latitude
Definition
Observatory.cc:52
lsst::afw::coord::Observatory::Observatory
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:39
lsst::afw::coord::Observatory::getLongitude
lsst::geom::Angle getLongitude() const noexcept
get telescope longitude (positive values are E of Greenwich)
Definition
Observatory.cc:50
lsst::geom::Angle
lsst::afw::coord
Definition
Observatory.h:38
lsst::afw::coord::operator<<
std::ostream & operator<<(std::ostream &os, Observatory const &obs)
Print an Observatory to the stream.
Definition
Observatory.cc:67
lsst::afw
Definition
imageAlgorithm.dox:1
lsst::geom
lsst
Generated on
for lsst.afw by
1.17.0