LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
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:
91 // TODO: remove exposureId on DM-32138
93 daf::base::DateTime const &date, double ut1, lsst::geom::Angle const &era,
95 lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass,
97 coord::Observatory const &observatory, coord::Weather const &weather,
99 : _exposureId(exposureId),
100 _exposureTime(exposureTime),
101 _darkTime(darkTime),
102 _date(date),
103 _ut1(ut1),
104 _era(era),
105 _boresightRaDec(boresightRaDec),
106 _boresightAzAlt(boresightAzAlt),
107 _boresightAirmass(boresightAirmass),
108 _boresightRotAngle(boresightRotAngle),
109 _rotType(rotType),
110 _observatory(observatory),
111 _weather(weather),
112 _instrumentLabel(instrumentLabel),
113 _id(id){};
114
115 explicit VisitInfo(daf::base::PropertySet const &metadata);
116
117 ~VisitInfo() override = default;
118
119 VisitInfo(VisitInfo const &) = default;
120 VisitInfo(VisitInfo &&) = default;
121 VisitInfo &operator=(VisitInfo const &) = default;
123
124 bool operator==(VisitInfo const &other) const;
125 bool operator!=(VisitInfo const &other) const { return !(*this == other); };
126
128 std::size_t hash_value() const noexcept override;
129
131 // TODO: remove on DM-32138
132 [[deprecated(
133 "Replaced by VisitInfo::getId() for full focal plane identifiers and by "
134 "ExposureInfo::getId() for detector-level identifiers. Will be removed after v25.")]] table::
137 return _exposureId;
138 }
139
141 double getExposureTime() const { return _exposureTime; }
142
144 double getDarkTime() const { return _darkTime; }
145
147 daf::base::DateTime getDate() const { return _date; }
148
150 double getUt1() const { return _ut1; }
151
153 lsst::geom::Angle getEra() const { return _era; }
154
157 lsst::geom::SpherePoint getBoresightRaDec() const { return _boresightRaDec; }
158
161 lsst::geom::SpherePoint getBoresightAzAlt() const { return _boresightAzAlt; }
162
165 double getBoresightAirmass() const { return _boresightAirmass; }
166
173 lsst::geom::Angle getBoresightRotAngle() const { return _boresightRotAngle; }
174
176 RotType getRotType() const { return _rotType; }
177
179 coord::Observatory getObservatory() const { return _observatory; }
180
182 coord::Weather getWeather() const { return _weather; }
183
184 bool isPersistable() const noexcept override { return true; }
185
186 // get the local sidereal time on the meridian (equivalent, but not equal, to Local Mean Sidereal Time)
188
189 // get hour angle at the boresight
191
192 std::string getInstrumentLabel() const { return _instrumentLabel; }
193
194 table::RecordId getId() const { return _id; }
195
206
209
211 std::string toString() const override;
212
218 bool equals(typehandling::Storable const &other) const noexcept override;
219
220protected:
221 std::string getPersistenceName() const override;
222
223 void write(OutputArchiveHandle &handle) const override;
224
225private:
226 table::RecordId _exposureId; // TODO: remove on DM-32138
227 double _exposureTime;
228 double _darkTime;
230 double _ut1;
232 lsst::geom::SpherePoint _boresightRaDec;
233 lsst::geom::SpherePoint _boresightAzAlt;
234 double _boresightAirmass;
235 lsst::geom::Angle _boresightRotAngle;
236 RotType _rotType;
237 coord::Observatory _observatory;
238 coord::Weather _weather;
239 std::string _instrumentLabel;
240 table::RecordId _id;
241};
242
243std::ostream &operator<<(std::ostream &os, VisitInfo const &visitInfo);
244
245namespace detail {
246
253void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo);
254
263
264} // namespace detail
265} // namespace image
266} // namespace afw
267} // namespace lsst
268
269namespace std {
270template <>
271struct hash<lsst::afw::image::VisitInfo> {
274 size_t operator()(argument_type const &obj) const noexcept { return obj.hash_value(); }
275};
276} // namespace std
277
278#endif // !LSST_AFW_IMAGE_VISITINFO_H_INCLUDED
table::Key< int > id
Definition: Detector.cc:162
table::Key< int > detector
std::ostream * os
Definition: Schema.cc:557
table::Key< double > exposureTime
Definition: VisitInfo.cc:200
table::Key< lsst::geom::Angle > era
Definition: VisitInfo.cc:204
table::Key< int > rotType
Definition: VisitInfo.cc:210
table::Key< double > darkTime
Definition: VisitInfo.cc:201
table::Key< std::string > instrumentLabel
Definition: VisitInfo.cc:220
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:205
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:208
table::Key< lsst::geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:209
table::Key< double > ut1
Definition: VisitInfo.cc:203
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:199
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:512
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:147
VisitInfo(VisitInfo const &)=default
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:182
lsst::geom::Angle getLocalEra() const
Definition: VisitInfo.cc:545
~VisitInfo() override=default
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:150
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure,...
Definition: VisitInfo.h:165
lsst::geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:547
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:173
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:136
VisitInfo & operator=(VisitInfo const &)=default
std::size_t hash_value() const noexcept override
Return a hash of this object.
Definition: VisitInfo.cc:505
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:493
bool operator!=(VisitInfo const &other) const
Definition: VisitInfo.h:125
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:153
bool isPersistable() const noexcept override
Return true if this particular object can be persisted using afw::table::io.
Definition: VisitInfo.h:184
table::RecordId getId() const
Definition: VisitInfo.h:194
VisitInfo & operator=(VisitInfo &&)=default
std::string toString() const override
Create a string representation of this object.
Definition: VisitInfo.cc:571
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:141
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:176
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)
Construct a VisitInfo.
Definition: VisitInfo.h:92
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Definition: VisitInfo.cc:567
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:161
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:157
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new VisitInfo that is a copy of this one.
Definition: VisitInfo.cc:563
VisitInfo(VisitInfo &&)=default
std::string getInstrumentLabel() const
Definition: VisitInfo.h:192
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)
Definition: VisitInfo.h:144
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:179
lsst::geom::Angle getBoresightParAngle() const
Get parallactic angle at the boresight.
Definition: VisitInfo.cc:549
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition: VisitInfo.cc:514
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:346
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:363
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
std::ostream & operator<<(std::ostream &os, Measurement const &measurement)
Definition: PhotoCalib.cc:47
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.
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:21
A base class for image defects.
STL namespace.
size_t operator()(argument_type const &obj) const noexcept
Definition: VisitInfo.h:274
Key< int > visitInfo
Definition: Exposure.cc:70