lsst.afw  15.0-18-g5f205baaa
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/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:
89  daf::base::DateTime const &date, double ut1, geom::Angle const &era,
90  geom::SpherePoint const &boresightRaDec, geom::SpherePoint const &boresightAzAlt,
92  coord::Observatory const &observatory, coord::Weather const &weather)
93  : _exposureId(exposureId),
94  _exposureTime(exposureTime),
95  _darkTime(darkTime),
96  _date(date),
97  _ut1(ut1),
98  _era(era),
99  _boresightRaDec(boresightRaDec),
100  _boresightAzAlt(boresightAzAlt),
101  _boresightAirmass(boresightAirmass),
102  _boresightRotAngle(boresightRotAngle),
103  _rotType(rotType),
104  _observatory(observatory),
105  _weather(weather){};
106 
107  explicit VisitInfo(daf::base::PropertySet const &metadata);
108 
109  virtual ~VisitInfo() = default;
110 
111  VisitInfo(VisitInfo const &) = default;
112  VisitInfo(VisitInfo &&) = default;
113  VisitInfo &operator=(VisitInfo const &) = default;
114  VisitInfo &operator=(VisitInfo &&) = default;
115 
116  bool operator==(VisitInfo const &other) const;
117  bool operator!=(VisitInfo const &other) const { return !(*this == other); };
118 
120  table::RecordId getExposureId() const { return _exposureId; }
121 
123  double getExposureTime() const { return _exposureTime; }
124 
126  double getDarkTime() const { return _darkTime; }
127 
129  daf::base::DateTime getDate() const { return _date; }
130 
132  double getUt1() const { return _ut1; }
133 
135  geom::Angle getEra() const { return _era; }
136 
139  geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
140 
143  geom::SpherePoint getBoresightAzAlt() const { return _boresightAzAlt; }
144 
147  double getBoresightAirmass() const { return _boresightAirmass; }
148 
155  geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
156 
158  RotType getRotType() const { return _rotType; }
159 
162 
164  coord::Weather getWeather() const { return _weather; }
165 
166  bool isPersistable() const { return true; }
167 
168  // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
169  geom::Angle getLocalEra() const;
170 
171  // get hour angle at the boresight
172  geom::Angle getBoresightHourAngle() const;
173 
183  geom::Angle getBoresightParAngle() const;
184 
185 protected:
186  virtual std::string getPersistenceName() const;
187 
188  virtual void write(OutputArchiveHandle &handle) const;
189 
190 private:
191  table::RecordId _exposureId;
192  double _exposureTime;
193  double _darkTime;
194  daf::base::DateTime _date;
195  double _ut1;
196  geom::Angle _era;
197  geom::SpherePoint _boresightRaDec;
198  geom::SpherePoint _boresightAzAlt;
199  double _boresightAirmass;
200  geom::Angle _boresightRotAngle;
201  RotType _rotType;
204 };
205 
207 
208 namespace detail {
209 
216 void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
217 
226 
227 } // namespace detail
228 } // namespace image
229 } // namespace afw
230 } // namespace lsst
231 
232 #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:147
table::Key< double > exposureTime
Definition: VisitInfo.cc:153
Point in an unspecified spherical coordinate system.
Definition: SpherePoint.h:59
geom::SpherePoint getBoresightAzAlt() const
get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposur...
Definition: VisitInfo.h:143
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:152
table::Key< double > darkTime
Definition: VisitInfo.cc:154
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:166
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:139
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:132
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:126
VisitInfo(table::RecordId exposureId, double exposureTime, double darkTime, daf::base::DateTime const &date, double ut1, geom::Angle const &era, geom::SpherePoint const &boresightRaDec, geom::SpherePoint 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:88
ItemVariant const * other
Definition: Schema.cc:55
Rotation angle is unknown.
STL class.
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:74
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:275
std::ostream & operator<<(std::ostream &os, VisitInfo const &visitInfo)
Definition: VisitInfo.cc:430
A class representing an angle.
Definition: Angle.h:102
A base class for image defects.
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:120
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:117
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:161
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:123
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:158
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:129
table::Key< int > rotType
Definition: VisitInfo.cc:163
geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:155
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
table::Key< geom::Angle > era
Definition: VisitInfo.cc:157
std::ostream * os
Definition: Schema.cc:736
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:161
table::Key< geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:162
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:164
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:135