LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
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:
99 // TODO: remove exposureId on DM-32138
101 daf::base::DateTime const &date, double ut1, lsst::geom::Angle const &era,
103 lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass,
105 coord::Observatory const &observatory, coord::Weather const &weather,
106 std::string const &instrumentLabel, table::RecordId const &id, double focusZ,
108 std::string const &observationReason, std::string const &object,
110 : _exposureId(exposureId),
111 _exposureTime(exposureTime),
112 _darkTime(darkTime),
113 _date(date),
114 _ut1(ut1),
115 _era(era),
116 _boresightRaDec(boresightRaDec),
117 _boresightAzAlt(boresightAzAlt),
118 _boresightAirmass(boresightAirmass),
119 _boresightRotAngle(boresightRotAngle),
120 _rotType(rotType),
121 _observatory(observatory),
122 _weather(weather),
123 _instrumentLabel(instrumentLabel),
124 _id(id),
125 _focusZ(focusZ),
126 _observationType(observationType),
127 _scienceProgram(scienceProgram),
128 _observationReason(observationReason),
129 _object(object),
130 _hasSimulatedContent(hasSimulatedContent) {}
131
132 explicit VisitInfo(daf::base::PropertySet const &metadata);
133
134 ~VisitInfo() override = default;
135
136 VisitInfo(VisitInfo const &) = default;
137 VisitInfo(VisitInfo &&) = default;
138 VisitInfo &operator=(VisitInfo const &) = default;
140
141 bool operator==(VisitInfo const &other) const;
142 bool operator!=(VisitInfo const &other) const { return !(*this == other); };
143
145 std::size_t hash_value() const noexcept override;
146
148 // TODO: remove on DM-32138
149 [[deprecated(
150 "Replaced by VisitInfo::getId() for full focal plane identifiers and by "
151 "ExposureInfo::getId() for detector-level identifiers. Will be removed after v25.")]] table::
152 RecordId
154 return _exposureId;
155 }
156
158 double getExposureTime() const { return _exposureTime; }
159
161 double getDarkTime() const { return _darkTime; }
162
164 daf::base::DateTime getDate() const { return _date; }
165
167 double getUt1() const { return _ut1; }
168
170 lsst::geom::Angle getEra() const { return _era; }
171
174 lsst::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
175
178 lsst::geom::SpherePoint getBoresightAzAlt() const { return _boresightAzAlt; }
179
182 double getBoresightAirmass() const { return _boresightAirmass; }
183
190 lsst::geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
191
193 RotType getRotType() const { return _rotType; }
194
196 coord::Observatory getObservatory() const { return _observatory; }
197
199 coord::Weather getWeather() const { return _weather; }
200
201 bool isPersistable() const noexcept override { return true; }
202
203 // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
205
206 // get hour angle at the boresight
208
209 std::string getInstrumentLabel() const { return _instrumentLabel; }
210
211 table::RecordId getId() const { return _id; }
212
213 // get defocal distance (mm)
214 double getFocusZ() const { return _focusZ; }
215
216 std::string getObservationType() const { return _observationType; }
217 std::string getScienceProgram() const { return _scienceProgram; }
218 std::string getObservationReason() const { return _observationReason; }
219 std::string getObject() const { return _object; }
220 bool getHasSimulatedContent() const { return _hasSimulatedContent; }
221
232
235
237 std::string toString() const override;
238
244 bool equals(typehandling::Storable const &other) const noexcept override;
245
246protected:
247 std::string getPersistenceName() const override;
248
249 void write(OutputArchiveHandle &handle) const override;
250
251private:
252 table::RecordId _exposureId; // TODO: remove on DM-32138
253 double _exposureTime;
254 double _darkTime;
256 double _ut1;
258 lsst::geom::SpherePoint _boresightRaDec;
259 lsst::geom::SpherePoint _boresightAzAlt;
260 double _boresightAirmass;
261 lsst::geom::Angle _boresightRotAngle;
262 RotType _rotType;
263 coord::Observatory _observatory;
264 coord::Weather _weather;
265 std::string _instrumentLabel;
266 table::RecordId _id;
267 double _focusZ;
268 std::string _observationType;
269 std::string _scienceProgram;
270 std::string _observationReason;
271 std::string _object;
272 bool _hasSimulatedContent;
273};
274
275std::ostream &operator<<(std::ostream &os, VisitInfo const &visitInfo);
276
277namespace detail {
278
285void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
286
295
296} // namespace detail
297} // namespace image
298} // namespace afw
299} // namespace lsst
300
301namespace std {
302template <>
303struct hash<lsst::afw::image::VisitInfo> {
306 size_t operator()(argument_type const &obj) const noexcept { return obj.hash_value(); }
307};
308} // namespace std
309
310#endif // !LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
table::Key< int > id
Definition: Detector.cc:162
table::Key< int > detector
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< std::string > object
Definition: VisitInfo.cc:232
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
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:201
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
A collection of all the things that make an Exposure different from a MaskedImage.
Definition: ExposureInfo.h:88
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:594
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:164
VisitInfo(VisitInfo const &)=default
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:199
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, 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:100
lsst::geom::Angle getLocalEra() const
Definition: VisitInfo.cc:633
~VisitInfo() override=default
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:167
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure,...
Definition: VisitInfo.h:182
std::string getScienceProgram() const
Definition: VisitInfo.h:217
lsst::geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:635
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:190
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:153
VisitInfo & operator=(VisitInfo const &)=default
std::size_t hash_value() const noexcept override
Return a hash of this object.
Definition: VisitInfo.cc:586
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:570
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:142
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:170
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
Definition: VisitInfo.h:201
table::RecordId getId() const
Definition: VisitInfo.h:211
double getFocusZ() const
Definition: VisitInfo.h:214
VisitInfo & operator=(VisitInfo &&)=default
std::string getObservationReason() const
Definition: VisitInfo.h:218
std::string toString() const override
Create a string representation of this object.
Definition: VisitInfo.cc:659
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:158
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:193
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Definition: VisitInfo.cc:655
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:178
std::string getObject() const
Definition: VisitInfo.h:219
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:174
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new VisitInfo that is a copy of this one.
Definition: VisitInfo.cc:651
VisitInfo(VisitInfo &&)=default
std::string getInstrumentLabel() const
Definition: VisitInfo.h:209
bool getHasSimulatedContent() const
Definition: VisitInfo.h:220
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)
Definition: VisitInfo.h:161
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:196
lsst::geom::Angle getBoresightParAngle() const
Get parallactic angle at the boresight.
Definition: VisitInfo.cc:637
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition: VisitInfo.cc:596
std::string getObservationType() const
Definition: VisitInfo.h:216
A CRTP facade class for subclasses of Persistable.
Definition: Persistable.h:176
io::OutputArchiveHandle OutputArchiveHandle
Definition: Persistable.h:108
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.
Definition: PropertyList.h:68
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:378
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:419
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.
size_t operator()(argument_type const &obj) const noexcept
Definition: VisitInfo.h:306
Key< int > visitInfo
Definition: Exposure.cc:70