LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
LSSTDataManagementBasePackage
VisitInfo.cc
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 #include <cmath>
24 #include <cstdint>
25 #include <limits>
26 #include <sstream>
27 
28 #include "boost/algorithm/string/trim.hpp"
29 
30 #include "lsst/utils/hashCombine.h"
31 #include "lsst/pex/exceptions.h"
32 #include "lsst/geom/Angle.h"
33 #include "lsst/geom/SpherePoint.h"
34 #include "lsst/afw/table/Key.h"
35 #include "lsst/afw/table/aggregates.h" // for CoordKey
36 #include "lsst/afw/table/Schema.h"
37 #include "lsst/afw/table/misc.h" // for RecordId
40 #include "lsst/afw/table/io/CatalogVector.h" // needed, but why?
42 #include "lsst/afw/table/io/Persistable.cc"
43 
45 
46 namespace lsst {
47 namespace afw {
48 
51 
52 namespace image {
53 
54 // the following persistence-related code emulates that in Calib.cc
55 
56 namespace {
57 
59 
68 double getDouble(daf::base::PropertySet const& metadata, std::string const& key) {
69  return metadata.exists(key) ? metadata.getAsDouble(key) : nan;
70 }
71 
80 lsst::geom::Angle getAngle(daf::base::PropertySet const& metadata, std::string const& key) {
81  return getDouble(metadata, key) * lsst::geom::degrees;
82 }
83 
92 bool setDouble(daf::base::PropertySet& metadata, std::string const& key, double value,
93  std::string const& comment) {
94  if (std::isfinite(value)) {
95  metadata.set(key, value);
96  return true;
97  }
98  return false;
99 }
100 
109 bool setAngle(daf::base::PropertySet& metadata, std::string const& key, lsst::geom::Angle const& angle,
110  std::string const& comment) {
111  return setDouble(metadata, key, angle.asDegrees(), comment);
112 }
113 
119 std::string rotTypeStrFromEnum(RotType rotType) {
120  switch (rotType) {
121  case RotType::UNKNOWN:
122  return "UNKNOWN";
123  case RotType::SKY:
124  return "SKY";
125  case RotType::HORIZON:
126  return "HORIZON";
127  case RotType::MOUNT:
128  return "MOUNT";
129  }
131  os << "Unknown RotType enum: " << static_cast<int>(rotType);
133 }
134 
140 RotType rotTypeEnumFromStr(std::string const& rotTypeName) {
141  if (rotTypeName == "UNKNOWN") {
142  return RotType::UNKNOWN;
143  } else if (rotTypeName == "SKY") {
144  return RotType::SKY;
145  } else if (rotTypeName == "HORIZON") {
146  return RotType::HORIZON;
147  } else if (rotTypeName == "MOUNT") {
148  return RotType::MOUNT;
149  }
151  os << "Unknown RotType name: \"" << rotTypeName << "\"";
153 }
154 
155 class VisitInfoSchema {
156 public:
157  table::Schema schema;
158  table::Key<table::RecordId> exposureId;
159  table::Key<double> exposureTime;
160  table::Key<double> darkTime;
161  table::Key<std::int64_t> tai;
162  table::Key<double> ut1;
163  table::Key<lsst::geom::Angle> era;
164  table::CoordKey boresightRaDec;
165  table::Key<lsst::geom::Angle> boresightAzAlt_az;
166  table::Key<lsst::geom::Angle> boresightAzAlt_alt;
167  table::Key<double> boresightAirmass;
168  table::Key<lsst::geom::Angle> boresightRotAngle;
169  table::Key<int> rotType;
170  // observatory data
171  table::Key<lsst::geom::Angle> latitude;
172  table::Key<lsst::geom::Angle> longitude;
173  table::Key<double> elevation;
174  // weather data
175  table::Key<double> airTemperature;
176  table::Key<double> airPressure;
177  table::Key<double> humidity;
178 
179  static VisitInfoSchema const& get() {
180  static VisitInfoSchema instance;
181  return instance;
182  }
183 
184  // No copying
185  VisitInfoSchema(const VisitInfoSchema&) = delete;
186  VisitInfoSchema& operator=(const VisitInfoSchema&) = delete;
187 
188  // No moving
189  VisitInfoSchema(VisitInfoSchema&&) = delete;
190  VisitInfoSchema& operator=(VisitInfoSchema&&) = delete;
191 
192 private:
193  VisitInfoSchema()
194  : schema(),
195  exposureId(schema.addField<table::RecordId>("exposureid", "exposure ID", "")),
196  exposureTime(schema.addField<double>("exposuretime", "exposure duration", "s")),
197  darkTime(schema.addField<double>("darktime", "time from CCD flush to readout", "s")),
198  tai(schema.addField<std::int64_t>(
199  "tai", "TAI date and time at middle of exposure as nsec from unix epoch", "nsec")),
200  ut1(schema.addField<double>("ut1", "UT1 date and time at middle of exposure", "MJD")),
201  era(schema.addField<lsst::geom::Angle>("era", "earth rotation angle at middle of exposure",
202  "")),
203  boresightRaDec(table::CoordKey::addFields(schema, "boresightradec",
204  "sky position of boresight at middle of exposure")),
205  // CoordKey is intended for ICRS coordinates, so use a pair of lsst::geom::Angle fields
206  // to save boresightAzAlt
207  boresightAzAlt_az(schema.addField<lsst::geom::Angle>(
208  "boresightazalt_az",
209  "refracted apparent topocentric position of boresight at middle of exposure", "")),
210  boresightAzAlt_alt(schema.addField<lsst::geom::Angle>(
211  "boresightazalt_alt",
212  "refracted apparent topocentric position of boresight at middle of exposure", "")),
213  boresightAirmass(schema.addField<double>(
214  "boresightairmass", "airmass at boresight, relative to zenith at sea level", "")),
215  boresightRotAngle(schema.addField<lsst::geom::Angle>(
216  "boresightrotangle", "rotation angle at boresight at middle of exposure", "")),
217  rotType(schema.addField<int>("rottype", "rotation type; see VisitInfo.getRotType for details",
218  "MJD")),
219  // observatory data
220  latitude(schema.addField<lsst::geom::Angle>(
221  "latitude", "latitude of telescope (+ is east of Greenwich)", "")),
222  longitude(schema.addField<lsst::geom::Angle>("longitude", "longitude of telescope", "")),
223  elevation(schema.addField<double>("elevation", "elevation of telescope", "")),
224  // weather data
225  airTemperature(schema.addField<double>("airtemperature", "air temperature", "C")),
226  airPressure(schema.addField<double>("airpressure", "air pressure", "Pascal")),
227  humidity(schema.addField<double>("humidity", "humidity (%)", "")) {
228  schema.getCitizen().markPersistent();
229  }
230 };
231 
232 class VisitInfoFactory : public table::io::PersistableFactory {
233 public:
234  std::shared_ptr<table::io::Persistable> read(InputArchive const& archive,
235  CatalogVector const& catalogs) const override {
236  VisitInfoSchema const& keys = VisitInfoSchema::get();
237  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
238  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
239  LSST_ARCHIVE_ASSERT(catalogs.front().getSchema() == keys.schema);
240  table::BaseRecord const& record = catalogs.front().front();
242  new VisitInfo(record.get(keys.exposureId), record.get(keys.exposureTime),
243  record.get(keys.darkTime), ::DateTime(record.get(keys.tai), ::DateTime::TAI),
244  record.get(keys.ut1), record.get(keys.era), record.get(keys.boresightRaDec),
245  lsst::geom::SpherePoint(record.get(keys.boresightAzAlt_az),
246  record.get(keys.boresightAzAlt_alt)),
247  record.get(keys.boresightAirmass), record.get(keys.boresightRotAngle),
248  static_cast<RotType>(record.get(keys.rotType)),
249  coord::Observatory(record.get(keys.longitude), record.get(keys.latitude),
250  record.get(keys.elevation)),
251  coord::Weather(record.get(keys.airTemperature), record.get(keys.airPressure),
252  record.get(keys.humidity))));
253  return result;
254  }
255 
256  explicit VisitInfoFactory(std::string const& name) : table::io::PersistableFactory(name) {}
257 };
258 
259 std::string getVisitInfoPersistenceName() { return "VisitInfo"; }
260 
261 VisitInfoFactory registration(getVisitInfoPersistenceName());
262 
263 } // namespace
264 
265 namespace detail {
266 
268  int nstripped = 0;
269 
270  std::vector<std::string> keyList = {
271  "EXPID", "EXPTIME", "DARKTIME", "DATE-AVG", "TIMESYS", "TIME-MID", "MJD-AVG-UT1",
272  "AVG-ERA", "BORE-RA", "BORE-DEC", "BORE-AZ", "BORE-ALT", "BORE-AIRMASS", "BORE-ROTANG",
273  "ROTTYPE", "OBS-LONG", "OBS-LAT", "OBS-ELEV", "AIRTEMP", "AIRPRESS", "HUMIDITY"};
274  for (auto&& key : keyList) {
275  if (metadata.exists(key)) {
276  metadata.remove(key);
277  nstripped++;
278  }
279  }
280  return nstripped;
281 }
282 
284  if (visitInfo.getExposureId() != 0) {
285  metadata.set("EXPID", visitInfo.getExposureId());
286  }
287  setDouble(metadata, "EXPTIME", visitInfo.getExposureTime(), "Exposure time (sec)");
288  setDouble(metadata, "DARKTIME", visitInfo.getDarkTime(), "Time from CCD flush to readout (sec)");
289  if (visitInfo.getDate().isValid()) {
290  metadata.set("DATE-AVG", visitInfo.getDate().toString(::DateTime::TAI),
291  "TAI date at middle of observation");
292  metadata.set("TIMESYS", "TAI");
293  }
294  setDouble(metadata, "MJD-AVG-UT1", visitInfo.getUt1(), "UT1 MJD date at ctr of obs");
295  setAngle(metadata, "AVG-ERA", visitInfo.getEra(), "Earth rot ang at ctr of obs (deg)");
296  auto boresightRaDec = visitInfo.getBoresightRaDec();
297  setAngle(metadata, "BORE-RA", boresightRaDec[0], "ICRS RA (deg) at boresight");
298  setAngle(metadata, "BORE-DEC", boresightRaDec[1], "ICRS Dec (deg) at boresight");
299  auto boresightAzAlt = visitInfo.getBoresightAzAlt();
300  setAngle(metadata, "BORE-AZ", boresightAzAlt[0], "Refr app topo az (deg) at bore");
301  setAngle(metadata, "BORE-ALT", boresightAzAlt[1], "Refr app topo alt (deg) at bore");
302  setDouble(metadata, "BORE-AIRMASS", visitInfo.getBoresightAirmass(), "Airmass at boresight");
303  setAngle(metadata, "BORE-ROTANG", visitInfo.getBoresightRotAngle(), "Rotation angle (deg) at boresight");
304  metadata.set("ROTTYPE", rotTypeStrFromEnum(visitInfo.getRotType()), "Type of rotation angle");
305  auto observatory = visitInfo.getObservatory();
306  setAngle(metadata, "OBS-LONG", observatory.getLongitude(), "Telescope longitude (+E, deg)");
307  setAngle(metadata, "OBS-LAT", observatory.getLatitude(), "Telescope latitude (deg)");
308  setDouble(metadata, "OBS-ELEV", observatory.getElevation(), "Telescope elevation (m)");
309  auto weather = visitInfo.getWeather();
310  setDouble(metadata, "AIRTEMP", weather.getAirTemperature(), "Outside air temperature (C)");
311  setDouble(metadata, "AIRPRESS", weather.getAirPressure(), "Outdoor air pressure (P)");
312  setDouble(metadata, "HUMIDITY", weather.getHumidity(), "Relative humidity (%)");
313 }
314 
315 } // namespace detail
316 
317 VisitInfo::VisitInfo(daf::base::PropertySet const& metadata)
318  : _exposureId(0),
319  _exposureTime(nan), // don't use getDouble because str values are also accepted
320  _darkTime(getDouble(metadata, "DARKTIME")),
321  _date(),
322  _ut1(getDouble(metadata, "MJD-AVG-UT1")),
323  _era(getAngle(metadata, "AVG-ERA")),
324  _boresightRaDec(
325  lsst::geom::SpherePoint(getAngle(metadata, "BORE-RA"), getAngle(metadata, "BORE-DEC"))),
326  _boresightAzAlt(
327  lsst::geom::SpherePoint(getAngle(metadata, "BORE-AZ"), getAngle(metadata, "BORE-ALT"))),
328  _boresightAirmass(getDouble(metadata, "BORE-AIRMASS")),
329  _boresightRotAngle(getAngle(metadata, "BORE-ROTANG")),
330  _rotType(RotType::UNKNOWN),
331  _observatory(getAngle(metadata, "OBS-LONG"), getAngle(metadata, "OBS-LAT"),
332  getDouble(metadata, "OBS-ELEV")),
333  _weather(getDouble(metadata, "AIRTEMP"), getDouble(metadata, "AIRPRESS"),
334  getDouble(metadata, "HUMIDITY")) {
335  auto key = "EXPID";
336  if (metadata.exists(key)) {
337  _exposureId = metadata.getAsInt64(key);
338  }
339 
340  key = "EXPTIME";
341  if (metadata.exists(key)) {
342  try {
343  _exposureTime = metadata.getAsDouble(key);
344  } catch (lsst::pex::exceptions::TypeError& err) {
345  // some old exposures have EXPTIME stored as a string
346  std::string exptimeStr = metadata.getAsString(key);
347  _exposureTime = std::stod(exptimeStr);
348  }
349  }
350 
351  key = "DATE-AVG";
352  if (metadata.exists(key)) {
353  if (metadata.exists("TIMESYS")) {
354  auto timesysName = boost::algorithm::trim_right_copy(metadata.getAsString("TIMESYS"));
355  if (timesysName != "TAI") {
356  // rather than try to deal with all the possible choices, which requires
357  // appending or deleting a "Z", depending on the time system, just give up.
358  // VisitInfo should be used on FITS headers that have been sanitized!
360  os << "TIMESYS = \"" << timesysName
361  << "\"; VisitInfo requires TIMESYS to exist and to equal \"TAI\"";
363  }
364  } else {
366  "TIMESYS not found; VistitInfo requires TIMESYS to exist and to equal \"TAI\"");
367  }
368  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::TAI);
369  } else {
370  // DATE-AVG not found. For backwards compatibility look for TIME-MID, an outdated LSST keyword
371  // whose time system was UTC, despite a FITS comment claiming it was TAI. Ignore TIMESYS.
372  key = "TIME-MID";
373  if (metadata.exists(key)) {
374  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::UTC);
375  }
376  }
377 
378  key = "ROTTYPE";
379  if (metadata.exists(key)) {
380  _rotType = rotTypeEnumFromStr(metadata.getAsString(key));
381  }
382 }
383 
385  return _exposureId == other.getExposureId() && _exposureTime == other.getExposureTime() &&
386  _darkTime == other.getDarkTime() && _date == other.getDate() && _ut1 == other.getUt1() &&
387  _era == other.getEra() && _boresightRaDec == other.getBoresightRaDec() &&
388  _boresightAzAlt == other.getBoresightAzAlt() && _boresightAirmass == other.getBoresightAirmass() &&
389  _boresightRotAngle == other.getBoresightRotAngle() && _rotType == other.getRotType() &&
390  _observatory == other.getObservatory() && _weather == other.getWeather();
391 }
392 
394  // Completely arbitrary seed
395  return utils::hashCombine(17, _exposureId, _exposureTime, _darkTime, _date, _ut1, _era, _boresightRaDec,
396  _boresightAzAlt, _boresightAirmass, _boresightRotAngle, _rotType, _observatory,
397  _weather);
398 }
399 
400 std::string VisitInfo::getPersistenceName() const { return getVisitInfoPersistenceName(); }
401 
403  VisitInfoSchema const& keys = VisitInfoSchema::get();
404  table::BaseCatalog cat = handle.makeCatalog(keys.schema);
406  record->set(keys.exposureId, getExposureId());
407  record->set(keys.exposureTime, getExposureTime());
408  record->set(keys.darkTime, getDarkTime());
409  record->set(keys.tai, getDate().nsecs(::DateTime::TAI));
410  record->set(keys.ut1, getUt1());
411  record->set(keys.era, getEra());
412  record->set(keys.boresightRaDec, getBoresightRaDec());
413  auto boresightAzAlt = getBoresightAzAlt();
414  record->set(keys.boresightAzAlt_az, boresightAzAlt[0]);
415  record->set(keys.boresightAzAlt_alt, boresightAzAlt[1]);
416  record->set(keys.boresightAirmass, getBoresightAirmass());
417  record->set(keys.boresightRotAngle, getBoresightRotAngle());
418  record->set(keys.rotType, static_cast<int>(getRotType()));
419  auto observatory = getObservatory();
420  record->set(keys.latitude, observatory.getLatitude());
421  record->set(keys.longitude, observatory.getLongitude());
422  record->set(keys.elevation, observatory.getElevation());
423  auto weather = getWeather();
424  record->set(keys.airTemperature, weather.getAirTemperature());
425  record->set(keys.airPressure, weather.getAirPressure());
426  record->set(keys.humidity, weather.getHumidity());
427  handle.saveCatalog(cat);
428 }
429 
431 
433 
439  double _parallactic_y, _parallactic_x, result;
440  _parallactic_y = sin(getBoresightHourAngle().asRadians());
441  _parallactic_x =
442  cos((getBoresightRaDec()[1]).asRadians()) * tan(getObservatory().getLatitude().asRadians()) -
443  sin((getBoresightRaDec()[1]).asRadians()) * cos(getBoresightHourAngle().asRadians());
444  result = atan2(_parallactic_y, _parallactic_x);
445  return result * lsst::geom::radians;
446 }
447 
449  os << "VisitInfo(";
450  os << "exposureId=" << visitInfo.getExposureId() << ", ";
451  os << "exposureTime=" << visitInfo.getExposureTime() << ", ";
452  os << "darkTime=" << visitInfo.getDarkTime() << ", ";
453  os << "date=" << visitInfo.getDate().toString(daf::base::DateTime::TAI) << ", ";
454  os << "UT1=" << visitInfo.getUt1() << ", ";
455  os << "ERA=" << visitInfo.getEra() << ", ";
456  os << "boresightRaDec=" << visitInfo.getBoresightRaDec() << ", ";
457  os << "boresightAzAlt=" << visitInfo.getBoresightAzAlt() << ", ";
458  os << "boresightAirmass=" << visitInfo.getBoresightAirmass() << ", ";
459  os << "boresightRotAngle=" << visitInfo.getBoresightRotAngle() << ", ";
460  os << "rotType=" << static_cast<int>(visitInfo.getRotType()) << ", ";
461  os << "observatory=" << visitInfo.getObservatory() << ", ";
462  os << "weather=" << visitInfo.getWeather();
463  os << ")";
464  return os;
465 }
466 
467 } // namespace image
468 } // namespace afw
469 } // namespace lsst
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:22
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure...
Definition: VisitInfo.h:151
double getAsDouble(std::string const &name) const
Get the last value for any arithmetic property name (possibly hierarchical).
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:147
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18
table::Key< lsst::geom::Angle > latitude
Definition: VisitInfo.cc:171
double get(DateSystem system=MJD, Timescale scale=TAI) const
Get date as a double in a specified representation, such as MJD.
Definition: DateTime.cc:429
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:64
constexpr double asDegrees() const noexcept
Return an Angle&#39;s value in degrees.
Definition: Angle.h:169
lsst::geom::Angle getLocalEra() const
Definition: VisitInfo.cc:430
An object passed to Persistable::write to allow it to persist itself.
table::Key< double > ut1
Definition: VisitInfo.cc:162
table::Key< double > airTemperature
Definition: VisitInfo.cc:175
Class for storing ordered metadata with comments.
Definition: PropertyList.h:68
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:164
RotType
Type of rotation.
Definition: VisitInfo.h:44
T stod(T... args)
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:67
py::object result
Definition: schema.cc:284
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:143
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:136
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.
std::string toString(Timescale scale) const
Get date as an ISO8601-formatted string.
Definition: DateTime.cc:499
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:167
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec) ...
Definition: VisitInfo.h:130
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
double sin(Angle const &a)
Definition: Angle.h:102
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:384
table::Key< lsst::geom::Angle > era
Definition: VisitInfo.cc:163
AngleUnit constexpr radians
constant with units of radians
Definition: Angle.h:108
table::Key< int > rotType
Definition: VisitInfo.cc:169
Rotation angle is unknown.
A class representing an angle.
Definition: Angle.h:127
double cos(Angle const &a)
Definition: Angle.h:103
STL class.
table::Key< lsst::geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:168
std::size_t hash_value() const noexcept
Return a hash of this object.
Definition: VisitInfo.cc:393
lsst::geom::Angle getLongitude() const noexcept
get telescope longitude (positive values are E of Greenwich)
Definition: Observatory.cc:48
table::Key< lsst::geom::Angle > boresightAzAlt_az
Definition: VisitInfo.cc:165
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:283
std::ostream & operator<<(std::ostream &os, VisitInfo const &visitInfo)
Definition: VisitInfo.cc:448
AngleUnit constexpr degrees
constant with units of degrees
Definition: Angle.h:109
A base class for image defects.
table::Key< double > exposureTime
Definition: VisitInfo.cc:159
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:124
int64_t getAsInt64(std::string const &name) const
Get the last value for a bool/char/short/int/int64_t property name (possibly hierarchical).
table::Key< lsst::geom::Angle > boresightAzAlt_alt
Definition: VisitInfo.cc:166
table::Key< double > humidity
Definition: VisitInfo.cc:177
double tan(Angle const &a)
Definition: Angle.h:104
T str(T... args)
T isfinite(T... args)
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:158
bool exists(std::string const &name) const
Determine if a name (possibly hierarchical) exists.
table::Key< double > elevation
Definition: VisitInfo.cc:173
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:127
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
table::Key< lsst::geom::Angle > longitude
Definition: VisitInfo.cc:172
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:162
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:139
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Definition: VisitInfo.cc:400
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
bool isValid() const
Is this date valid?
Definition: DateTime.h:202
table::Key< double > airPressure
Definition: VisitInfo.cc:176
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:133
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
Key< U > key
Definition: Schema.cc:281
Class for storing generic metadata.
Definition: PropertySet.h:68
static CoordKey addFields(afw::table::Schema &schema, std::string const &name, std::string const &doc)
Add a pair of _ra, _dec fields to a Schema, and return a CoordKey that points to them.
Definition: aggregates.cc:83
T nan(T... args)
table::Schema schema
Definition: VisitInfo.cc:157
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:267
lsst::geom::Angle getBoresightParAngle() const
Get parallactic angle at the boresight.
Definition: VisitInfo.cc:434
lsst::geom::SpherePoint SpherePoint
Definition: misc.h:35
ItemVariant const * other
Definition: Schema.cc:56
table::Key< std::int64_t > tai
Definition: VisitInfo.cc:161
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:159
std::string getAsString(std::string const &name) const
Get the last value for a string property name (possibly hierarchical).
T quiet_NaN(T... args)
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
std::size_t hashCombine(std::size_t seed) noexcept
Combine hashes.
Definition: hashCombine.h:35
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition: Runtime.h:167
table::Key< double > darkTime
Definition: VisitInfo.cc:160
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition: VisitInfo.cc:402
STL class.
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:165
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:168
lsst::geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:432
std::ostream * os
Definition: Schema.cc:746
Reports errors that are due to events beyond the control of the program.
Definition: Runtime.h:104
std::shared_ptr< RecordT > addNew()
Create a new record, add it to the end of the catalog, and return a pointer to it.
Definition: Catalog.h:472