LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
LSST Data Management Base Package
Loading...
Searching...
No Matches
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"
34
35namespace lsst {
36namespace afw {
37namespace coord {
38
40 double const elevation)
41 : _latitude(latitude), _longitude(longitude), _elevation(elevation) {}
42
43Observatory::~Observatory() noexcept = default;
44
45Observatory::Observatory(Observatory const&) noexcept = default;
46Observatory::Observatory(Observatory&&) noexcept = default;
47Observatory& Observatory::operator=(Observatory const&) noexcept = default;
48Observatory& Observatory::operator=(Observatory&&) noexcept = default;
49
50lsst::geom::Angle Observatory::getLongitude() const noexcept { return _longitude; }
51
52lsst::geom::Angle Observatory::getLatitude() const noexcept { return _latitude; }
53
55
57
58void Observatory::setElevation(double const elevation) { _elevation = elevation; }
59
61 // Follow ISO 6709 ordering and sign convention.
62 return (boost::format("%gN, %gE %g") % getLatitude().asDegrees() % getLongitude().asDegrees() %
64 .str();
65}
66
68 os << obs.toString();
69 return os;
70}
71} // namespace coord
72} // namespace afw
73} // namespace lsst
std::ostream * os
Definition: Schema.cc:557
table::Key< lsst::geom::Angle > longitude
Definition: VisitInfo.cc:215
table::Key< lsst::geom::Angle > latitude
Definition: VisitInfo.cc:214
table::Key< double > elevation
Definition: VisitInfo.cc:216
Hold the location of an observatory.
Definition: Observatory.h:43
void setLatitude(lsst::geom::Angle const latitude)
set telescope latitude (positive values are E of Greenwich)
Definition: Observatory.cc:54
std::string toString() const
get string representation
Definition: Observatory.cc:60
double getElevation() const noexcept
get telescope elevation (meters above reference spheroid)
Definition: Observatory.h:82
void setElevation(double const elevation)
set telescope elevation (meters above reference spheroid)
Definition: Observatory.cc:58
void setLongitude(lsst::geom::Angle const longitude)
set telescope longitude
Definition: Observatory.cc:56
lsst::geom::Angle getLatitude() const noexcept
get telescope latitude
Definition: Observatory.cc:52
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::geom::Angle getLongitude() const noexcept
get telescope longitude (positive values are E of Greenwich)
Definition: Observatory.cc:50
A class representing an angle.
Definition: Angle.h:128
std::ostream & operator<<(std::ostream &os, Observatory const &obs)
Print an Observatory to the stream.
Definition: Observatory.cc:67