LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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.
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
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
Basic LSST definitions.