LSSTApplications  16.0-11-g09ed895+2,16.0-11-g12e47bd,16.0-11-g9bb73b2+6,16.0-12-g5c924a4+6,16.0-14-g9a974b3+1,16.0-15-g1417920+1,16.0-15-gdd5ca33+1,16.0-16-gf0259e2,16.0-17-g31abd91+7,16.0-17-g7d7456e+7,16.0-17-ga3d2e9f+13,16.0-18-ga4d4bcb+1,16.0-18-gd06566c+1,16.0-2-g0febb12+21,16.0-2-g9d5294e+69,16.0-2-ga8830df+6,16.0-20-g21842373+7,16.0-24-g3eae5ec,16.0-28-gfc9ea6c+4,16.0-29-ge8801f9,16.0-3-ge00e371+34,16.0-4-g18f3627+13,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+29,16.0-4-gb13d127+6,16.0-49-g42e581f7+6,16.0-5-g27fb78a+7,16.0-5-g6a53317+34,16.0-5-gb3f8a4b+87,16.0-6-g9321be7+4,16.0-6-gcbc7b31+42,16.0-6-gf49912c+29,16.0-7-gd2eeba5+51,16.0-71-ge89f8615e,16.0-8-g21fd5fe+29,16.0-8-g3a9f023+20,16.0-8-g4734f7a+1,16.0-8-g5858431+3,16.0-9-gf5c1f43+8,master-gd73dc1d098+1,w.2019.01
LSSTDataManagementBasePackage
VisitInfo.h
Go to the documentation of this file.
1 // -*- LSST-C++ -*- // fixed format comment for emacs
2 /*
3  * LSST Data Management System
4  * Copyright 2016 LSST Corporation.
5  *
6  * This product includes software developed by the
7  * LSST Project (http://www.lsst.org/).
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the LSST License Statement and
20  * the GNU General Public License along with this program. If not,
21  * see <http://www.lsstcorp.org/LegalNotices/>.
22  */
23 
24 #ifndef LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
25 #define LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
26 
27 #include <cmath>
28 #include <limits>
29 
30 #include "lsst/base.h"
31 #include "lsst/daf/base.h"
33 #include "lsst/afw/coord/Weather.h"
34 #include "lsst/geom/Point.h"
35 #include "lsst/geom/SpherePoint.h"
36 #include "lsst/afw/table/misc.h" // for RecordId
38 
39 namespace lsst {
40 namespace afw {
41 namespace image {
42 
44 enum class RotType {
45  UNKNOWN,
46  SKY,
48  HORIZON,
51  MOUNT
54 };
55 
68 public:
89  daf::base::DateTime const &date, double ut1, lsst::geom::Angle const &era,
91  lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass,
94  : _exposureId(exposureId),
95  _exposureTime(exposureTime),
96  _darkTime(darkTime),
97  _date(date),
98  _ut1(ut1),
99  _era(era),
100  _boresightRaDec(boresightRaDec),
101  _boresightAzAlt(boresightAzAlt),
102  _boresightAirmass(boresightAirmass),
103  _boresightRotAngle(boresightRotAngle),
104  _rotType(rotType),
105  _observatory(observatory),
106  _weather(weather){};
107 
108  explicit VisitInfo(daf::base::PropertySet const &metadata);
109 
110  ~VisitInfo() override = default;
111 
112  VisitInfo(VisitInfo const &) = default;
113  VisitInfo(VisitInfo &&) = default;
114  VisitInfo &operator=(VisitInfo const &) = default;
115  VisitInfo &operator=(VisitInfo &&) = default;
116 
117  bool operator==(VisitInfo const &other) const;
118  bool operator!=(VisitInfo const &other) const { return !(*this == other); };
119 
121  std::size_t hash_value() const noexcept;
122 
124  table::RecordId getExposureId() const { return _exposureId; }
125 
127  double getExposureTime() const { return _exposureTime; }
128 
130  double getDarkTime() const { return _darkTime; }
131 
133  daf::base::DateTime getDate() const { return _date; }
134 
136  double getUt1() const { return _ut1; }
137 
139  lsst::geom::Angle getEra() const { return _era; }
140 
143  lsst::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
144 
147  lsst::geom::SpherePoint getBoresightAzAlt() const { return _boresightAzAlt; }
148 
151  double getBoresightAirmass() const { return _boresightAirmass; }
152 
159  lsst::geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
160 
162  RotType getRotType() const { return _rotType; }
163 
165  coord::Observatory getObservatory() const { return _observatory; }
166 
168  coord::Weather getWeather() const { return _weather; }
169 
170  bool isPersistable() const noexcept override { return true; }
171 
172  // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
173  lsst::geom::Angle getLocalEra() const;
174 
175  // get hour angle at the boresight
176  lsst::geom::Angle getBoresightHourAngle() const;
177 
187  lsst::geom::Angle getBoresightParAngle() const;
188 
189 protected:
190  std::string getPersistenceName() const override;
191 
192  void write(OutputArchiveHandle &handle) const override;
193 
194 private:
195  table::RecordId _exposureId;
196  double _exposureTime;
197  double _darkTime;
198  daf::base::DateTime _date;
199  double _ut1;
200  lsst::geom::Angle _era;
201  lsst::geom::SpherePoint _boresightRaDec;
202  lsst::geom::SpherePoint _boresightAzAlt;
203  double _boresightAirmass;
204  lsst::geom::Angle _boresightRotAngle;
205  RotType _rotType;
206  coord::Observatory _observatory;
207  coord::Weather _weather;
208 };
209 
211 
212 namespace detail {
213 
220 void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
221 
230 
231 } // namespace detail
232 } // namespace image
233 } // namespace afw
234 } // namespace lsst
235 
236 namespace std {
237 template <>
238 struct hash<lsst::afw::image::VisitInfo> {
241  size_t operator()(argument_type const &obj) const noexcept { return obj.hash_value(); }
242 };
243 } // namespace std
244 
245 #endif // !LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure...
Definition: VisitInfo.h:151
lsst::geom::SpherePoint getBoresightAzAlt() const
get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposur...
Definition: VisitInfo.h:147
size_t operator()(argument_type const &obj) const noexcept
Definition: VisitInfo.h:241
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:64
VisitInfo(table::RecordId exposureId, double exposureTime, double darkTime, daf::base::DateTime const &date, double ut1, lsst::geom::Angle const &era, lsst::geom::SpherePoint const &boresightRaDec, lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass, lsst::geom::Angle const &boresightRotAngle, RotType const &rotType, coord::Observatory const &observatory, coord::Weather const &weather)
Construct a VisitInfo.
Definition: VisitInfo.h:88
An object passed to Persistable::write to allow it to persist itself.
table::Key< double > ut1
Definition: VisitInfo.cc:162
Class for storing ordered metadata with comments.
Definition: PropertyList.h:68
Hold the location of an observatory.
Definition: Observatory.h:43
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:164
RotType
Type of rotation.
Definition: VisitInfo.h:44
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:67
lsst::geom::SpherePoint getBoresightRaDec() const
get ICRS RA/Dec position at the boresight (and at the middle of the exposure, if it varies with time)...
Definition: VisitInfo.h:143
STL namespace.
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:136
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:167
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec) ...
Definition: VisitInfo.h:130
std::size_t hash_value(Extent< T, N > const &extent) noexcept
Definition: Extent.cc:127
table::Key< lsst::geom::Angle > era
Definition: VisitInfo.cc:163
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
Definition: VisitInfo.h:170
table::Key< int > rotType
Definition: VisitInfo.cc:169
Rotation angle is unknown.
A class representing an angle.
Definition: Angle.h:127
STL class.
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:74
table::Key< lsst::geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:168
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:283
std::ostream & operator<<(std::ostream &os, VisitInfo const &visitInfo)
Definition: VisitInfo.cc:448
A base class for image defects.
Definition: cameraGeom.dox:3
table::Key< double > exposureTime
Definition: VisitInfo.cc:159
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:124
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:118
Basic LSST definitions.
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:158
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:127
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:162
Basic weather information sufficient for a simple model for air mass or refraction.
Definition: Weather.h:38
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:139
Position angle of focal plane +Y, measured from N through E.
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:133
Point in an unspecified spherical coordinate system.
Definition: SpherePoint.h:57
Class for storing generic metadata.
Definition: PropertySet.h:68
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:267
Position angle of focal plane +Y, measured from +Alt through +Az.
ItemVariant const * other
Definition: Schema.cc:56
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:159
table::Key< double > darkTime
Definition: VisitInfo.cc:160
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:176
STL class.
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:165
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:168
The position sent to the instrument rotator; the details depend on the rotator.
std::ostream * os
Definition: Schema.cc:746