LSST Applications g0f08755f38+82efc23009,g12f32b3c4e+e7bdf1200e,g1653933729+a8ce1bb630,g1a0ca8cf93+50eff2b06f,g28da252d5a+52db39f6a5,g2bbee38e9b+37c5a29d61,g2bc492864f+37c5a29d61,g2cdde0e794+c05ff076ad,g3156d2b45e+41e33cbcdc,g347aa1857d+37c5a29d61,g35bb328faa+a8ce1bb630,g3a166c0a6a+37c5a29d61,g3e281a1b8c+fb992f5633,g414038480c+7f03dfc1b0,g41af890bb2+11b950c980,g5fbc88fb19+17cd334064,g6b1c1869cb+12dd639c9a,g781aacb6e4+a8ce1bb630,g80478fca09+72e9651da0,g82479be7b0+04c31367b4,g858d7b2824+82efc23009,g9125e01d80+a8ce1bb630,g9726552aa6+8047e3811d,ga5288a1d22+e532dc0a0b,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+37c5a29d61,gcf0d15dbbd+2acd6d4d48,gd7358e8bfb+778a810b6e,gda3e153d99+82efc23009,gda6a2b7d83+2acd6d4d48,gdaeeff99f8+1711a396fd,ge2409df99d+6b12de1076,ge79ae78c31+37c5a29d61,gf0baf85859+d0a5978c5a,gf3967379c6+4954f8c433,gfb92a5be7c+82efc23009,gfec2e1e490+2aaed99252,w.2024.46
LSST Data Management Base Package
Loading...
Searching...
No Matches
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"
34#include "lsst/geom/Point.h"
36#include "lsst/afw/table/misc.h" // for RecordId
39
40namespace lsst {
41namespace afw {
42namespace image {
43
45enum class RotType {
46 UNKNOWN,
48 SKY,
51 HORIZON,
54 MOUNT
55};
56
69public:
98 explicit VisitInfo(double exposureTime, double darkTime, daf::base::DateTime const &date, double ut1,
100 lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass,
102 coord::Observatory const &observatory, coord::Weather const &weather,
103 std::string const &instrumentLabel, table::RecordId const &id, double focusZ,
105 std::string const &observationReason, std::string const &object,
107 : _exposureTime(exposureTime),
108 _darkTime(darkTime),
109 _date(date),
110 _ut1(ut1),
111 _era(era),
112 _boresightRaDec(boresightRaDec),
113 _boresightAzAlt(boresightAzAlt),
114 _boresightAirmass(boresightAirmass),
115 _boresightRotAngle(boresightRotAngle),
116 _rotType(rotType),
117 _observatory(observatory),
118 _weather(weather),
119 _instrumentLabel(instrumentLabel),
120 _id(id),
121 _focusZ(focusZ),
122 _observationType(observationType),
123 _scienceProgram(scienceProgram),
124 _observationReason(observationReason),
125 _object(object),
126 _hasSimulatedContent(hasSimulatedContent) {}
127
128 explicit VisitInfo(daf::base::PropertySet const &metadata);
129
130 ~VisitInfo() override = default;
131
132 VisitInfo(VisitInfo const &) = default;
133 VisitInfo(VisitInfo &&) = default;
134 VisitInfo &operator=(VisitInfo const &) = default;
136
137 bool operator==(VisitInfo const &other) const;
138 bool operator!=(VisitInfo const &other) const { return !(*this == other); };
139
141 std::size_t hash_value() const noexcept override;
142
144 double getExposureTime() const { return _exposureTime; }
145
147 double getDarkTime() const { return _darkTime; }
148
150 daf::base::DateTime getDate() const { return _date; }
151
153 double getUt1() const { return _ut1; }
154
156 lsst::geom::Angle getEra() const { return _era; }
157
160 lsst::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
161
164 lsst::geom::SpherePoint getBoresightAzAlt() const { return _boresightAzAlt; }
165
168 double getBoresightAirmass() const { return _boresightAirmass; }
169
176 lsst::geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
177
179 RotType getRotType() const { return _rotType; }
180
182 coord::Observatory getObservatory() const { return _observatory; }
183
185 coord::Weather getWeather() const { return _weather; }
186
187 bool isPersistable() const noexcept override { return true; }
188
189 // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
191
192 // get hour angle at the boresight
194
195 std::string getInstrumentLabel() const { return _instrumentLabel; }
196
197 table::RecordId getId() const { return _id; }
198
199 // get defocal distance (mm)
200 double getFocusZ() const { return _focusZ; }
201
202 std::string getObservationType() const { return _observationType; }
203 std::string getScienceProgram() const { return _scienceProgram; }
204 std::string getObservationReason() const { return _observationReason; }
205 std::string getObject() const { return _object; }
206 bool getHasSimulatedContent() const { return _hasSimulatedContent; }
207
218
221
223 std::string toString() const override;
224
230 bool equals(typehandling::Storable const &other) const noexcept override;
231
232protected:
233 std::string getPersistenceName() const override;
234
235 void write(OutputArchiveHandle &handle) const override;
236
237private:
238 double _exposureTime;
239 double _darkTime;
241 double _ut1;
243 lsst::geom::SpherePoint _boresightRaDec;
244 lsst::geom::SpherePoint _boresightAzAlt;
245 double _boresightAirmass;
246 lsst::geom::Angle _boresightRotAngle;
247 RotType _rotType;
248 coord::Observatory _observatory;
249 coord::Weather _weather;
250 std::string _instrumentLabel;
251 table::RecordId _id;
252 double _focusZ;
253 std::string _observationType;
254 std::string _scienceProgram;
255 std::string _observationReason;
256 std::string _object;
257 bool _hasSimulatedContent;
258};
259
260std::ostream &operator<<(std::ostream &os, VisitInfo const &visitInfo);
261
262namespace detail {
263
270void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
271
280
281} // namespace detail
282} // namespace image
283} // namespace afw
284} // namespace lsst
285
286namespace std {
287template <>
288struct hash<lsst::afw::image::VisitInfo> {
291 size_t operator()(argument_type const &obj) const noexcept { return obj.hash_value(); }
292};
293} // namespace std
294
295#endif // !LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
table::Key< int > id
Definition Detector.cc:162
table::Key< std::string > observationReason
Definition VisitInfo.cc:231
table::Key< std::string > scienceProgram
Definition VisitInfo.cc:230
table::Key< std::string > observationType
Definition VisitInfo.cc:229
table::Key< double > exposureTime
Definition VisitInfo.cc:202
table::Key< lsst::geom::Angle > era
Definition VisitInfo.cc:206
table::Key< int > rotType
Definition VisitInfo.cc:212
table::Key< double > darkTime
Definition VisitInfo.cc:203
table::Key< std::string > instrumentLabel
Definition VisitInfo.cc:222
table::CoordKey boresightRaDec
Definition VisitInfo.cc:207
table::Key< double > boresightAirmass
Definition VisitInfo.cc:210
table::Key< afw::table::Flag > hasSimulatedContent
Definition VisitInfo.cc:233
table::Key< double > focusZ
Definition VisitInfo.cc:227
table::Key< lsst::geom::Angle > boresightRotAngle
Definition VisitInfo.cc:211
table::Key< double > ut1
Definition VisitInfo.cc:205
Basic LSST definitions.
Hold the location of an observatory.
Definition Observatory.h:43
Basic weather information sufficient for a simple model for air mass or refraction.
Definition Weather.h:38
Information about a single exposure of an imaging camera.
Definition VisitInfo.h:68
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Definition VisitInfo.cc:574
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition VisitInfo.h:150
VisitInfo(VisitInfo const &)=default
coord::Weather getWeather() const
get basic weather information
Definition VisitInfo.h:185
VisitInfo(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, std::string const &instrumentLabel, table::RecordId const &id, double focusZ, std::string const &observationType, std::string const &scienceProgram, std::string const &observationReason, std::string const &object, bool hasSimulatedContent)
Construct a VisitInfo.
Definition VisitInfo.h:98
lsst::geom::Angle getLocalEra() const
Definition VisitInfo.cc:612
~VisitInfo() override=default
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition VisitInfo.h:153
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure,...
Definition VisitInfo.h:168
std::string getScienceProgram() const
Definition VisitInfo.h:203
lsst::geom::Angle getBoresightHourAngle() const
Definition VisitInfo.cc:614
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition VisitInfo.h:176
VisitInfo & operator=(VisitInfo const &)=default
std::size_t hash_value() const noexcept override
Return a hash of this object.
Definition VisitInfo.cc:566
bool operator==(VisitInfo const &other) const
Definition VisitInfo.cc:551
bool operator!=(VisitInfo const &other) const
Definition VisitInfo.h:138
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition VisitInfo.h:156
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
Definition VisitInfo.h:187
table::RecordId getId() const
Definition VisitInfo.h:197
VisitInfo & operator=(VisitInfo &&)=default
std::string getObservationReason() const
Definition VisitInfo.h:204
std::string toString() const override
Create a string representation of this object.
Definition VisitInfo.cc:638
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition VisitInfo.h:144
RotType getRotType() const
get rotation type of boresightRotAngle
Definition VisitInfo.h:179
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Definition VisitInfo.cc:634
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:164
std::string getObject() const
Definition VisitInfo.h:205
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:160
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new VisitInfo that is a copy of this one.
Definition VisitInfo.cc:630
VisitInfo(VisitInfo &&)=default
std::string getInstrumentLabel() const
Definition VisitInfo.h:195
bool getHasSimulatedContent() const
Definition VisitInfo.h:206
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)
Definition VisitInfo.h:147
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition VisitInfo.h:182
lsst::geom::Angle getBoresightParAngle() const
Get parallactic angle at the boresight.
Definition VisitInfo.cc:616
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition VisitInfo.cc:576
std::string getObservationType() const
Definition VisitInfo.h:202
A CRTP facade class for subclasses of Persistable.
io::OutputArchiveHandle OutputArchiveHandle
Interface supporting iteration over heterogenous containers.
Definition Storable.h:58
Class for handling dates/times, including MJD, UTC, and TAI.
Definition DateTime.h:64
Class for storing ordered metadata with comments.
Class for storing generic metadata.
Definition PropertySet.h:66
A class representing an angle.
Definition Angle.h:128
Point in an unspecified spherical coordinate system.
Definition SpherePoint.h:57
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition VisitInfo.cc:389
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition VisitInfo.cc:408
std::ostream & operator<<(std::ostream &os, Measurement const &measurement)
Definition PhotoCalib.cc:48
RotType
Type of rotation.
Definition VisitInfo.h:45
@ HORIZON
Position angle of focal plane +Y, measured from +Alt through +Az.
@ MOUNT
The position sent to the instrument rotator; the details depend on the rotator.
@ UNKNOWN
Rotation angle is unknown.
@ SKY
Position angle of focal plane +Y, measured from N through E.
STL namespace.
decltype(sizeof(void *)) size_t
Definition doctest.h:524
size_t operator()(argument_type const &obj) const noexcept
Definition VisitInfo.h:291
Key< int > visitInfo
Definition Exposure.cc:70