LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
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/pex/exceptions.h"
31 #include "lsst/afw/table/Key.h"
32 #include "lsst/afw/table/aggregates.h" // for CoordKey
33 #include "lsst/afw/table/Schema.h"
34 #include "lsst/afw/table/misc.h" // for RecordId
37 #include "lsst/afw/table/io/CatalogVector.h" // needed, but why?
38 #include "lsst/afw/coord/Coord.h"
39 #include "lsst/afw/geom/Angle.h"
41 
43 
44 namespace lsst { namespace afw { namespace image {
45 
47 
48 namespace {
49 
50 auto const nan = std::numeric_limits<double>::quiet_NaN();
51 auto const nanAngle = nan*geom::radians;
52 
61 double getDouble(daf::base::PropertySet const & metadata, std::string const & key) {
62  return metadata.exists(key) ? metadata.getAsDouble(key) : nan;
63 }
64 
73 geom::Angle getAngle(daf::base::PropertySet const & metadata, std::string const & key) {
74  return getDouble(metadata, key)*geom::degrees;
75 }
76 
85 bool setDouble(
86  daf::base::PropertySet & metadata,
87  std::string const & key,
88  double value,
89  std::string const & comment
90 ) {
91  if (std::isfinite(value)) {
92  metadata.set(key, value);
93  return true;
94  }
95  return false;
96 }
97 
106 bool setAngle(
107  daf::base::PropertySet & metadata,
108  std::string const & key,
109  geom::Angle const & angle,
110  std::string const & comment
111 ) {
112  return setDouble(metadata, key, angle.asDegrees(), comment);
113 }
114 
120 std::string rotTypeStrFromEnum(RotType rotType) {
121  switch(rotType) {
122  case RotType::UNKNOWN:
123  return "UNKNOWN";
124  case RotType::SKY:
125  return "SKY";
126  case RotType::HORIZON:
127  return "HORIZON";
128  case RotType::MOUNT:
129  return "MOUNT";
130  }
131  std::ostringstream os;
132  os << "Unknown RotType enum: " << static_cast<int>(rotType);
133  throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError, os.str());
134 }
135 
141 RotType rotTypeEnumFromStr(std::string const & rotTypeName) {
142  if (rotTypeName == "UNKNOWN") {
143  return RotType::UNKNOWN;
144  } else if (rotTypeName == "SKY") {
145  return RotType::SKY;
146  } else if (rotTypeName == "HORIZON") {
147  return RotType::HORIZON;
148  } else if (rotTypeName == "MOUNT") {
149  return RotType::MOUNT;
150  }
151  std::ostringstream os;
152  os << "Unknown RotType name: \"" << rotTypeName << "\"";
153  throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError, os.str());
154 }
155 
156 class VisitInfoSchema {
157 public:
158  table::Schema schema;
159  table::Key<table::RecordId> exposureId;
160  table::Key<double> exposureTime;
161  table::Key<double> darkTime;
162  table::Key<std::int64_t> tai;
163  table::Key<double> ut1;
164  table::Key<geom::Angle> era;
165  table::CoordKey boresightRaDec;
166  table::Key<geom::Angle> boresightAzAlt_az;
167  table::Key<geom::Angle> boresightAzAlt_alt;
168  table::Key<double> boresightAirmass;
169  table::Key<geom::Angle> boresightRotAngle;
170  table::Key<int> rotType;
171  // observatory data
172  table::Key<geom::Angle> latitude;
173  table::Key<geom::Angle> longitude;
174  table::Key<double> elevation;
175  // weather data
176  table::Key<double> airTemperature;
177  table::Key<double> airPressure;
178  table::Key<double> humidity;
179 
180  static VisitInfoSchema const & get() {
181  static VisitInfoSchema instance;
182  return instance;
183  }
184 
185  // No copying
186  VisitInfoSchema (const VisitInfoSchema&) = delete;
187  VisitInfoSchema& operator=(const VisitInfoSchema&) = delete;
188 
189  // No moving
190  VisitInfoSchema (VisitInfoSchema&&) = delete;
191  VisitInfoSchema& operator=(VisitInfoSchema&&) = delete;
192 
193 private:
194  VisitInfoSchema() :
195  schema(),
196  exposureId(schema.addField<table::RecordId>("exposureid", "exposure ID", "")),
197  exposureTime(schema.addField<double>("exposuretime", "exposure duration", "s")),
198  darkTime(schema.addField<double>("darktime", "time from CCD flush to readout", "s")),
199  tai(schema.addField<std::int64_t>("tai",
200  "TAI date and time at middle of exposure as nsec from unix epoch", "nsec")),
201  ut1(schema.addField<double>("ut1", "UT1 date and time at middle of exposure", "MJD")),
202  era(schema.addField<geom::Angle>("era", "earth rotation angle at middle of exposure", "")),
203  boresightRaDec(table::CoordKey::addFields(schema, "boresightradec",
204  "sky position of boresight at middle of exposure")),
205  // CoordKey is only for IcrsCoord; we have no equivalent for other kinds of coordinates
206  // so use a pair of Angle fields to save boresightAzAlt
207  boresightAzAlt_az(schema.addField<geom::Angle>("boresightazalt_az",
208  "refracted apparent topocentric position of boresight at middle of exposure", "")),
209  boresightAzAlt_alt(schema.addField<geom::Angle>("boresightazalt_alt",
210  "refracted apparent topocentric position of boresight at middle of exposure", "")),
211  boresightAirmass(schema.addField<double>("boresightairmass",
212  "airmass at boresight, relative to zenith at sea level", "")),
213  boresightRotAngle(schema.addField<geom::Angle>("boresightrotangle",
214  "rotation angle at boresight at middle of exposure", "")),
215  rotType(schema.addField<int>("rottype",
216  "rotation type; see VisitInfo.getRotType for details", "MJD")),
217  // observatory data
218  latitude(schema.addField<geom::Angle>("latitude",
219  "latitude of telescope (+ is east of Greenwich)", "")),
220  longitude(schema.addField<geom::Angle>("longitude", "longitude of telescope", "")),
221  elevation(schema.addField<double>("elevation", "elevation of telescope", "")),
222  // weather data
223  airTemperature(schema.addField<double>("airtemperature", "air temperature", "C")),
224  airPressure(schema.addField<double>("airpressure", "air pressure", "Pascal")),
225  humidity(schema.addField<double>("humidity", "humidity (%)", ""))
226  {
227  schema.getCitizen().markPersistent();
228  }
229 };
230 
231 class VisitInfoFactory : public table::io::PersistableFactory {
232 public:
233 
234  virtual PTR(table::io::Persistable)
235  read(InputArchive const & archive, CatalogVector const & catalogs) const {
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();
241  PTR(VisitInfo) result(new VisitInfo(
242  record.get(keys.exposureId),
243  record.get(keys.exposureTime),
244  record.get(keys.darkTime),
245  ::DateTime(record.get(keys.tai), ::DateTime::TAI),
246  record.get(keys.ut1),
247  record.get(keys.era),
248  record.get(keys.boresightRaDec),
249  coord::Coord(record.get(keys.boresightAzAlt_az), record.get(keys.boresightAzAlt_alt)),
250  record.get(keys.boresightAirmass),
251  record.get(keys.boresightRotAngle),
252  static_cast<RotType>(record.get(keys.rotType)),
253  coord::Observatory(
254  record.get(keys.longitude),
255  record.get(keys.latitude),
256  record.get(keys.elevation)
257  ),
258  coord::Weather(
259  record.get(keys.airTemperature),
260  record.get(keys.airPressure),
261  record.get(keys.humidity)
262  )
263  ));
264  return result;
265  }
266 
267  explicit VisitInfoFactory(std::string const & name) : table::io::PersistableFactory(name) {}
268 
269 };
270 
271 std::string getVisitInfoPersistenceName() { return "VisitInfo"; }
272 
273 VisitInfoFactory registration(getVisitInfoPersistenceName());
274 
275 } // anonymous
276 
277 namespace detail {
278 
280  int nstripped = 0;
281 
282  std::vector<std::string> keyList = {
283  "EXPID", "EXPTIME", "DARKTIME", "DATE-AVG", "TIMESYS", "TIME-MID", "MJD-AVG-UT1", "AVG-ERA",
284  "BORE-RA", "BORE-DEC","BORE-AZ", "BORE-ALT", "BORE-AIRMASS", "BORE-ROTANG", "ROTTYPE",
285  "OBS-LONG", "OBS-LAT", "OBS-ELEV",
286  "AIRTEMP", "AIRPRESS", "HUMIDITY"
287  };
288  for (auto&& key : keyList) {
289  if (metadata.exists(key)) {
290  metadata.remove(key);
291  nstripped++;
292  }
293  }
294  return nstripped;
295 }
296 
297 void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo) {
298  if (visitInfo.getExposureId() != 0) {
299  metadata.set("EXPID", visitInfo.getExposureId());
300  }
301  setDouble(metadata, "EXPTIME", visitInfo.getExposureTime(), "Exposure time (sec)");
302  setDouble(metadata, "DARKTIME", visitInfo.getDarkTime(), "Time from CCD flush to readout (sec)");
303  if (visitInfo.getDate().isValid()) {
304  metadata.set("DATE-AVG", visitInfo.getDate().toString(::DateTime::TAI),
305  "TAI date at middle of observation");
306  metadata.set("TIMESYS", "TAI");
307  }
308  setDouble(metadata, "MJD-AVG-UT1", visitInfo.getUt1(), "UT1 MJD date at ctr of obs");
309  setAngle(metadata, "AVG-ERA", visitInfo.getEra(), "Earth rot ang at ctr of obs (deg)");
310  auto boresightRaDec = visitInfo.getBoresightRaDec();
311  setAngle(metadata, "BORE-RA", boresightRaDec[0], "ICRS RA (deg) at boresight");
312  setAngle(metadata, "BORE-DEC", boresightRaDec[1], "ICRS Dec (deg) at boresight");
313  auto boresightAzAlt = visitInfo.getBoresightAzAlt();
314  setAngle(metadata, "BORE-AZ", boresightAzAlt[0], "Refr app topo az (deg) at bore");
315  setAngle(metadata, "BORE-ALT", boresightAzAlt[1], "Refr app topo alt (deg) at bore");
316  setDouble(metadata, "BORE-AIRMASS", visitInfo.getBoresightAirmass(), "Airmass at boresight");
317  setAngle(metadata, "BORE-ROTANG", visitInfo.getBoresightRotAngle(), "Rotation angle (deg) at boresight");
318  metadata.set("ROTTYPE", rotTypeStrFromEnum(visitInfo.getRotType()), "Type of rotation angle");
319  auto observatory = visitInfo.getObservatory();
320  setAngle(metadata, "OBS-LONG", observatory.getLongitude(), "Telescope longitude (+E, deg)");
321  setAngle(metadata, "OBS-LAT", observatory.getLatitude(), "Telescope latitude (deg)");
322  setDouble(metadata, "OBS-ELEV", observatory.getElevation(), "Telescope elevation (m)");
323  auto weather = visitInfo.getWeather();
324  setDouble(metadata, "AIRTEMP", weather.getAirTemperature(), "Outside air temperature (C)");
325  setDouble(metadata, "AIRPRESS", weather.getAirPressure() , "Outdoor air pressure (P)");
326  setDouble(metadata, "HUMIDITY", weather.getHumidity(), "Relative humidity (%)");
327 }
328 
329 } // lsst::afw::image::detail
330 
331 
333  _exposureId(0),
334  _exposureTime(nan), // don't use getDouble because str values are also accepted
335  _darkTime(getDouble(metadata, "DARKTIME")),
336  _date(),
337  _ut1(getDouble(metadata, "MJD-AVG-UT1")),
338  _era(getAngle(metadata, "AVG-ERA")),
339  _boresightRaDec(coord::IcrsCoord(getAngle(metadata, "BORE-RA"), getAngle(metadata, "BORE-DEC"))),
340  _boresightAzAlt(coord::Coord(getAngle(metadata, "BORE-AZ"), getAngle(metadata, "BORE-ALT"))),
341  _boresightAirmass(getDouble(metadata, "BORE-AIRMASS")),
342  _boresightRotAngle(getAngle(metadata, "BORE-ROTANG")),
343  _rotType(RotType::UNKNOWN),
344  _observatory(
345  getAngle(metadata, "OBS-LONG"),
346  getAngle(metadata, "OBS-LAT"),
347  getDouble(metadata, "OBS-ELEV")),
348  _weather(
349  getDouble(metadata, "AIRTEMP"),
350  getDouble(metadata, "AIRPRESS"),
351  getDouble(metadata, "HUMIDITY"))
352 {
353  auto key = "EXPID";
354  if (metadata.exists(key)) {
355  _exposureId = metadata.getAsInt64(key);
356  }
357 
358  key = "EXPTIME";
359  if (metadata.exists(key)) {
360  try {
361  _exposureTime = metadata.getAsDouble(key);
362  } catch (lsst::pex::exceptions::TypeError & err) {
363  // some old exposures have EXPTIME stored as a string
364  std::string exptimeStr = metadata.getAsString(key);
365  _exposureTime = std::stod(exptimeStr);
366  }
367  }
368 
369  key = "DATE-AVG";
370  if (metadata.exists(key)) {
371  if (metadata.exists("TIMESYS")) {
372  auto timesysName = boost::algorithm::trim_right_copy(metadata.getAsString("TIMESYS"));
373  if (timesysName != "TAI") {
374  // rather than try to deal with all the possible choices, which requires
375  // appending or deleting a "Z", depending on the time system, just give up.
376  // VisitInfo should be used on FITS headers that have been sanitized!
377  std::ostringstream os;
378  os << "TIMESYS = \"" << timesysName <<
379  "\"; VisitInfo requires TIMESYS to exist and to equal \"TAI\"";
380  throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError, os.str());
381  }
382  } else {
383  throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError,
384  "TIMESYS not found; VistitInfo requires TIMESYS to exist and to equal \"TAI\"");
385  }
386  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::TAI);
387  } else {
388  // DATE-AVG not found. For backwards compatibility look for TIME-MID, an outdated LSST keyword
389  // whose time system was UTC, despite a FITS comment claiming it was TAI. Ignore TIMESYS.
390  key = "TIME-MID";
391  if (metadata.exists(key)) {
392  _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::UTC);
393  }
394  }
395 
396  key = "ROTTYPE";
397  if (metadata.exists(key)) {
398  _rotType = rotTypeEnumFromStr(metadata.getAsString(key));
399  }
400 }
401 
402 bool VisitInfo::operator==(VisitInfo const & other) const {
403  return _exposureId == other.getExposureId()
404  && _exposureTime == other.getExposureTime()
405  && _darkTime == other.getDarkTime()
406  && _date == other.getDate()
407  && _ut1 == other.getUt1()
408  && _era == other.getEra()
409  && _boresightRaDec == other.getBoresightRaDec()
410  && _boresightAzAlt == other.getBoresightAzAlt()
413  && _rotType == other.getRotType()
414  && _observatory == other.getObservatory()
415  && _weather == other.getWeather();
416 }
417 
418 std::string VisitInfo::getPersistenceName() const {
419  return getVisitInfoPersistenceName();
420 }
421 
422 void VisitInfo::write(OutputArchiveHandle & handle) const {
423  VisitInfoSchema const & keys = VisitInfoSchema::get();
424  table::BaseCatalog cat = handle.makeCatalog(keys.schema);
425  PTR(table::BaseRecord) record = cat.addNew();
426  record->set(keys.exposureId, getExposureId());
427  record->set(keys.exposureTime, getExposureTime());
428  record->set(keys.darkTime, getDarkTime());
429  record->set(keys.tai, getDate().nsecs(::DateTime::TAI));
430  record->set(keys.ut1, getUt1());
431  record->set(keys.era, getEra());
432  record->set(keys.boresightRaDec, getBoresightRaDec());
433  auto boresightAzAlt = getBoresightAzAlt();
434  record->set(keys.boresightAzAlt_az, boresightAzAlt[0]);
435  record->set(keys.boresightAzAlt_alt, boresightAzAlt[1]);
436  record->set(keys.boresightAirmass, getBoresightAirmass());
437  record->set(keys.boresightRotAngle, getBoresightRotAngle());
438  record->set(keys.rotType, static_cast<int>(getRotType()));
439  auto observatory = getObservatory();
440  record->set(keys.latitude, observatory.getLatitude());
441  record->set(keys.longitude, observatory.getLongitude());
442  record->set(keys.elevation, observatory.getElevation());
443  auto weather = getWeather();
444  record->set(keys.airTemperature, weather.getAirTemperature());
445  record->set(keys.airPressure, weather.getAirPressure());
446  record->set(keys.humidity, weather.getHumidity());
447  handle.saveCatalog(cat);
448 }
449 
451  return getEra() + getObservatory().getLongitude();
452 }
453 
455  return getLocalEra() - getBoresightRaDec()[0];
456 }
457 
458 }}} // namespace
geom::Angle getBoresightHourAngle() const
Definition: VisitInfo.cc:454
virtual void write(OutputArchiveHandle &handle) const
Write the object to one or more catalogs.
Definition: VisitInfo.cc:422
table::Key< double > exposureTime
Definition: VisitInfo.cc:160
geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition: VisitInfo.h:167
table::Key< table::RecordId > exposureId
Definition: VisitInfo.cc:159
bool operator==(VisitInfo const &other) const
Definition: VisitInfo.cc:402
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:62
table::Key< double > darkTime
Definition: VisitInfo.cc:161
lsst::afw::coord::Coord Coord
Definition: misc.h:35
table::Key< std::string > name
Definition: ApCorrMap.cc:71
table::RecordId getExposureId() const
get exposure ID
Definition: VisitInfo.h:131
An object passed to Persistable::write to allow it to persist itself.
AngleUnit const radians
constant with units of radians
Definition: Angle.h:90
table::CoordKey boresightRaDec
Definition: VisitInfo.cc:165
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
Definition: Persistable.h:45
A custom container class for records, based on std::vector.
Definition: Catalog.h:95
Class for storing ordered metadata with comments.
Definition: PropertyList.h:82
coord::Coord getBoresightAzAlt() const
get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposur...
Definition: VisitInfo.h:154
afw::table::Schema schema
Definition: GaussianPsf.cc:41
table::Key< std::int64_t > tai
Definition: VisitInfo.cc:162
Include files required for standard LSST Exception handling.
RotType
Type of rotation.
Definition: VisitInfo.h:42
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
Information about a single exposure of an imaging camera.
Definition: VisitInfo.h:63
daf::base::DateTime _date
Definition: VisitInfo.h:196
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition: VisitInfo.h:146
void set(std::string const &name, T const &value)
Replace all values for a property name (possibly hierarchical) with a new value.
lsst::afw::coord::IcrsCoord IcrsCoord
Definition: misc.h:37
table::Key< geom::Angle > latitude
Definition: VisitInfo.cc:172
double getAsDouble(std::string const &name) const
Get the last value for any arithmetic property name (possibly hierarchical).
Definition: PropertySet.cc:406
bool exists(std::string const &name) const
Determine if a name (possibly hierarchical) exists.
Definition: PropertySet.cc:190
Rotation angle is unknown.
table::RecordId _exposureId
Definition: VisitInfo.h:193
table::Key< table::Array< Kernel::Pixel > > image
Definition: FixedKernel.cc:117
lsst::daf::base::PropertySet PropertySet
Definition: Wcs.cc:59
boost::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:470
std::int64_t RecordId
Type used for unique IDs for records.
Definition: misc.h:20
coord::IcrsCoord _boresightRaDec
Definition: VisitInfo.h:199
AngleUnit const degrees
Definition: Angle.h:91
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
Definition: VisitInfo.cc:297
A class representing an Angle.
Definition: Angle.h:103
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure...
Definition: VisitInfo.h:158
bool isValid() const
Is this date valid?
Definition: DateTime.h:196
lsst::afw::geom::Angle getLongitude() const
get telescope longitude (positive values are E of Greenwich)
Definition: Observatory.cc:58
table::Key< geom::Angle > longitude
Definition: VisitInfo.cc:173
coord::Coord _boresightAzAlt
Definition: VisitInfo.h:200
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition: VisitInfo.h:140
coord::Weather getWeather() const
get basic weather information
Definition: VisitInfo.h:176
std::string toString(Timescale scale) const
Get date as an ISO8601-formatted string.
Definition: DateTime.cc:514
coord::Observatory _observatory
Definition: VisitInfo.h:204
table::Key< double > boresightAirmass
Definition: VisitInfo.cc:168
geom::Angle _boresightRotAngle
Definition: VisitInfo.h:202
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition: VisitInfo.h:143
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
Base class for all records.
Definition: BaseRecord.h:27
virtual std::string getPersistenceName() const
Return the unique name used to persist this object and look up its factory.
Definition: VisitInfo.cc:418
Orientation of E,N with respected to detector X,Y; X is flipped, if necessary, to match the handednes...
lsst::afw::geom::Angle Angle
Definition: misc.h:38
table::Key< double > airPressure
Definition: VisitInfo.cc:177
#define PTR(...)
Definition: base.h:41
Class for storing generic metadata.
Definition: PropertySet.h:82
geom::Angle getLocalEra() const
Definition: VisitInfo.cc:450
table::Key< geom::Angle > boresightAzAlt_az
Definition: VisitInfo.cc:166
table::Key< int > rotType
Definition: VisitInfo.cc:170
VisitInfo(table::RecordId exposureId, double exposureTime, double darkTime, daf::base::DateTime const &date, double ut1, geom::Angle const &era, coord::IcrsCoord const &boresightRaDec, coord::Coord const &boresightAzAlt, double boresightAirmass, geom::Angle const &boresightRotAngle, RotType const &rotType, coord::Observatory const &observatory, coord::Weather const &weather)
Construct a VisitInfo.
Definition: VisitInfo.h:88
int stripVisitInfoKeywords(daf::base::PropertySet &metadata)
Remove VisitInfo-related keywords from the metadata.
Definition: VisitInfo.cc:279
orientation of Az/Alt with respect to detector X,Y; X is flipped, if necessary, to match the handedne...
virtual void remove(std::string const &name)
Removes all values for a property name (possibly hierarchical).
Definition: PropertySet.cc:754
table::Key< double > airTemperature
Definition: VisitInfo.cc:176
double asDegrees() const
Return an Angle&#39;s value as a double in degrees.
Definition: Angle.h:123
table::Key< double > ut1
Definition: VisitInfo.cc:163
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition: VisitInfo.h:173
table::Key< geom::Angle > era
Definition: VisitInfo.cc:164
int64_t getAsInt64(std::string const &name) const
Get the last value for a bool/char/short/int/int64_t property name (possibly hierarchical).
Definition: PropertySet.cc:372
table::Key< double > elevation
Definition: VisitInfo.cc:174
table::Key< double > humidity
Definition: VisitInfo.cc:178
std::string getAsString(std::string const &name) const
Get the last value for a string property name (possibly hierarchical).
Definition: PropertySet.cc:444
table::Key< geom::Angle > boresightRotAngle
Definition: VisitInfo.cc:169
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition: VisitInfo.h:134
coord::Weather _weather
Definition: VisitInfo.h:205
RotType getRotType() const
get rotation type of boresightRotAngle
Definition: VisitInfo.h:170
The position sent to the instrument rotator; the details depend on the rotator.
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec) ...
Definition: VisitInfo.h:137
coord::IcrsCoord 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:150
table::Key< geom::Angle > boresightAzAlt_alt
Definition: VisitInfo.cc:167
Functions to handle coordinates.