lsst.afw  21.0.0-11-ga6ea59e8e+47cba9fc36
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 std::string getString(daf::base::PropertySet const& metadata, std::string const& key) {
93  return metadata.exists(key) ? metadata.getAsString(key) : "";
94 }
95 
104 bool setDouble(daf::base::PropertySet& metadata, std::string const& key, double value,
105  std::string const& comment) {
106  if (std::isfinite(value)) {
107  metadata.set(key, value);
108  return true;
109  }
110  return false;
111 }
112 
121 bool setAngle(daf::base::PropertySet& metadata, std::string const& key, lsst::geom::Angle const& angle,
122  std::string const& comment) {
123  return setDouble(metadata, key, angle.asDegrees(), comment);
124 }
125 
134 bool setString(daf::base::PropertySet& metadata, std::string const& key, std::string value,
135  std::string const& comment) {
136  if (!value.empty()) {
137  metadata.set(key, value);
138  return true;
139  }
140  return false;
141 }
142 
148 std::string rotTypeStrFromEnum(RotType rotType) {
149  switch (rotType) {
150  case RotType::UNKNOWN:
151  return "UNKNOWN";
152  case RotType::SKY:
153  return "SKY";
154  case RotType::HORIZON:
155  return "HORIZON";
156  case RotType::MOUNT:
157  return "MOUNT";
158  }
160  os << "Unknown RotType enum: " << static_cast<int>(rotType);
162 }
163 
169 RotType rotTypeEnumFromStr(std::string const& rotTypeName) {
170  if (rotTypeName == "UNKNOWN") {
171  return RotType::UNKNOWN;
172  } else if (rotTypeName == "SKY") {
173  return RotType::SKY;
174  } else if (rotTypeName == "HORIZON") {
175  return RotType::HORIZON;
176  } else if (rotTypeName == "MOUNT") {
177  return RotType::MOUNT;
178  }
180  os << "Unknown RotType name: \"" << rotTypeName << "\"";
182 }
183 
184 class VisitInfoSchema {
185 public:
186  table::Schema schema;
187  table::Key<table::RecordId> exposureId;
188  table::Key<double> exposureTime;
189  table::Key<double> darkTime;
190  table::Key<std::int64_t> tai;
191  table::Key<double> ut1;
192  table::Key<lsst::geom::Angle> era;
193  table::CoordKey boresightRaDec;
194  table::Key<lsst::geom::Angle> boresightAzAlt_az;
195  table::Key<lsst::geom::Angle> boresightAzAlt_alt;
196  table::Key<double> boresightAirmass;
197  table::Key<lsst::geom::Angle> boresightRotAngle;
198  table::Key<int> rotType;
199  // observatory data
200  table::Key<lsst::geom::Angle> latitude;
201  table::Key<lsst::geom::Angle> longitude;
202  table::Key<double> elevation;
203  // weather data
204  table::Key<double> airTemperature;
205  table::Key<double> airPressure;
206  table::Key<double> humidity;
207 
208  table::Key<std::string> instrumentLabel;
209 
210  static VisitInfoSchema const& get() {
211  static VisitInfoSchema instance;
212  return instance;
213  }
214 
215  // No copying
216  VisitInfoSchema(const VisitInfoSchema&) = delete;
217  VisitInfoSchema& operator=(const VisitInfoSchema&) = delete;
218 
219  // No moving
220  VisitInfoSchema(VisitInfoSchema&&) = delete;
221  VisitInfoSchema& operator=(VisitInfoSchema&&) = delete;
222 
223 private:
224  VisitInfoSchema()
225  : schema(),
226  exposureId(schema.addField<table::RecordId>("exposureid", "exposure ID", "")),
227  exposureTime(schema.addField<double>("exposuretime", "exposure duration", "s")),
228  darkTime(schema.addField<double>("darktime", "time from CCD flush to readout", "s")),
229  tai(schema.addField<std::int64_t>(
230  "tai", "TAI date and time at middle of exposure as nsec from unix epoch", "nsec")),
231  ut1(schema.addField<double>("ut1", "UT1 date and time at middle of exposure", "MJD")),
232  era(schema.addField<lsst::geom::Angle>("era", "earth rotation angle at middle of exposure",
233  "")),
234  boresightRaDec(table::CoordKey::addFields(schema, "boresightradec",
235  "sky position of boresight at middle of exposure")),
236  // CoordKey is intended for ICRS coordinates, so use a pair of lsst::geom::Angle fields
237  // to save boresightAzAlt
238  boresightAzAlt_az(schema.addField<lsst::geom::Angle>(
239  "boresightazalt_az",
240  "refracted apparent topocentric position of boresight at middle of exposure", "")),
241  boresightAzAlt_alt(schema.addField<lsst::geom::Angle>(
242  "boresightazalt_alt",
243  "refracted apparent topocentric position of boresight at middle of exposure", "")),
244  boresightAirmass(schema.addField<double>(
245  "boresightairmass", "airmass at boresight, relative to zenith at sea level", "")),
246  boresightRotAngle(schema.addField<lsst::geom::Angle>(
247  "boresightrotangle", "rotation angle at boresight at middle of exposure", "")),
248  rotType(schema.addField<int>("rottype", "rotation type; see VisitInfo.getRotType for details",
249  "MJD")),
250  // observatory data
251  latitude(schema.addField<lsst::geom::Angle>(
252  "latitude", "latitude of telescope (+ is east of Greenwich)", "")),
253  longitude(schema.addField<lsst::geom::Angle>("longitude", "longitude of telescope", "")),
254  elevation(schema.addField<double>("elevation", "elevation of telescope", "")),
255 
256  // weather data
257  airTemperature(schema.addField<double>("airtemperature", "air temperature", "C")),
258  airPressure(schema.addField<double>("airpressure", "air pressure", "Pascal")),
259  humidity(schema.addField<double>("humidity", "humidity (%)", "")),
260 
261  instrumentLabel(schema.addField<std::string>(
262  "instrumentlabel", "Short name of the instrument that took this data", "", 0)) {}
263 };
264 
265 class VisitInfoFactory : public table::io::PersistableFactory {
266 public:
267  std::shared_ptr<table::io::Persistable> read(InputArchive const& archive,
268  CatalogVector const& catalogs) const override {
269  VisitInfoSchema const& keys = VisitInfoSchema::get();
270  LSST_ARCHIVE_ASSERT(catalogs.size() == 1u);
271  LSST_ARCHIVE_ASSERT(catalogs.front().size() == 1u);
272  LSST_ARCHIVE_ASSERT(catalogs.front().getSchema() == keys.schema);
273  table::BaseRecord const& record = catalogs.front().front();
275  new VisitInfo(record.get(keys.exposureId), record.get(keys.exposureTime),
276  record.get(keys.darkTime), ::DateTime(record.get(keys.tai), ::DateTime::TAI),
277  record.get(keys.ut1), record.get(keys.era), record.get(keys.boresightRaDec),
278  lsst::geom::SpherePoint(record.get(keys.boresightAzAlt_az),
279  record.get(keys.boresightAzAlt_alt)),
280  record.get(keys.boresightAirmass), record.get(keys.boresightRotAngle),
281  static_cast<RotType>(record.get(keys.rotType)),
282  coord::Observatory(record.get(keys.longitude), record.get(keys.latitude),
283  record.get(keys.elevation)),
284  coord::Weather(record.get(keys.airTemperature), record.get(keys.airPressure),
285  record.get(keys.humidity)),
286  record.get(keys.instrumentLabel)));
287  return result;
288  }
289 
290  explicit VisitInfoFactory(std::string const& name) : table::io::PersistableFactory(name) {}
291 };
292 
293 std::string getVisitInfoPersistenceName() { return "VisitInfo"; }
294 
295 VisitInfoFactory registration(getVisitInfoPersistenceName());
296 
297 } // namespace
298 
299 namespace detail {
300 
302  int nstripped = 0;
303 
304  std::vector<std::string> keyList = {"EXPID", "EXPTIME", "DARKTIME", "DATE-AVG", "TIMESYS",
305  "TIME-MID", "MJD-AVG-UT1", "AVG-ERA", "BORE-RA", "BORE-DEC",
306  "BORE-AZ", "BORE-ALT", "BORE-AIRMASS", "BORE-ROTANG", "ROTTYPE",
307  "OBS-LONG", "OBS-LAT", "OBS-ELEV", "AIRTEMP", "AIRPRESS",
308  "HUMIDITY", "INSTRUMENT"};
309  for (auto&& key : keyList) {
310  if (metadata.exists(key)) {
311  metadata.remove(key);
312  nstripped++;
313  }
314  }
315  return nstripped;
316 }
317 
319  if (visitInfo.getExposureId() != 0) {
320  metadata.set("EXPID", visitInfo.getExposureId());
321  }
322  setDouble(metadata, "EXPTIME", visitInfo.getExposureTime(), "Exposure time (sec)");
323  setDouble(metadata, "DARKTIME", visitInfo.getDarkTime(), "Time from CCD flush to readout (sec)");
324  if (visitInfo.getDate().isValid()) {
325  metadata.set("DATE-AVG", visitInfo.getDate().toString(::DateTime::TAI),
326  "TAI date at middle of observation");
327  metadata.set("TIMESYS", "TAI");
328  }
329  setDouble(metadata, "MJD-AVG-UT1", visitInfo.getUt1(), "UT1 MJD date at ctr of obs");
330  setAngle(metadata, "AVG-ERA", visitInfo.getEra(), "Earth rot ang at ctr of obs (deg)");
331  auto boresightRaDec = visitInfo.getBoresightRaDec();
332  setAngle(metadata, "BORE-RA", boresightRaDec[0], "ICRS RA (deg) at boresight");
333  setAngle(metadata, "BORE-DEC", boresightRaDec[1], "ICRS Dec (deg) at boresight");
334  auto boresightAzAlt = visitInfo.getBoresightAzAlt();
335  setAngle(metadata, "BORE-AZ", boresightAzAlt[0], "Refr app topo az (deg) at bore");
336  setAngle(metadata, "BORE-ALT", boresightAzAlt[1], "Refr app topo alt (deg) at bore");
337  setDouble(metadata, "BORE-AIRMASS", visitInfo.getBoresightAirmass(), "Airmass at boresight");
338  setAngle(metadata, "BORE-ROTANG", visitInfo.getBoresightRotAngle(), "Rotation angle (deg) at boresight");
339  metadata.set("ROTTYPE", rotTypeStrFromEnum(visitInfo.getRotType()), "Type of rotation angle");
340  auto observatory = visitInfo.getObservatory();
341  setAngle(metadata, "OBS-LONG", observatory.getLongitude(), "Telescope longitude (+E, deg)");
342  setAngle(metadata, "OBS-LAT", observatory.getLatitude(), "Telescope latitude (deg)");
343  setDouble(metadata, "OBS-ELEV", observatory.getElevation(), "Telescope elevation (m)");
344  auto weather = visitInfo.getWeather();
345  setDouble(metadata, "AIRTEMP", weather.getAirTemperature(), "Outside air temperature (C)");
346  setDouble(metadata, "AIRPRESS", weather.getAirPressure(), "Outdoor air pressure (P)");
347  setDouble(metadata, "HUMIDITY", weather.getHumidity(), "Relative humidity (%)");
348  setString(metadata, "INSTRUMENT", visitInfo.getInstrumentLabel(),
349  "Short name of the instrument that took this data");
350 }
351 
352 } // namespace detail
353 
354 VisitInfo::VisitInfo(daf::base::PropertySet const& metadata)
355  : _exposureId(0),
356  _exposureTime(nan), // don't use getDouble because str values are also accepted
357  _darkTime(getDouble(metadata, "DARKTIME")),
358  _date(),
359  _ut1(getDouble(metadata, "MJD-AVG-UT1")),
360  _era(getAngle(metadata, "AVG-ERA")),
361  _boresightRaDec(
362  lsst::geom::SpherePoint(getAngle(metadata, "BORE-RA"), getAngle(metadata, "BORE-DEC"))),
363  _boresightAzAlt(
364  lsst::geom::SpherePoint(getAngle(metadata, "BORE-AZ"), getAngle(metadata, "BORE-ALT"))),
365  _boresightAirmass(getDouble(metadata, "BORE-AIRMASS")),
366  _boresightRotAngle(getAngle(metadata, "BORE-ROTANG")),
367  _rotType(RotType::UNKNOWN),
368  _observatory(getAngle(metadata, "OBS-LONG"), getAngle(metadata, "OBS-LAT"),
369  getDouble(metadata, "OBS-ELEV")),
370  _weather(getDouble(metadata, "AIRTEMP"), getDouble(metadata, "AIRPRESS"),
371  getDouble(metadata, "HUMIDITY")),
372  _instrumentLabel(getString(metadata, "INSTRUMENT")) {
373  auto key = "EXPID";
374  if (metadata.exists(key)) {
375  _exposureId = metadata.getAsInt64(key);
376  }
377 
378  key = "EXPTIME";
379  if (metadata.exists(key)) {
380  try {
381  _exposureTime = metadata.getAsDouble(key);
382  } catch (lsst::pex::exceptions::TypeError& err) {
383  // some old exposures have EXPTIME stored as a string
384  std::string exptimeStr = metadata.getAsString(key);
385  _exposureTime = std::stod(exptimeStr);
386  }
387  }
388 
389  key = "DATE-AVG";
390  if (metadata.exists(key)) {
391  if (metadata.exists("TIMESYS")) {
392  auto timesysName = boost::algorithm::trim_right_copy(metadata.getAsString("TIMESYS"));
393  if (timesysName != "TAI") {
394  // rather than try to deal with all the possible choices, which requires
395  // appending or deleting a "Z", depending on the time system, just give up.
396  // VisitInfo should be used on FITS headers that have been sanitized!
398  os << "TIMESYS = \"" << timesysName
399  << "\"; VisitInfo requires TIMESYS to exist and to equal \"TAI\"";
401  }
402  } else {
404  "TIMESYS not found; VistitInfo requires TIMESYS to exist and to equal \"TAI\"");
405  }
406  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::TAI);
407  } else {
408  // DATE-AVG not found. For backwards compatibility look for TIME-MID, an outdated LSST keyword
409  // whose time system was UTC, despite a FITS comment claiming it was TAI. Ignore TIMESYS.
410  key = "TIME-MID";
411  if (metadata.exists(key)) {
412  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::UTC);
413  }
414  }
415 
416  key = "ROTTYPE";
417  if (metadata.exists(key)) {
418  _rotType = rotTypeEnumFromStr(metadata.getAsString(key));
419  }
420 }
421 
423  return _exposureId == other.getExposureId() && _exposureTime == other.getExposureTime() &&
424  _darkTime == other.getDarkTime() && _date == other.getDate() && _ut1 == other.getUt1() &&
425  _era == other.getEra() && _boresightRaDec == other.getBoresightRaDec() &&
426  _boresightAzAlt == other.getBoresightAzAlt() && _boresightAirmass == other.getBoresightAirmass() &&
427  _boresightRotAngle == other.getBoresightRotAngle() && _rotType == other.getRotType() &&
428  _observatory == other.getObservatory() && _weather == other.getWeather() &&
429  _instrumentLabel == other.getInstrumentLabel();
430 }
431 
433  // Completely arbitrary seed
434  return utils::hashCombine(17, _exposureId, _exposureTime, _darkTime, _date, _ut1, _era, _boresightRaDec,
435  _boresightAzAlt, _boresightAirmass, _boresightRotAngle, _rotType, _observatory,
436  _weather, _instrumentLabel);
437 }
438 
439 std::string VisitInfo::getPersistenceName() const { return getVisitInfoPersistenceName(); }
440 
442  VisitInfoSchema const& keys = VisitInfoSchema::get();
443  table::BaseCatalog cat = handle.makeCatalog(keys.schema);
445  record->set(keys.exposureId, getExposureId());
446  record->set(keys.exposureTime, getExposureTime());
447  record->set(keys.darkTime, getDarkTime());
448  record->set(keys.tai, getDate().nsecs(::DateTime::TAI));
449  record->set(keys.ut1, getUt1());
450  record->set(keys.era, getEra());
451  record->set(keys.boresightRaDec, getBoresightRaDec());
452  auto boresightAzAlt = getBoresightAzAlt();
453  record->set(keys.boresightAzAlt_az, boresightAzAlt[0]);
454  record->set(keys.boresightAzAlt_alt, boresightAzAlt[1]);
455  record->set(keys.boresightAirmass, getBoresightAirmass());
456  record->set(keys.boresightRotAngle, getBoresightRotAngle());
457  record->set(keys.rotType, static_cast<int>(getRotType()));
458  auto observatory = getObservatory();
459  record->set(keys.latitude, observatory.getLatitude());
460  record->set(keys.longitude, observatory.getLongitude());
461  record->set(keys.elevation, observatory.getElevation());
462  auto weather = getWeather();
463  record->set(keys.airTemperature, weather.getAirTemperature());
464  record->set(keys.airPressure, weather.getAirPressure());
465  record->set(keys.humidity, weather.getHumidity());
466  record->set(keys.instrumentLabel, getInstrumentLabel());
467  handle.saveCatalog(cat);
468 }
469 
471 
473 
479  double _parallactic_y, _parallactic_x, result;
480  _parallactic_y = sin(getBoresightHourAngle().asRadians());
481  _parallactic_x =
482  cos((getBoresightRaDec()[1]).asRadians()) * tan(getObservatory().getLatitude().asRadians()) -
483  sin((getBoresightRaDec()[1]).asRadians()) * cos(getBoresightHourAngle().asRadians());
484  result = atan2(_parallactic_y, _parallactic_x);
485  return result * lsst::geom::radians;
486 }
487 
489  return std::make_unique<VisitInfo>(*this);
490 }
491 
492 bool VisitInfo::equals(typehandling::Storable const& other) const noexcept {
493  return singleClassEquals(*this, other);
494 }
495 
497  std::stringstream buffer;
498  buffer << "VisitInfo(";
499  buffer << "exposureId=" << getExposureId() << ", ";
500  buffer << "exposureTime=" << getExposureTime() << ", ";
501  buffer << "darkTime=" << getDarkTime() << ", ";
502  buffer << "date=" << getDate().toString(daf::base::DateTime::TAI) << ", ";
503  buffer << "UT1=" << getUt1() << ", ";
504  buffer << "ERA=" << getEra() << ", ";
505  buffer << "boresightRaDec=" << getBoresightRaDec() << ", ";
506  buffer << "boresightAzAlt=" << getBoresightAzAlt() << ", ";
507  buffer << "boresightAirmass=" << getBoresightAirmass() << ", ";
508  buffer << "boresightRotAngle=" << getBoresightRotAngle() << ", ";
509  buffer << "rotType=" << static_cast<int>(getRotType()) << ", ";
510  buffer << "observatory=" << getObservatory() << ", ";
511  buffer << "weather=" << getWeather() << ", ";
512  buffer << "instrumentLabel=" << getInstrumentLabel();
513  buffer << ")";
514  return buffer.str();
515 }
516 
518  os << visitInfo.toString();
519  return os;
520 }
521 
522 } // namespace image
523 } // namespace afw
524 } // namespace lsst
lsst::geom::degrees
constexpr AngleUnit degrees
lsst::afw::image::RotType
RotType
Type of rotation.
Definition: VisitInfo.h:45
lsst::afw::coord::Observatory::getLongitude
lsst::geom::Angle getLongitude() const noexcept
get telescope longitude (positive values are E of Greenwich)
Definition: Observatory.cc:48
lsst::afw::image
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects.
Definition: imageAlgorithm.dox:1
std::nan
T nan(T... args)
lsst::afw::image::VisitInfo::getDate
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:137
LSST_ARCHIVE_ASSERT
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
std::string
STL class.
std::shared_ptr
STL class.
lsst::afw::table::RecordId
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:22
lsst::afw::image::VisitInfo::getUt1
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:140
instrumentLabel
table::Key< std::string > instrumentLabel
Definition: VisitInfo.cc:208
lsst::afw::image::VisitInfo::getExposureId
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:128
lsst::afw::table::SpherePoint
lsst::geom::SpherePoint SpherePoint
Definition: misc.h:35
boresightAirmass
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:196
era
table::Key< lsst::geom::Angle > era
Definition: VisitInfo.cc:192
lsst::afw::image::VisitInfo::equals
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Definition: VisitInfo.cc:492
lsst::afw::image::VisitInfo::getRotType
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:166
std::numeric_limits::quiet_NaN
T quiet_NaN(T... args)
lsst::afw::table::io::OutputArchiveHandle
An object passed to Persistable::write to allow it to persist itself.
Definition: OutputArchive.h:118
std::vector< std::string >
lsst::afw::image::detail::setVisitInfoMetadata
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:318
lsst::afw::table::io::OutputArchiveHandle::saveCatalog
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
Definition: OutputArchive.cc:211
lsst::afw::image::VisitInfo::getBoresightParAngle
lsst::geom::Angle getBoresightParAngle() const
Get parallactic angle at the boresight.
Definition: VisitInfo.cc:474
lsst::afw::image::VisitInfo::getEra
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:143
std::stringstream
STL class.
lsst::afw::image::VisitInfo::getExposureTime
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:131
lsst::daf::base::PropertyList
lsst::daf::base::DateTime::toString
std::string toString(Timescale scale) const
lsst::daf::base::PropertySet::exists
bool exists(std::string const &name) const
keys
def keys(self)
CatalogVector.h
lsst::afw::image::operator<<
std::ostream & operator<<(std::ostream &os, Measurement const &measurement)
Definition: PhotoCalib.cc:48
lsst::afw::image::VisitInfo::getBoresightRaDec
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:147
lsst::afw::image::VisitInfo::hash_value
std::size_t hash_value() const noexcept override
Return a hash of this object.
Definition: VisitInfo.cc:432
airPressure
table::Key< double > airPressure
Definition: VisitInfo.cc:205
lsst::afw::typehandling::Storable
Interface supporting iteration over heterogenous containers.
Definition: Storable.h:58
lsst::daf::base::DateTime
angle
table::Key< double > angle
Definition: FunctionLibrary.cc:22
lsst::afw::geom.transform.transformContinued.name
string name
Definition: transformContinued.py:32
aggregates.h
airTemperature
table::Key< double > airTemperature
Definition: VisitInfo.cc:204
rotType
table::Key< int > rotType
Definition: VisitInfo.cc:198
ut1
table::Key< double > ut1
Definition: VisitInfo.cc:191
hashCombine.h
lsst::afw::image::VisitInfo::getWeather
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:172
elevation
table::Key< double > elevation
Definition: VisitInfo.cc:202
lsst::afw::table::io::OutputArchiveHandle::makeCatalog
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
Definition: OutputArchive.cc:207
lsst::afw::table::Angle
lsst::geom::Angle Angle
Definition: misc.h:33
boresightAzAlt_az
table::Key< lsst::geom::Angle > boresightAzAlt_az
Definition: VisitInfo.cc:194
result
std::unique_ptr< SchemaItem< U > > result
Definition: Schema.cc:195
std::isfinite
T isfinite(T... args)
lsst::afw::image::VisitInfo
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:68
lsst::daf::base::DateTime::get
double get(DateSystem system=MJD, Timescale scale=TAI) const
misc.h
humidity
table::Key< double > humidity
Definition: VisitInfo.cc:206
std::ostream
STL class.
lsst::daf::base::PropertySet::getAsInt64
int64_t getAsInt64(std::string const &name) const
lsst::daf::base::PropertySet::getAsString
std::string getAsString(std::string const &name) const
lsst::afw::image::VisitInfo::getBoresightAzAlt
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:151
lsst::daf::base::PropertyList::set
void set(std::string const &name, T const &value)
other
ItemVariant const * other
Definition: Schema.cc:56
lsst::afw::image::VisitInfo::getBoresightRotAngle
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:163
exposureId
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:187
boresightRotAngle
table::Key< lsst::geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:197
Persistable.cc
lsst::afw::table::Key::isValid
bool isValid() const noexcept
Return true if the key was initialized to valid offset.
Definition: Key.h:97
lsst::afw::image::VisitInfo::getBoresightHourAngle
lsst::geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:472
exposureTime
table::Key< double > exposureTime
Definition: VisitInfo.cc:188
boresightRaDec
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:193
Angle.h
darkTime
table::Key< double > darkTime
Definition: VisitInfo.cc:189
lsst
A base class for image defects.
lsst::daf::base::PropertySet::remove
virtual void remove(std::string const &name)
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
lsst::daf::base::PropertySet::getAsDouble
double getAsDouble(std::string const &name) const
schema
table::Schema schema
Definition: VisitInfo.cc:186
exceptions.h
lsst::afw::table::io::PersistableFacade::dynamicCast
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18
lsst::afw::image::VisitInfo::getBoresightAirmass
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure,...
Definition: VisitInfo.h:155
std::ostringstream
STL class.
lsst::afw::image::VisitInfo::operator==
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:422
lsst::afw::image::VisitInfo::write
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition: VisitInfo.cc:441
os
std::ostream * os
Definition: Schema.cc:746
lsst::utils::hashCombine
std::size_t hashCombine(std::size_t seed) noexcept
lsst::afw::image::VisitInfo::toString
std::string toString() const override
Create a string representation of this object.
Definition: VisitInfo.cc:496
std::stod
T stod(T... args)
Key.h
tai
table::Key< std::int64_t > tai
Definition: VisitInfo.cc:190
lsst::afw::image::VisitInfo::getInstrumentLabel
std::string getInstrumentLabel() const
Definition: VisitInfo.h:182
boresightAzAlt_alt
table::Key< lsst::geom::Angle > boresightAzAlt_alt
Definition: VisitInfo.cc:195
lsst::daf::base::DateTime::TAI
TAI
std
STL namespace.
key
Key< U > key
Definition: Schema.cc:281
lsst::afw::image::VisitInfo::getLocalEra
lsst::geom::Angle getLocalEra() const
Definition: VisitInfo.cc:470
lsst::geom::Angle
lsst::daf::base::PropertySet
lsst::afw::image::VisitInfo::getDarkTime
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)
Definition: VisitInfo.h:134
lsst::geom::radians
constexpr AngleUnit radians
std::string::empty
T empty(T... args)
std::stringstream::str
T str(T... args)
InputArchive.h
std::size_t
Schema.h
lsst::pex::exceptions::TypeError
longitude
table::Key< lsst::geom::Angle > longitude
Definition: VisitInfo.cc:201
lsst::geom::SpherePoint
lsst::afw::table::CatalogT::addNew
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
latitude
table::Key< lsst::geom::Angle > latitude
Definition: VisitInfo.cc:200
lsst::afw::image::detail::stripVisitInfoKeywords
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:301
lsst::afw::image::VisitInfo::getObservatory
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:169
lsst::afw::table::CatalogT< BaseRecord >
SpherePoint.h
OutputArchive.h
visitInfo
Key< int > visitInfo
Definition: Exposure.cc:70
lsst::afw::image::VisitInfo::cloneStorable
std::shared_ptr< typehandling::Storable > cloneStorable() const override
Create a new VisitInfo that is a copy of this one.
Definition: VisitInfo.cc:488
lsst::afw::image::VisitInfo::getPersistenceName
std::string getPersistenceName() const override
Return the unique name used to persist this object and look up its factory.
Definition: VisitInfo.cc:439
lsst::pex::exceptions::RuntimeError
VisitInfo.h