LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
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/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 { namespace afw { namespace image {
40 
42 enum class RotType {
43  UNKNOWN,
44  SKY,
46  HORIZON,
48  MOUNT
50 };
51 
64 public:
65 
88  explicit VisitInfo(
90  double exposureTime,
91  double darkTime,
92  daf::base::DateTime const & date,
93  double ut1,
94  geom::Angle const & era,
96  coord::Coord const & boresightAzAlt,
97  double boresightAirmass,
99  RotType const & rotType,
100  coord::Observatory const & observatory,
101  coord::Weather const & weather
102  ) :
103  _exposureId(exposureId),
104  _exposureTime(exposureTime),
105  _darkTime(darkTime),
106  _date(date),
107  _ut1(ut1),
108  _era(era),
109  _boresightRaDec(boresightRaDec),
110  _boresightAzAlt(boresightAzAlt),
111  _boresightAirmass(boresightAirmass),
112  _boresightRotAngle(boresightRotAngle),
113  _rotType(rotType),
114  _observatory(observatory),
115  _weather(weather)
116  {};
117 
118  explicit VisitInfo(daf::base::PropertySet const & metadata);
119 
121 
122  VisitInfo(VisitInfo const &) = default;
123  VisitInfo(VisitInfo &&) = default;
124  VisitInfo & operator=(VisitInfo const &) = default;
125  VisitInfo & operator=(VisitInfo &&) = default;
126 
127  bool operator==(VisitInfo const & other) const;
128  bool operator!=(VisitInfo const & other) const { return !(*this == other); };
129 
132 
134  double getExposureTime() const { return _exposureTime; }
135 
137  double getDarkTime() const { return _darkTime; }
138 
140  daf::base::DateTime getDate() const { return _date; }
141 
143  double getUt1() const { return _ut1; }
144 
146  geom::Angle getEra() const { return _era; }
147 
151 
155 
158  double getBoresightAirmass() const { return _boresightAirmass; }
159 
168 
170  RotType getRotType() const { return _rotType; }
171 
174 
176  coord::Weather getWeather() const { return _weather; }
177 
178  bool isPersistable() const { return true; }
179 
180  // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
181  geom::Angle getLocalEra() const;
182 
183  // get hour angle at the boresight
185 
186 protected:
187 
188  virtual std::string getPersistenceName() const;
189 
190  virtual void write(OutputArchiveHandle & handle) const;
191 
192 private:
195  double _darkTime;
197  double _ut1;
206 };
207 
208 namespace detail {
209 
216 void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
217 
226 
227 } // lsst::afw::image::detail
228 
229 }}} // lsst::afw::image
230 
231 #endif // !LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:454
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
Definition: VisitInfo.cc:422
table::Key< double > exposureTime
Definition: VisitInfo.cc:160
bool isPersistable() const
Return true if this particular object can be persisted using afw::table::io.
Definition: VisitInfo.h:178
geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:167
A coordinate class intended to represent absolute positions.
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:159
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:402
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:62
table::Key< double > darkTime
Definition: VisitInfo.cc:161
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:131
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:165
Class for storing ordered metadata with comments.
Definition: PropertyList.h:82
Hold the location of an observatory.
Definition: Observatory.h:47
coord::Coord getBoresightAzAlt() const
get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposur...
Definition: VisitInfo.h:154
RotType
Type of rotation.
Definition: VisitInfo.h:42
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:63
daf::base::DateTime _date
Definition: VisitInfo.h:196
io::OutputArchiveHandle OutputArchiveHandle
Definition: Persistable.h:112
geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:146
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:128
Class to hold observatory/telescope location.
Rotation angle is unknown.
table::RecordId _exposureId
Definition: VisitInfo.h:193
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
A base class for objects that can be persisted via afw::table::io Archive classes.
Definition: Persistable.h:72
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:20
coord::IcrsCoord _boresightRaDec
Definition: VisitInfo.h:199
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:297
A class representing an Angle.
Definition: Angle.h:103
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure...
Definition: VisitInfo.h:158
coord::Coord _boresightAzAlt
Definition: VisitInfo.h:200
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:140
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:176
coord::Observatory _observatory
Definition: VisitInfo.h:204
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:168
geom::Angle _boresightRotAngle
Definition: VisitInfo.h:202
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:143
Basic weather information sufficient for a simple model for air mass or refraction.
Definition: Weather.h:36
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
Definition: VisitInfo.cc:418
Orientation of E,N with respected to detector X,Y; X is flipped, if necessary, to match the handednes...
VisitInfo & operator=(VisitInfo const &)=default
Class for storing generic metadata.
Definition: PropertySet.h:82
geom::Angle getLocalEra() const
Definition: VisitInfo.cc:450
table::Key< int > rotType
Definition: VisitInfo.cc:170
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:88
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:279
orientation of Az/Alt with respect to detector X,Y; X is flipped, if necessary, to match the handedne...
table::Key< double > ut1
Definition: VisitInfo.cc:163
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:173
Basic LSST definitions.
This is the base class for spherical coordinates.
Definition: Coord.h:69
table::Key< geom::Angle > era
Definition: VisitInfo.cc:164
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:180
table::Key< geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:169
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:156
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:134
coord::Weather _weather
Definition: VisitInfo.h:205
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:170
The position sent to the instrument rotator; the details depend on the rotator.
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec) ...
Definition: VisitInfo.h:137
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:150
Functions to handle coordinates.