LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
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?
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 };
229 
230 class VisitInfoFactory : public table::io::PersistableFactory {
231 public:
232  std::shared_ptr<table::io::Persistable> read(InputArchive const& archive,
233  CatalogVector const& catalogs) const override {
234  VisitInfoSchema const& keys = VisitInfoSchema::get();
235  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
236  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
237  LSST_ARCHIVE_ASSERT(catalogs.front().getSchema() == keys.schema);
238  table::BaseRecord const& record = catalogs.front().front();
240  new VisitInfo(record.get(keys.exposureId), record.get(keys.exposureTime),
241  record.get(keys.darkTime), ::DateTime(record.get(keys.tai), ::DateTime::TAI),
242  record.get(keys.ut1), record.get(keys.era), record.get(keys.boresightRaDec),
243  lsst::geom::SpherePoint(record.get(keys.boresightAzAlt_az),
244  record.get(keys.boresightAzAlt_alt)),
245  record.get(keys.boresightAirmass), record.get(keys.boresightRotAngle),
246  static_cast<RotType>(record.get(keys.rotType)),
247  coord::Observatory(record.get(keys.longitude), record.get(keys.latitude),
248  record.get(keys.elevation)),
249  coord::Weather(record.get(keys.airTemperature), record.get(keys.airPressure),
250  record.get(keys.humidity))));
251  return result;
252  }
253 
254  explicit VisitInfoFactory(std::string const& name) : table::io::PersistableFactory(name) {}
255 };
256 
257 std::string getVisitInfoPersistenceName() { return "VisitInfo"; }
258 
259 VisitInfoFactory registration(getVisitInfoPersistenceName());
260 
261 } // namespace
262 
263 namespace detail {
264 
266  int nstripped = 0;
267 
268  std::vector<std::string> keyList = {
269  "EXPID", "EXPTIME", "DARKTIME", "DATE-AVG", "TIMESYS", "TIME-MID", "MJD-AVG-UT1",
270  "AVG-ERA", "BORE-RA", "BORE-DEC", "BORE-AZ", "BORE-ALT", "BORE-AIRMASS", "BORE-ROTANG",
271  "ROTTYPE", "OBS-LONG", "OBS-LAT", "OBS-ELEV", "AIRTEMP", "AIRPRESS", "HUMIDITY"};
272  for (auto&& key : keyList) {
273  if (metadata.exists(key)) {
274  metadata.remove(key);
275  nstripped++;
276  }
277  }
278  return nstripped;
279 }
280 
282  if (visitInfo.getExposureId() != 0) {
283  metadata.set("EXPID", visitInfo.getExposureId());
284  }
285  setDouble(metadata, "EXPTIME", visitInfo.getExposureTime(), "Exposure time (sec)");
286  setDouble(metadata, "DARKTIME", visitInfo.getDarkTime(), "Time from CCD flush to readout (sec)");
287  if (visitInfo.getDate().isValid()) {
288  metadata.set("DATE-AVG", visitInfo.getDate().toString(::DateTime::TAI),
289  "TAI date at middle of observation");
290  metadata.set("TIMESYS", "TAI");
291  }
292  setDouble(metadata, "MJD-AVG-UT1", visitInfo.getUt1(), "UT1 MJD date at ctr of obs");
293  setAngle(metadata, "AVG-ERA", visitInfo.getEra(), "Earth rot ang at ctr of obs (deg)");
294  auto boresightRaDec = visitInfo.getBoresightRaDec();
295  setAngle(metadata, "BORE-RA", boresightRaDec[0], "ICRS RA (deg) at boresight");
296  setAngle(metadata, "BORE-DEC", boresightRaDec[1], "ICRS Dec (deg) at boresight");
297  auto boresightAzAlt = visitInfo.getBoresightAzAlt();
298  setAngle(metadata, "BORE-AZ", boresightAzAlt[0], "Refr app topo az (deg) at bore");
299  setAngle(metadata, "BORE-ALT", boresightAzAlt[1], "Refr app topo alt (deg) at bore");
300  setDouble(metadata, "BORE-AIRMASS", visitInfo.getBoresightAirmass(), "Airmass at boresight");
301  setAngle(metadata, "BORE-ROTANG", visitInfo.getBoresightRotAngle(), "Rotation angle (deg) at boresight");
302  metadata.set("ROTTYPE", rotTypeStrFromEnum(visitInfo.getRotType()), "Type of rotation angle");
303  auto observatory = visitInfo.getObservatory();
304  setAngle(metadata, "OBS-LONG", observatory.getLongitude(), "Telescope longitude (+E, deg)");
305  setAngle(metadata, "OBS-LAT", observatory.getLatitude(), "Telescope latitude (deg)");
306  setDouble(metadata, "OBS-ELEV", observatory.getElevation(), "Telescope elevation (m)");
307  auto weather = visitInfo.getWeather();
308  setDouble(metadata, "AIRTEMP", weather.getAirTemperature(), "Outside air temperature (C)");
309  setDouble(metadata, "AIRPRESS", weather.getAirPressure(), "Outdoor air pressure (P)");
310  setDouble(metadata, "HUMIDITY", weather.getHumidity(), "Relative humidity (%)");
311 }
312 
313 } // namespace detail
314 
315 VisitInfo::VisitInfo(daf::base::PropertySet const& metadata)
316  : _exposureId(0),
317  _exposureTime(nan), // don't use getDouble because str values are also accepted
318  _darkTime(getDouble(metadata, "DARKTIME")),
319  _date(),
320  _ut1(getDouble(metadata, "MJD-AVG-UT1")),
321  _era(getAngle(metadata, "AVG-ERA")),
322  _boresightRaDec(
323  lsst::geom::SpherePoint(getAngle(metadata, "BORE-RA"), getAngle(metadata, "BORE-DEC"))),
324  _boresightAzAlt(
325  lsst::geom::SpherePoint(getAngle(metadata, "BORE-AZ"), getAngle(metadata, "BORE-ALT"))),
326  _boresightAirmass(getDouble(metadata, "BORE-AIRMASS")),
327  _boresightRotAngle(getAngle(metadata, "BORE-ROTANG")),
328  _rotType(RotType::UNKNOWN),
329  _observatory(getAngle(metadata, "OBS-LONG"), getAngle(metadata, "OBS-LAT"),
330  getDouble(metadata, "OBS-ELEV")),
331  _weather(getDouble(metadata, "AIRTEMP"), getDouble(metadata, "AIRPRESS"),
332  getDouble(metadata, "HUMIDITY")) {
333  auto key = "EXPID";
334  if (metadata.exists(key)) {
335  _exposureId = metadata.getAsInt64(key);
336  }
337 
338  key = "EXPTIME";
339  if (metadata.exists(key)) {
340  try {
341  _exposureTime = metadata.getAsDouble(key);
342  } catch (lsst::pex::exceptions::TypeError& err) {
343  // some old exposures have EXPTIME stored as a string
344  std::string exptimeStr = metadata.getAsString(key);
345  _exposureTime = std::stod(exptimeStr);
346  }
347  }
348 
349  key = "DATE-AVG";
350  if (metadata.exists(key)) {
351  if (metadata.exists("TIMESYS")) {
352  auto timesysName = boost::algorithm::trim_right_copy(metadata.getAsString("TIMESYS"));
353  if (timesysName != "TAI") {
354  // rather than try to deal with all the possible choices, which requires
355  // appending or deleting a "Z", depending on the time system, just give up.
356  // VisitInfo should be used on FITS headers that have been sanitized!
358  os << "TIMESYS = \"" << timesysName
359  << "\"; VisitInfo requires TIMESYS to exist and to equal \"TAI\"";
361  }
362  } else {
364  "TIMESYS not found; VistitInfo requires TIMESYS to exist and to equal \"TAI\"");
365  }
366  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::TAI);
367  } else {
368  // DATE-AVG not found. For backwards compatibility look for TIME-MID, an outdated LSST keyword
369  // whose time system was UTC, despite a FITS comment claiming it was TAI. Ignore TIMESYS.
370  key = "TIME-MID";
371  if (metadata.exists(key)) {
372  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::UTC);
373  }
374  }
375 
376  key = "ROTTYPE";
377  if (metadata.exists(key)) {
378  _rotType = rotTypeEnumFromStr(metadata.getAsString(key));
379  }
380 }
381 
383  return _exposureId == other.getExposureId() && _exposureTime == other.getExposureTime() &&
384  _darkTime == other.getDarkTime() && _date == other.getDate() && _ut1 == other.getUt1() &&
385  _era == other.getEra() && _boresightRaDec == other.getBoresightRaDec() &&
386  _boresightAzAlt == other.getBoresightAzAlt() && _boresightAirmass == other.getBoresightAirmass() &&
387  _boresightRotAngle == other.getBoresightRotAngle() && _rotType == other.getRotType() &&
388  _observatory == other.getObservatory() && _weather == other.getWeather();
389 }
390 
392  // Completely arbitrary seed
393  return utils::hashCombine(17, _exposureId, _exposureTime, _darkTime, _date, _ut1, _era, _boresightRaDec,
394  _boresightAzAlt, _boresightAirmass, _boresightRotAngle, _rotType, _observatory,
395  _weather);
396 }
397 
398 std::string VisitInfo::getPersistenceName() const { return getVisitInfoPersistenceName(); }
399 
401  VisitInfoSchema const& keys = VisitInfoSchema::get();
402  table::BaseCatalog cat = handle.makeCatalog(keys.schema);
404  record->set(keys.exposureId, getExposureId());
405  record->set(keys.exposureTime, getExposureTime());
406  record->set(keys.darkTime, getDarkTime());
407  record->set(keys.tai, getDate().nsecs(::DateTime::TAI));
408  record->set(keys.ut1, getUt1());
409  record->set(keys.era, getEra());
410  record->set(keys.boresightRaDec, getBoresightRaDec());
411  auto boresightAzAlt = getBoresightAzAlt();
412  record->set(keys.boresightAzAlt_az, boresightAzAlt[0]);
413  record->set(keys.boresightAzAlt_alt, boresightAzAlt[1]);
414  record->set(keys.boresightAirmass, getBoresightAirmass());
415  record->set(keys.boresightRotAngle, getBoresightRotAngle());
416  record->set(keys.rotType, static_cast<int>(getRotType()));
417  auto observatory = getObservatory();
418  record->set(keys.latitude, observatory.getLatitude());
419  record->set(keys.longitude, observatory.getLongitude());
420  record->set(keys.elevation, observatory.getElevation());
421  auto weather = getWeather();
422  record->set(keys.airTemperature, weather.getAirTemperature());
423  record->set(keys.airPressure, weather.getAirPressure());
424  record->set(keys.humidity, weather.getHumidity());
425  handle.saveCatalog(cat);
426 }
427 
429 
431 
437  double _parallactic_y, _parallactic_x, result;
438  _parallactic_y = sin(getBoresightHourAngle().asRadians());
439  _parallactic_x =
440  cos((getBoresightRaDec()[1]).asRadians()) * tan(getObservatory().getLatitude().asRadians()) -
441  sin((getBoresightRaDec()[1]).asRadians()) * cos(getBoresightHourAngle().asRadians());
442  result = atan2(_parallactic_y, _parallactic_x);
443  return result * lsst::geom::radians;
444 }
445 
447  return std::make_unique<VisitInfo>(*this);
448 }
449 
450 bool VisitInfo::equals(typehandling::Storable const& other) const noexcept {
451  return singleClassEquals(*this, other);
452 }
453 
455  std::stringstream buffer;
456  buffer << "VisitInfo(";
457  buffer << "exposureId=" << getExposureId() << ", ";
458  buffer << "exposureTime=" << getExposureTime() << ", ";
459  buffer << "darkTime=" << getDarkTime() << ", ";
460  buffer << "date=" << getDate().toString(daf::base::DateTime::TAI) << ", ";
461  buffer << "UT1=" << getUt1() << ", ";
462  buffer << "ERA=" << getEra() << ", ";
463  buffer << "boresightRaDec=" << getBoresightRaDec() << ", ";
464  buffer << "boresightAzAlt=" << getBoresightAzAlt() << ", ";
465  buffer << "boresightAirmass=" << getBoresightAirmass() << ", ";
466  buffer << "boresightRotAngle=" << getBoresightRotAngle() << ", ";
467  buffer << "rotType=" << static_cast<int>(getRotType()) << ", ";
468  buffer << "observatory=" << getObservatory() << ", ";
469  buffer << "weather=" << getWeather();
470  buffer << ")";
471  return buffer.str();
472 }
473 
475  os << visitInfo.toString();
476  return os;
477 }
478 
479 } // namespace image
480 } // namespace afw
481 } // 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:152
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:148
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18
std::string toString() const override
Create a string representation of this object.
Definition: VisitInfo.cc:454
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:428
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
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
RotType
Type of rotation.
Definition: VisitInfo.h:45
Interface supporting iteration over heterogenous containers.
Definition: Storable.h:58
T stod(T... args)
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:68
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:144
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:137
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:131
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
ItemVariant const * other
Definition: Schema.cc:56
double sin(Angle const &a)
Definition: Angle.h:102
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:382
std::size_t hash_value() const noexcept override
Return a hash of this object.
Definition: VisitInfo.cc:391
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
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:281
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:125
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
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new VisitInfo that is a copy of this one.
Definition: VisitInfo.cc:446
Key< U > key
Definition: Schema.cc:281
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:128
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
std::ostream & operator<<(std::ostream &os, Storable const &storable)
Output operator for Storable.
Definition: Storable.h:174
table::Key< lsst::geom::Angle > longitude
Definition: VisitInfo.cc:172
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:163
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:140
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Definition: VisitInfo.cc:398
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Definition: VisitInfo.cc:450
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:134
Class for storing generic metadata.
Definition: PropertySet.h:67
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:265
lsst::geom::Angle getBoresightParAngle() const
Get parallactic angle at the boresight.
Definition: VisitInfo.cc:432
lsst::geom::SpherePoint SpherePoint
Definition: misc.h:35
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:160
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
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition: Runtime.h:167
table::Key< double > darkTime
Definition: VisitInfo.cc:160
std::ostream * os
Definition: Schema.cc:746
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition: VisitInfo.cc:400
STL class.
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:166
py::object result
Definition: _schema.cc:429
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:169
lsst::geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:430
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:485
static bool singleClassEquals(T const &lhs, Storable const &rhs)
Test if a Storable is of a particular class and equal to another object.
Definition: Storable.h:151