LSSTApplications  19.0.0-14-gb0260a2+72efe9b372,20.0.0+7927753e06,20.0.0+8829bf0056,20.0.0+995114c5d2,20.0.0+b6f4b2abd1,20.0.0+bddc4f4cbe,20.0.0-1-g253301a+8829bf0056,20.0.0-1-g2b7511a+0d71a2d77f,20.0.0-1-g5b95a8c+7461dd0434,20.0.0-12-g321c96ea+23efe4bbff,20.0.0-16-gfab17e72e+fdf35455f6,20.0.0-2-g0070d88+ba3ffc8f0b,20.0.0-2-g4dae9ad+ee58a624b3,20.0.0-2-g61b8584+5d3db074ba,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+226a441f5f,20.0.0-2-gf072044+8829bf0056,20.0.0-2-gf1f7952+ee58a624b3,20.0.0-20-geae50cf+e37fec0aee,20.0.0-25-g3dcad98+544a109665,20.0.0-25-g5eafb0f+ee58a624b3,20.0.0-27-g64178ef+f1f297b00a,20.0.0-3-g4cc78c6+e0676b0dc8,20.0.0-3-g8f21e14+4fd2c12c9a,20.0.0-3-gbd60e8c+187b78b4b8,20.0.0-3-gbecbe05+48431fa087,20.0.0-38-ge4adf513+a12e1f8e37,20.0.0-4-g97dc21a+544a109665,20.0.0-4-gb4befbc+087873070b,20.0.0-4-gf910f65+5d3db074ba,20.0.0-5-gdfe0fee+199202a608,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g64f541c+d529cf1a41,20.0.0-6-g9a5b7a1+a1cd37312e,20.0.0-68-ga3f3dda+5fca18c6a4,20.0.0-9-g4aef684+e18322736b,w.2020.45
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", "")),
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
lsst::geom::degrees
constexpr AngleUnit degrees
constant with units of degrees
Definition: Angle.h:109
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:134
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::sphgeom::sin
double sin(Angle const &a)
Definition: Angle.h:102
lsst::afw::image::VisitInfo::getUt1
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:137
lsst::afw::image::VisitInfo::getExposureId
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:125
lsst::afw::table::SpherePoint
lsst::geom::SpherePoint SpherePoint
Definition: misc.h:35
boresightAirmass
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:167
era
table::Key< lsst::geom::Angle > era
Definition: VisitInfo.cc:163
lsst::afw::image::VisitInfo::equals
bool equals(typehandling::Storable const &other) const noexcept override
Compare this object to another Storable.
Definition: VisitInfo.cc:450
lsst::afw::image::VisitInfo::getRotType
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:163
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:281
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:432
lsst::afw::image::VisitInfo::getEra
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:140
lsst::afw
Definition: imageAlgorithm.dox:1
std::stringstream
STL class.
lsst::afw::image::RotType::UNKNOWN
@ UNKNOWN
Rotation angle is unknown.
lsst::afw::image::VisitInfo::getExposureTime
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:128
lsst::daf::base::PropertyList
Class for storing ordered metadata with comments.
Definition: PropertyList.h:68
lsst::daf::base::DateTime::toString
std::string toString(Timescale scale) const
Get date as an ISO8601-formatted string.
Definition: DateTime.cc:499
lsst::daf::base::PropertySet::exists
bool exists(std::string const &name) const
Determine if a name (possibly hierarchical) exists.
astshim.keyMap.keyMapContinued.keys
def keys(self)
Definition: keyMapContinued.py:6
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:144
lsst::afw::image::VisitInfo::hash_value
std::size_t hash_value() const noexcept override
Return a hash of this object.
Definition: VisitInfo.cc:391
airPressure
table::Key< double > airPressure
Definition: VisitInfo.cc:176
lsst::afw::typehandling::Storable
Interface supporting iteration over heterogenous containers.
Definition: Storable.h:58
lsst::daf::base::DateTime
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:64
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:175
rotType
table::Key< int > rotType
Definition: VisitInfo.cc:169
ut1
table::Key< double > ut1
Definition: VisitInfo.cc:162
lsst::afw::image::VisitInfo::getWeather
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:169
Angle.h
elevation
table::Key< double > elevation
Definition: VisitInfo.cc:173
lsst::afw::table::io::OutputArchiveHandle::makeCatalog
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
Definition: OutputArchive.cc:207
hashCombine.h
lsst::afw::table::Angle
lsst::geom::Angle Angle
Definition: misc.h:33
boresightAzAlt_az
table::Key< lsst::geom::Angle > boresightAzAlt_az
Definition: VisitInfo.cc:165
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
Get date as a double in a specified representation, such as MJD.
Definition: DateTime.cc:429
misc.h
humidity
table::Key< double > humidity
Definition: VisitInfo.cc:177
std::ostream
STL class.
lsst::daf::base::PropertySet::getAsInt64
int64_t getAsInt64(std::string const &name) const
Get the last value for a bool/char/short/int/int64_t property name (possibly hierarchical).
lsst::daf::base::PropertySet::getAsString
std::string getAsString(std::string const &name) const
Get the last value for a string property name (possibly hierarchical).
lsst::sphgeom::tan
double tan(Angle const &a)
Definition: Angle.h:104
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:148
lsst::daf::base::PropertyList::set
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new scalar value.
Definition: PropertyList.cc:113
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:160
exposureId
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:158
boresightRotAngle
table::Key< lsst::geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:168
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:430
exposureTime
table::Key< double > exposureTime
Definition: VisitInfo.cc:159
boresightRaDec
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:164
result
py::object result
Definition: _schema.cc:429
darkTime
table::Key< double > darkTime
Definition: VisitInfo.cc:160
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
lsst::daf::base::PropertySet::remove
virtual void remove(std::string const &name)
Remove all values for a property name (possibly hierarchical).
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::daf::base::PropertySet::getAsDouble
double getAsDouble(std::string const &name) const
Get the last value for any arithmetic property name (possibly hierarchical).
schema
table::Schema schema
Definition: VisitInfo.cc:157
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:152
std::ostringstream
STL class.
lsst::afw::image::VisitInfo::operator==
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:382
lsst::afw::image::VisitInfo::write
void write(OutputArchiveHandle &handle) const override
Write the object to one or more catalogs.
Definition: VisitInfo.cc:400
lsst::geom
Definition: AffineTransform.h:36
os
std::ostream * os
Definition: Schema.cc:746
lsst::utils::hashCombine
std::size_t hashCombine(std::size_t seed) noexcept
Combine hashes.
Definition: hashCombine.h:35
lsst::afw::image::VisitInfo::toString
std::string toString() const override
Create a string representation of this object.
Definition: VisitInfo.cc:454
std::stod
T stod(T... args)
Key.h
tai
table::Key< std::int64_t > tai
Definition: VisitInfo.cc:161
boresightAzAlt_alt
table::Key< lsst::geom::Angle > boresightAzAlt_alt
Definition: VisitInfo.cc:166
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::daf::base::DateTime::TAI
@ TAI
Definition: DateTime.h:69
std
STL namespace.
LSST_ARCHIVE_ASSERT
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:48
key
Key< U > key
Definition: Schema.cc:281
lsst::afw::image::VisitInfo::getLocalEra
lsst::geom::Angle getLocalEra() const
Definition: VisitInfo.cc:428
lsst::geom::Angle
A class representing an angle.
Definition: Angle.h:127
lsst::daf::base::PropertySet
Class for storing generic metadata.
Definition: PropertySet.h:67
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:131
Persistable.cc
lsst::geom::radians
constexpr AngleUnit radians
constant with units of radians
Definition: Angle.h:108
std::stringstream::str
T str(T... args)
InputArchive.h
std::size_t
SpherePoint.h
Schema.h
lsst.pex::exceptions::TypeError
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition: Runtime.h:167
longitude
table::Key< lsst::geom::Angle > longitude
Definition: VisitInfo.cc:172
lsst::geom::SpherePoint
Point in an unspecified spherical coordinate system.
Definition: SpherePoint.h:57
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:171
lsst::afw::image::detail::stripVisitInfoKeywords
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:265
lsst::afw::image::VisitInfo::getObservatory
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:166
lsst::afw::table::CatalogT< BaseRecord >
lsst::sphgeom::cos
double cos(Angle const &a)
Definition: Angle.h:103
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:446
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:398
lsst.pex::exceptions::RuntimeError
Reports errors that are due to events beyond the control of the program.
Definition: Runtime.h:104
exceptions.h
VisitInfo.h