lsst.afw  13.0-100-ge0459d59f+5
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/Coord.h"
34 #include "lsst/afw/coord/Weather.h"
35 #include "lsst/afw/geom/Point.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:
92  daf::base::DateTime const &date, double ut1, geom::Angle const &era,
93  coord::IcrsCoord const &boresightRaDec, coord::Coord const &boresightAzAlt,
95  coord::Observatory const &observatory, coord::Weather const &weather)
96  : _exposureId(exposureId),
97  _exposureTime(exposureTime),
98  _darkTime(darkTime),
99  _date(date),
100  _ut1(ut1),
101  _era(era),
102  _boresightRaDec(boresightRaDec),
103  _boresightAzAlt(boresightAzAlt),
104  _boresightAirmass(boresightAirmass),
105  _boresightRotAngle(boresightRotAngle),
106  _rotType(rotType),
107  _observatory(observatory),
108  _weather(weather){};
109 
110  explicit VisitInfo(daf::base::PropertySet const &metadata);
111 
113 
114  VisitInfo(VisitInfo const &) = default;
115  VisitInfo(VisitInfo &&) = default;
116  VisitInfo &operator=(VisitInfo const &) = default;
117  VisitInfo &operator=(VisitInfo &&) = default;
118 
119  bool operator==(VisitInfo const &other) const;
120  bool operator!=(VisitInfo const &other) const { return !(*this == other); };
121 
123  table::RecordId getExposureId() const { return _exposureId; }
124 
126  double getExposureTime() const { return _exposureTime; }
127 
129  double getDarkTime() const { return _darkTime; }
130 
132  daf::base::DateTime getDate() const { return _date; }
133 
135  double getUt1() const { return _ut1; }
136 
138  geom::Angle getEra() const { return _era; }
139 
142  coord::IcrsCoord getBoresightRaDec() const { return _boresightRaDec; }
143 
146  coord::Coord getBoresightAzAlt() const { return _boresightAzAlt; }
147 
150  double getBoresightAirmass() const { return _boresightAirmass; }
151 
158  geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
159 
161  RotType getRotType() const { return _rotType; }
162 
165 
167  coord::Weather getWeather() const { return _weather; }
168 
169  bool isPersistable() const { return true; }
170 
171  // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
172  geom::Angle getLocalEra() const;
173 
174  // get hour angle at the boresight
175  geom::Angle getBoresightHourAngle() const;
176 
177 protected:
178  virtual std::string getPersistenceName() const;
179 
180  virtual void write(OutputArchiveHandle &handle) const;
181 
182 private:
183  table::RecordId _exposureId;
184  double _exposureTime;
185  double _darkTime;
186  daf::base::DateTime _date;
187  double _ut1;
188  geom::Angle _era;
189  coord::IcrsCoord _boresightRaDec;
190  coord::Coord _boresightAzAlt;
191  double _boresightAirmass;
192  geom::Angle _boresightRotAngle;
193  RotType _rotType;
196 };
197 
198 namespace detail {
199 
207 
216 
217 } // lsst::afw::image::detail
218 }
219 }
220 } // lsst::afw::image
221 
222 #endif // !LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:22
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure...
Definition: VisitInfo.h:150
table::Key< double > exposureTime
Definition: VisitInfo.cc:153
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:152
table::Key< double > darkTime
Definition: VisitInfo.cc:154
coord::Coord getBoresightAzAlt() const
get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposur...
Definition: VisitInfo.h:146
An object passed to Persistable::write to allow it to persist itself.
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.
Definition: VisitInfo.h:169
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:158
Hold the location of an observatory.
Definition: Observatory.h:41
RotType
Type of rotation.
Definition: VisitInfo.h:44
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:67
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:135
bool operator==(CoordKey const &lhs, CoordKey const &rhs)
Compare CoordKeys for equality using the constituent Keys.
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec) ...
Definition: VisitInfo.h:129
lsst::daf::base::PropertyList PropertyList
Definition: Wcs.cc:56
Rotation angle is unknown.
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:73
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:55
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:275
A class representing an angle.
Definition: Angle.h:102
A base class for image defects.
Definition: cameraGeom.dox:3
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:123
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:120
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:161
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:126
coord::IcrsCoord 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:142
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:161
Basic weather information sufficient for a simple model for air mass or refraction.
Definition: Weather.h:38
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:132
table::Key< int > rotType
Definition: VisitInfo.cc:163
geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:158
VisitInfo(table::RecordId exposureId, double exposureTime, double darkTime, daf::base::DateTime const &date, double ut1, geom::Angle const &era, coord::IcrsCoord const &boresightRaDec, coord::Coord const &boresightAzAlt, double boresightAirmass, geom::Angle const &boresightRotAngle, RotType const &rotType, coord::Observatory const &observatory, coord::Weather const &weather)
Construct a VisitInfo.
Definition: VisitInfo.h:91
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:259
Position angle of focal plane +Y, measured from +Alt through +Az.
table::Key< double > ut1
Definition: VisitInfo.cc:156
This is the base class for spherical coordinates.
Definition: Coord.h:63
table::Key< geom::Angle > era
Definition: VisitInfo.cc:157
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:173
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:164
table::Key< geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:162
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:288
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:167
The position sent to the instrument rotator; the details depend on the rotator.
geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:138