LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
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
39 
40 namespace lsst {
41 namespace afw {
42 namespace image {
43 
45 enum class RotType {
46  UNKNOWN,
47  SKY,
49  HORIZON,
52  MOUNT
55 };
56 
69 public:
90  daf::base::DateTime const &date, double ut1, lsst::geom::Angle const &era,
92  lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass,
95  : _exposureId(exposureId),
96  _exposureTime(exposureTime),
97  _darkTime(darkTime),
98  _date(date),
99  _ut1(ut1),
100  _era(era),
101  _boresightRaDec(boresightRaDec),
102  _boresightAzAlt(boresightAzAlt),
103  _boresightAirmass(boresightAirmass),
104  _boresightRotAngle(boresightRotAngle),
105  _rotType(rotType),
106  _observatory(observatory),
107  _weather(weather){};
108 
109  explicit VisitInfo(daf::base::PropertySet const &metadata);
110 
111  ~VisitInfo() override = default;
112 
113  VisitInfo(VisitInfo const &) = default;
114  VisitInfo(VisitInfo &&) = default;
115  VisitInfo &operator=(VisitInfo const &) = default;
116  VisitInfo &operator=(VisitInfo &&) = default;
117 
118  bool operator==(VisitInfo const &other) const;
119  bool operator!=(VisitInfo const &other) const { return !(*this == other); };
120 
122  std::size_t hash_value() const noexcept override;
123 
125  table::RecordId getExposureId() const { return _exposureId; }
126 
128  double getExposureTime() const { return _exposureTime; }
129 
131  double getDarkTime() const { return _darkTime; }
132 
134  daf::base::DateTime getDate() const { return _date; }
135 
137  double getUt1() const { return _ut1; }
138 
140  lsst::geom::Angle getEra() const { return _era; }
141 
144  lsst::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
145 
148  lsst::geom::SpherePoint getBoresightAzAlt() const { return _boresightAzAlt; }
149 
152  double getBoresightAirmass() const { return _boresightAirmass; }
153 
160  lsst::geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
161 
163  RotType getRotType() const { return _rotType; }
164 
166  coord::Observatory getObservatory() const { return _observatory; }
167 
169  coord::Weather getWeather() const { return _weather; }
170 
171  bool isPersistable() const noexcept override { return true; }
172 
173  // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
174  lsst::geom::Angle getLocalEra() const;
175 
176  // get hour angle at the boresight
177  lsst::geom::Angle getBoresightHourAngle() const;
178 
188  lsst::geom::Angle getBoresightParAngle() const;
189 
191  std::shared_ptr<typehandling::Storable> cloneStorable() const override;
192 
194  std::string toString() const override;
195 
201  bool equals(typehandling::Storable const &other) const noexcept override;
202 
203 protected:
204  std::string getPersistenceName() const override;
205 
206  void write(OutputArchiveHandle &handle) const override;
207 
208 private:
209  table::RecordId _exposureId;
210  double _exposureTime;
211  double _darkTime;
212  daf::base::DateTime _date;
213  double _ut1;
214  lsst::geom::Angle _era;
215  lsst::geom::SpherePoint _boresightRaDec;
216  lsst::geom::SpherePoint _boresightAzAlt;
217  double _boresightAirmass;
218  lsst::geom::Angle _boresightRotAngle;
219  RotType _rotType;
220  coord::Observatory _observatory;
221  coord::Weather _weather;
222 };
223 
225 
226 namespace detail {
227 
234 void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
235 
244 
245 } // namespace detail
246 } // namespace image
247 } // namespace afw
248 } // namespace lsst
249 
250 namespace std {
251 template <>
252 struct hash<lsst::afw::image::VisitInfo> {
255  size_t operator()(argument_type const &obj) const noexcept { return obj.hash_value(); }
256 };
257 } // namespace std
258 
259 #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:152
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:148
size_t operator()(argument_type const &obj) const noexcept
Definition: VisitInfo.h:255
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:64
std::ostream & operator<<(std::ostream &os, Measurement const &measurement)
Definition: PhotoCalib.cc:48
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:89
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
Basic LSST definitions.
RotType
Type of rotation.
Definition: VisitInfo.h:45
Interface supporting iteration over heterogenous containers.
Definition: Storable.h:56
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:68
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:144
STL namespace.
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:137
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:131
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:171
table::Key< int > rotType
Definition: VisitInfo.cc:169
Rotation angle is unknown.
A class representing an angle.
Definition: Angle.h:127
STL class.
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
A base class for image defects.
table::Key< double > exposureTime
Definition: VisitInfo.cc:159
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:125
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:119
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:158
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:128
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:163
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:140
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:134
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:160
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
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:166
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:169
The position sent to the instrument rotator; the details depend on the rotator.
std::ostream * os
Definition: Schema.cc:746