LSST Applications g0265f82a02+093ff98f47,g02d81e74bb+10352d6f39,g1f3e9fa97e+40b0fc677d,g2079a07aa2+14824f138e,g2bbee38e9b+093ff98f47,g337abbeb29+093ff98f47,g3ddfee87b4+064c02c7ee,g487adcacf7+7e842ebf4b,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g568d43a26c+1d7ac31cb0,g591dd9f2cf+fb1f69e2ea,g858d7b2824+10352d6f39,g8a8a8dda67+a6fc98d2e7,g8cdfe0ae6a+66d966b544,g99cad8db69+7ce8a7c20a,g9ddcbc5298+d4bad12328,ga1e77700b3+246acaaf9c,ga2e4dd1c03+064c02c7ee,ga8c6da7877+04f6ba86dc,gae46bcf261+093ff98f47,gb0e22166c9+3863383f4c,gba4ed39666+9664299f35,gbb8dafda3b+db40f59a7d,gbeb006f7da+e6a448e96d,gbf5cecdb8a+10352d6f39,gc0f3af6251+10a3fd39cd,gc120e1dc64+5839e50a77,gc28159a63d+093ff98f47,gcf0d15dbbd+064c02c7ee,gd2a12a3803+0c2c227a2b,gdaeeff99f8+a38ce5ea23,ge79ae78c31+093ff98f47,gee10cc3b42+a6fc98d2e7,gf1cff7945b+10352d6f39,w.2024.15
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Related Symbols | List of all members
lsst::afw::image::VisitInfo Class Reference

Information about a single exposure of an imaging camera. More...

#include <VisitInfo.h>

Inheritance diagram for lsst::afw::image::VisitInfo:
lsst::afw::table::io::PersistableFacade< VisitInfo > lsst::afw::typehandling::Storable lsst::afw::table::io::Persistable

Public Member Functions

 VisitInfo (double exposureTime, double darkTime, daf::base::DateTime const &date, double ut1, lsst::geom::Angle const &era, lsst::geom::SpherePoint const &boresightRaDec, lsst::geom::SpherePoint const &boresightAzAlt, double boresightAirmass, lsst::geom::Angle const &boresightRotAngle, RotType const &rotType, coord::Observatory const &observatory, coord::Weather const &weather, std::string const &instrumentLabel, table::RecordId const &id, double focusZ, std::string const &observationType, std::string const &scienceProgram, std::string const &observationReason, std::string const &object, bool hasSimulatedContent)
 Construct a VisitInfo.
 
 VisitInfo (daf::base::PropertySet const &metadata)
 
 ~VisitInfo () override=default
 
 VisitInfo (VisitInfo const &)=default
 
 VisitInfo (VisitInfo &&)=default
 
VisitInfooperator= (VisitInfo const &)=default
 
VisitInfooperator= (VisitInfo &&)=default
 
bool operator== (VisitInfo const &other) const
 
bool operator!= (VisitInfo const &other) const
 
std::size_t hash_value () const noexcept override
 Return a hash of this object.
 
double getExposureTime () const
 get exposure duration (shutter open time); (sec)
 
double getDarkTime () const
 get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)
 
daf::base::DateTime getDate () const
 get uniform date and time at middle of exposure
 
double getUt1 () const
 get UT1 (universal time) MJD date at middle of exposure
 
lsst::geom::Angle getEra () const
 get earth rotation angle at middle of exposure
 
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)
 
lsst::geom::SpherePoint getBoresightAzAlt () const
 get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposure, if it varies with time)
 
double getBoresightAirmass () const
 get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure, if it varies with time)
 
lsst::geom::Angle getBoresightRotAngle () const
 Get rotation angle at boresight at middle of exposure.
 
RotType getRotType () const
 get rotation type of boresightRotAngle
 
coord::Observatory getObservatory () const
 get observatory longitude, latitude and elevation
 
coord::Weather getWeather () const
 get basic weather information
 
bool isPersistable () const noexcept override
 Return true if this particular object can be persisted using afw::table::io.
 
lsst::geom::Angle getLocalEra () const
 
lsst::geom::Angle getBoresightHourAngle () const
 
std::string getInstrumentLabel () const
 
table::RecordId getId () const
 
double getFocusZ () const
 
std::string getObservationType () const
 
std::string getScienceProgram () const
 
std::string getObservationReason () const
 
std::string getObject () const
 
bool getHasSimulatedContent () const
 
lsst::geom::Angle getBoresightParAngle () const
 Get parallactic angle at the boresight.
 
std::shared_ptr< typehandling::StorablecloneStorable () const override
 Create a new VisitInfo that is a copy of this one.
 
std::string toString () const override
 Create a string representation of this object.
 
bool equals (typehandling::Storable const &other) const noexcept override
 Compare this object to another Storable.
 
void writeFits (std::string const &fileName, std::string const &mode="w") const
 Write the object to a regular FITS file.
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 Write the object to a FITS image in memory.
 
void writeFits (fits::Fits &fitsfile) const
 Write the object to an already-open FITS object.
 

Static Public Member Functions

static std::shared_ptr< VisitInforeadFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object.
 
static std::shared_ptr< VisitInforeadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 Read an object from a regular FITS file.
 
static std::shared_ptr< VisitInforeadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read an object from a FITS file in memory.
 
static std::shared_ptr< VisitInfodynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr.
 

Protected Types

using OutputArchiveHandle = io::OutputArchiveHandle
 

Protected Member Functions

std::string getPersistenceName () const override
 Return the unique name used to persist this object and look up its factory.
 
void write (OutputArchiveHandle &handle) const override
 Write the object to one or more catalogs.
 
virtual std::string getPythonModule () const
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.
 

Static Protected Member Functions

template<class T >
static bool singleClassEquals (T const &lhs, Storable const &rhs)
 Test if a Storable is of a particular class and equal to another object.
 

Related Symbols

(Note that these are not member symbols.)

std::ostreamoperator<< (std::ostream &os, Storable const &storable)
 Output operator for Storable.
 

Detailed Description

Information about a single exposure of an imaging camera.

Includes exposure duration and date, and telescope pointing and orientation.

All information is for the middle of the exposure and at the boresight (center of the focal plane). Thus for a mosaic camera VisitInfo is the same for all detectors in the mosaic.

VisitInfo is immutable.

Definition at line 68 of file VisitInfo.h.

Member Typedef Documentation

◆ OutputArchiveHandle

using lsst::afw::table::io::Persistable::OutputArchiveHandle = io::OutputArchiveHandle
protectedinherited

Definition at line 108 of file Persistable.h.

Constructor & Destructor Documentation

◆ VisitInfo() [1/4]

lsst::afw::image::VisitInfo::VisitInfo ( double exposureTime,
double darkTime,
daf::base::DateTime const & date,
double ut1,
lsst::geom::Angle const & era,
lsst::geom::SpherePoint const & boresightRaDec,
lsst::geom::SpherePoint const & boresightAzAlt,
double boresightAirmass,
lsst::geom::Angle const & boresightRotAngle,
RotType const & rotType,
coord::Observatory const & observatory,
coord::Weather const & weather,
std::string const & instrumentLabel,
table::RecordId const & id,
double focusZ,
std::string const & observationType,
std::string const & scienceProgram,
std::string const & observationReason,
std::string const & object,
bool hasSimulatedContent )
inlineexplicit

Construct a VisitInfo.

Parameters
[in]exposureTimeexposure duration (shutter open time); (sec)
[in]darkTimetime from CCD flush to readout, including shutter open time (despite the name); (sec)
[in]dateTAI (international atomic time) MJD date at middle of exposure
[in]ut1UT1 (universal time) MJD date at middle of exposure
[in]eraearth rotation angle at middle of exposure
[in]boresightRaDecICRS RA/Dec of boresight at middle of exposure
[in]boresightAzAltrefracted apparent topocentric Az/Alt of boresight at middle of exposure
[in]boresightAirmassairmass at the boresight, relative to zenith at sea level
[in]boresightRotAnglerotation angle at boresight at middle of exposure; see getBoresightRotAngle for details
[in]rotTyperotation type
[in]observatoryobservatory longitude, latitude and altitude
[in]weatherbasic weather information for computing air mass
[in]instrumentLabelShort name of the instrument that took this data (e.g. "HSC")
[in]idIdentifier of this full focal plane data.
[in]focusZDefocal distance of main-cam hexapod in mm. 0 is in focus.; Extra-focal is negative while intra-focal is positive.
[in]observationTypeType of this observation (e.g. science, dark, flat, bias, focus).
[in]scienceProgramObserving program (survey or proposal) identifier.
[in]observationReasonReason this observation was taken, or its purpose ('science' and 'calibration' are common values).
[in]objectObject of interest or field name.
[in]hasSimulatedContentWas any part of this observation simulated?

Definition at line 98 of file VisitInfo.h.

107 : _exposureTime(exposureTime),
108 _darkTime(darkTime),
109 _date(date),
110 _ut1(ut1),
111 _era(era),
112 _boresightRaDec(boresightRaDec),
113 _boresightAzAlt(boresightAzAlt),
114 _boresightAirmass(boresightAirmass),
115 _boresightRotAngle(boresightRotAngle),
116 _rotType(rotType),
117 _observatory(observatory),
118 _weather(weather),
119 _instrumentLabel(instrumentLabel),
120 _id(id),
121 _focusZ(focusZ),
122 _observationType(observationType),
123 _scienceProgram(scienceProgram),
124 _observationReason(observationReason),
125 _object(object),
126 _hasSimulatedContent(hasSimulatedContent) {}
table::Key< std::string > observationReason
Definition VisitInfo.cc:231
table::Key< std::string > scienceProgram
Definition VisitInfo.cc:230
table::Key< std::string > observationType
Definition VisitInfo.cc:229
table::Key< double > exposureTime
Definition VisitInfo.cc:202
table::Key< lsst::geom::Angle > era
Definition VisitInfo.cc:206
table::Key< int > rotType
Definition VisitInfo.cc:212
table::Key< double > darkTime
Definition VisitInfo.cc:203
table::Key< std::string > instrumentLabel
Definition VisitInfo.cc:222
table::CoordKey boresightRaDec
Definition VisitInfo.cc:207
table::Key< double > boresightAirmass
Definition VisitInfo.cc:210
table::Key< afw::table::Flag > hasSimulatedContent
Definition VisitInfo.cc:233
table::Key< double > focusZ
Definition VisitInfo.cc:227
table::Key< lsst::geom::Angle > boresightRotAngle
Definition VisitInfo.cc:211
table::Key< double > ut1
Definition VisitInfo.cc:205

◆ VisitInfo() [2/4]

lsst::afw::image::VisitInfo::VisitInfo ( daf::base::PropertySet const & metadata)
explicit

Definition at line 453 of file VisitInfo.cc.

454 : _exposureTime(nan), // don't use getDouble because str values are also accepted
455 _darkTime(getDouble(metadata, "DARKTIME")),
456 _date(),
457 _ut1(getDouble(metadata, "MJD-AVG-UT1")),
458 _era(getAngle(metadata, "AVG-ERA")),
459 _boresightRaDec(
460 lsst::geom::SpherePoint(getAngle(metadata, "BORE-RA"), getAngle(metadata, "BORE-DEC"))),
461 _boresightAzAlt(
462 lsst::geom::SpherePoint(getAngle(metadata, "BORE-AZ"), getAngle(metadata, "BORE-ALT"))),
463 _boresightAirmass(getDouble(metadata, "BORE-AIRMASS")),
464 _boresightRotAngle(getAngle(metadata, "BORE-ROTANG")),
465 _rotType(RotType::UNKNOWN),
466 _observatory(getAngle(metadata, "OBS-LONG"), getAngle(metadata, "OBS-LAT"),
467 getDouble(metadata, "OBS-ELEV")),
468 _weather(getDouble(metadata, "AIRTEMP"), getDouble(metadata, "AIRPRESS"),
469 getDouble(metadata, "HUMIDITY")),
470 _instrumentLabel(getString(metadata, "INSTRUMENT")),
471 _id(0),
472 _focusZ(getDouble(metadata, "FOCUSZ")),
473 _observationType(getString(metadata, "OBSTYPE")),
474 _scienceProgram(getString(metadata, "PROGRAM")),
475 _observationReason(getString(metadata, "REASON")),
476 _object(getString(metadata, "OBJECT")),
477 // default false for backwards compatibility
478 _hasSimulatedContent(false) {
479 auto key = "IDNUM";
480 if (metadata.exists(key) && !metadata.isUndefined(key)) {
481 _id = metadata.getAsInt64(key);
482 }
483
484 key = "EXPTIME";
485 if (metadata.exists(key) && !metadata.isUndefined(key)) {
486 try {
487 _exposureTime = metadata.getAsDouble(key);
488 } catch (lsst::pex::exceptions::TypeError& err) {
489 // some old exposures have EXPTIME stored as a string
490 std::string exptimeStr = metadata.getAsString(key);
491 _exposureTime = std::stod(exptimeStr);
492 }
493 }
494
495 key = "DATE-AVG";
496 if (metadata.exists(key) && !metadata.isUndefined(key)) {
497 if (metadata.exists("TIMESYS")) {
498 auto timesysName = boost::algorithm::trim_right_copy(metadata.getAsString("TIMESYS"));
499 if (timesysName != "TAI") {
500 // rather than try to deal with all the possible choices, which requires
501 // appending or deleting a "Z", depending on the time system, just give up.
502 // VisitInfo should be used on FITS headers that have been sanitized!
504 os << "TIMESYS = \"" << timesysName
505 << "\"; VisitInfo requires TIMESYS to exist and to equal \"TAI\"";
507 }
508 } else {
510 "TIMESYS not found; VistitInfo requires TIMESYS to exist and to equal \"TAI\"");
511 }
512 _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::TAI);
513 } else {
514 // DATE-AVG not found. For backwards compatibility look for TIME-MID, an outdated LSST keyword
515 // whose time system was UTC, despite a FITS comment claiming it was TAI. Ignore TIMESYS.
516 key = "TIME-MID";
517 if (metadata.exists(key) && !metadata.isUndefined(key)) {
518 _date = ::DateTime(boost::algorithm::trim_right_copy(metadata.getAsString(key)), ::DateTime::UTC);
519 }
520 }
521
522 key = "ROTTYPE";
523 if (metadata.exists(key) && !metadata.isUndefined(key)) {
524 _rotType = rotTypeEnumFromStr(metadata.getAsString(key));
525 }
526
527 key = "HAS-SIMULATED-CONTENT";
528 if (metadata.exists(key) && !metadata.isUndefined(key)) {
529 _hasSimulatedContent = metadata.getAsBool(key);
530 }
531}
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48
std::ostream * os
Definition Schema.cc:557
Class for handling dates/times, including MJD, UTC, and TAI.
Definition DateTime.h:64
Point in an unspecified spherical coordinate system.
Definition SpherePoint.h:57
Reports errors that are due to events beyond the control of the program.
Definition Runtime.h:104
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition Runtime.h:167
@ UNKNOWN
Rotation angle is unknown.
T stod(T... args)

◆ ~VisitInfo()

lsst::afw::image::VisitInfo::~VisitInfo ( )
overridedefault

◆ VisitInfo() [3/4]

lsst::afw::image::VisitInfo::VisitInfo ( VisitInfo const & )
default

◆ VisitInfo() [4/4]

lsst::afw::image::VisitInfo::VisitInfo ( VisitInfo && )
default

Member Function Documentation

◆ cloneStorable()

std::shared_ptr< typehandling::Storable > lsst::afw::image::VisitInfo::cloneStorable ( ) const
overridevirtual

Create a new VisitInfo that is a copy of this one.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 630 of file VisitInfo.cc.

630 {
631 return std::make_unique<VisitInfo>(*this);
632}

◆ dynamicCast()

Dynamically cast a shared_ptr.

Dynamically cast a shared pointer and raise on failure.

You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;

Exceptions
lsst::pex::exceptions::LogicErrorif the cast fails

param[in] ptr The pointer to be cast.

Returns
The cast pointer.
Exceptions
lsst::pex::exceptions::TypeErrorIf the dynamic cast fails.

Definition at line 218 of file Persistable.cc.

◆ equals()

bool lsst::afw::image::VisitInfo::equals ( typehandling::Storable const & other) const
overridevirtualnoexcept

Compare this object to another Storable.

Returns
*this == other if other is a VisitInfo; otherwise false.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 634 of file VisitInfo.cc.

634 {
635 return singleClassEquals(*this, other);
636}
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

◆ getBoresightAirmass()

double lsst::afw::image::VisitInfo::getBoresightAirmass ( ) const
inline

get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure, if it varies with time)

Definition at line 168 of file VisitInfo.h.

168{ return _boresightAirmass; }

◆ getBoresightAzAlt()

lsst::geom::SpherePoint lsst::afw::image::VisitInfo::getBoresightAzAlt ( ) const
inline

get refracted apparent topocentric Az/Alt position at the boresight (and at the middle of the exposure, if it varies with time)

Definition at line 164 of file VisitInfo.h.

164{ return _boresightAzAlt; }

◆ getBoresightHourAngle()

lsst::geom::Angle lsst::afw::image::VisitInfo::getBoresightHourAngle ( ) const

Definition at line 614 of file VisitInfo.cc.

614{ return getLocalEra() - getBoresightRaDec()[0]; }
lsst::geom::Angle getLocalEra() const
Definition VisitInfo.cc:612
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:160

◆ getBoresightParAngle()

lsst::geom::Angle lsst::afw::image::VisitInfo::getBoresightParAngle ( ) const

Get parallactic angle at the boresight.

Equal to the angle between the North celestial pole and Zenith at the boresight. Or, the angular separation between two great circle arcs that meet at the object: One passing through the North celestial pole, and the other through zenith. For an object on the meridian the angle is zero if it is South of zenith and pi if it is North of zenith The angle is positive for objects East of the meridian, and negative for objects to the West.

Compute the parallactic angle. Defined as the angle between the North celestial pole and Zenith at the boresight.

Definition at line 616 of file VisitInfo.cc.

616 {
621 double _parallactic_y, _parallactic_x, result;
622 _parallactic_y = sin(getBoresightHourAngle().asRadians());
623 _parallactic_x =
624 cos((getBoresightRaDec()[1]).asRadians()) * tan(getObservatory().getLatitude().asRadians()) -
625 sin((getBoresightRaDec()[1]).asRadians()) * cos(getBoresightHourAngle().asRadians());
626 result = atan2(_parallactic_y, _parallactic_x);
628}
py::object result
Definition _schema.cc:429
T atan2(T... args)
lsst::geom::Angle getBoresightHourAngle() const
Definition VisitInfo.cc:614
coord::Observatory getObservatory() const
get observatory longitude, latitude and elevation
Definition VisitInfo.h:182
AngleUnit constexpr radians
constant with units of radians
Definition Angle.h:109
T tan(T... args)

◆ getBoresightRaDec()

lsst::geom::SpherePoint lsst::afw::image::VisitInfo::getBoresightRaDec ( ) const
inline

get ICRS RA/Dec position at the boresight (and at the middle of the exposure, if it varies with time)

Definition at line 160 of file VisitInfo.h.

160{ return _boresightRaDec; }

◆ getBoresightRotAngle()

lsst::geom::Angle lsst::afw::image::VisitInfo::getBoresightRotAngle ( ) const
inline

Get rotation angle at boresight at middle of exposure.

The meaning of rotation angle depends on rotType. For example, if rotType is SKY the angle is the position angle of the focal plane +Y with respect to North.

Definition at line 176 of file VisitInfo.h.

176{ return _boresightRotAngle; }

◆ getDarkTime()

double lsst::afw::image::VisitInfo::getDarkTime ( ) const
inline

get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)

Definition at line 147 of file VisitInfo.h.

147{ return _darkTime; }

◆ getDate()

daf::base::DateTime lsst::afw::image::VisitInfo::getDate ( ) const
inline

get uniform date and time at middle of exposure

Definition at line 150 of file VisitInfo.h.

150{ return _date; }

◆ getEra()

lsst::geom::Angle lsst::afw::image::VisitInfo::getEra ( ) const
inline

get earth rotation angle at middle of exposure

Definition at line 156 of file VisitInfo.h.

156{ return _era; }

◆ getExposureTime()

double lsst::afw::image::VisitInfo::getExposureTime ( ) const
inline

get exposure duration (shutter open time); (sec)

Definition at line 144 of file VisitInfo.h.

144{ return _exposureTime; }

◆ getFocusZ()

double lsst::afw::image::VisitInfo::getFocusZ ( ) const
inline

Definition at line 200 of file VisitInfo.h.

200{ return _focusZ; }

◆ getHasSimulatedContent()

bool lsst::afw::image::VisitInfo::getHasSimulatedContent ( ) const
inline

Definition at line 206 of file VisitInfo.h.

206{ return _hasSimulatedContent; }

◆ getId()

table::RecordId lsst::afw::image::VisitInfo::getId ( ) const
inline

Definition at line 197 of file VisitInfo.h.

197{ return _id; }

◆ getInstrumentLabel()

std::string lsst::afw::image::VisitInfo::getInstrumentLabel ( ) const
inline

Definition at line 195 of file VisitInfo.h.

195{ return _instrumentLabel; }

◆ getLocalEra()

lsst::geom::Angle lsst::afw::image::VisitInfo::getLocalEra ( ) const

Definition at line 612 of file VisitInfo.cc.

612{ return getEra() + getObservatory().getLongitude(); }
lsst::geom::Angle getLongitude() const noexcept
get telescope longitude (positive values are E of Greenwich)
lsst::geom::Angle getEra() const
get earth rotation angle at middle of exposure
Definition VisitInfo.h:156

◆ getObject()

std::string lsst::afw::image::VisitInfo::getObject ( ) const
inline

Definition at line 205 of file VisitInfo.h.

205{ return _object; }

◆ getObservationReason()

std::string lsst::afw::image::VisitInfo::getObservationReason ( ) const
inline

Definition at line 204 of file VisitInfo.h.

204{ return _observationReason; }

◆ getObservationType()

std::string lsst::afw::image::VisitInfo::getObservationType ( ) const
inline

Definition at line 202 of file VisitInfo.h.

202{ return _observationType; }

◆ getObservatory()

coord::Observatory lsst::afw::image::VisitInfo::getObservatory ( ) const
inline

get observatory longitude, latitude and elevation

Definition at line 182 of file VisitInfo.h.

182{ return _observatory; }

◆ getPersistenceName()

std::string lsst::afw::image::VisitInfo::getPersistenceName ( ) const
overrideprotectedvirtual

Return the unique name used to persist this object and look up its factory.

Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 574 of file VisitInfo.cc.

574{ return getVisitInfoPersistenceName(); }

◆ getPythonModule()

std::string lsst::afw::table::io::Persistable::getPythonModule ( ) const
protectedvirtualinherited

Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.

Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.

Will be ignored if empty.

Reimplemented in lsst::afw::image::FilterLabel, lsst::afw::cameraGeom::Detector, lsst::afw::cameraGeom::DetectorCollection, lsst::afw::cameraGeom::TransformMap, lsst::afw::detection::Footprint, lsst::afw::detection::GaussianPsf, lsst::afw::geom::SkyWcs, lsst::afw::geom::SpanSet, lsst::afw::geom::Transform< FromEndpoint, ToEndpoint >, lsst::afw::geom::Transform< afw::geom::Point2Endpoint, afw::geom::GenericEndpoint >, lsst::afw::image::ApCorrMap, lsst::afw::image::CoaddInputs, lsst::afw::image::TransmissionCurve, lsst::afw::math::ChebyshevBoundedField, lsst::afw::math::Function< double >, lsst::afw::math::Function< Kernel::Pixel >, lsst::afw::math::Function< Pixel >, lsst::afw::math::Function< ReturnT >, lsst::afw::math::Kernel, lsst::afw::math::PixelAreaBoundedField, lsst::afw::math::ProductBoundedField, lsst::afw::math::TransformBoundedField, lsst::afw::math::LanczosWarpingKernel, lsst::afw::math::BilinearWarpingKernel, lsst::afw::math::NearestWarpingKernel, lsst::afw::math::WarpingControl, lsst::afw::typehandling::StorableHelper< Base >, lsst::meas::algorithms::CoaddBoundedField, lsst::meas::algorithms::CoaddPsf, lsst::meas::algorithms::KernelPsf, lsst::meas::algorithms::WarpedPsf, lsst::meas::extensions::psfex::PsfexPsf, and lsst::meas::modelfit::Mixture.

Definition at line 36 of file Persistable.cc.

36{ return std::string(); }

◆ getRotType()

RotType lsst::afw::image::VisitInfo::getRotType ( ) const
inline

get rotation type of boresightRotAngle

Definition at line 179 of file VisitInfo.h.

179{ return _rotType; }

◆ getScienceProgram()

std::string lsst::afw::image::VisitInfo::getScienceProgram ( ) const
inline

Definition at line 203 of file VisitInfo.h.

203{ return _scienceProgram; }

◆ getUt1()

double lsst::afw::image::VisitInfo::getUt1 ( ) const
inline

get UT1 (universal time) MJD date at middle of exposure

Definition at line 153 of file VisitInfo.h.

153{ return _ut1; }

◆ getWeather()

coord::Weather lsst::afw::image::VisitInfo::getWeather ( ) const
inline

get basic weather information

Definition at line 185 of file VisitInfo.h.

185{ return _weather; }

◆ hash_value()

std::size_t lsst::afw::image::VisitInfo::hash_value ( ) const
overridevirtualnoexcept

Return a hash of this object.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 566 of file VisitInfo.cc.

566 {
567 // Completely arbitrary seed
568 return utils::hashCombine(17, _exposureTime, _darkTime, _date, _ut1, _era, _boresightRaDec,
569 _boresightAzAlt, _boresightAirmass, _boresightRotAngle, _rotType, _observatory,
570 _weather, _instrumentLabel, _id, _focusZ, _observationType, _scienceProgram,
571 _observationReason, _object, _hasSimulatedContent);
572}
std::size_t hashCombine(std::size_t seed) noexcept
Combine hashes.
Definition hashCombine.h:35

◆ isPersistable()

bool lsst::afw::image::VisitInfo::isPersistable ( ) const
inlineoverridevirtualnoexcept

Return true if this particular object can be persisted using afw::table::io.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 187 of file VisitInfo.h.

187{ return true; }

◆ operator!=()

bool lsst::afw::image::VisitInfo::operator!= ( VisitInfo const & other) const
inline

Definition at line 138 of file VisitInfo.h.

138{ return !(*this == other); };

◆ operator=() [1/2]

VisitInfo & lsst::afw::image::VisitInfo::operator= ( VisitInfo && )
default

◆ operator=() [2/2]

VisitInfo & lsst::afw::image::VisitInfo::operator= ( VisitInfo const & )
default

◆ operator==()

bool lsst::afw::image::VisitInfo::operator== ( VisitInfo const & other) const

Definition at line 551 of file VisitInfo.cc.

551 {
552 return _eqOrNan(_exposureTime, other.getExposureTime()) && _eqOrNan(_darkTime, other.getDarkTime()) &&
553 _date == other.getDate() && _eqOrNan(_ut1, other.getUt1()) && _eqOrNan(_era, other.getEra()) &&
554 _eqOrNonFinite(_boresightRaDec, other.getBoresightRaDec()) &&
555 _eqOrNonFinite(_boresightAzAlt, other.getBoresightAzAlt()) &&
556 _eqOrNan(_boresightAirmass, other.getBoresightAirmass()) &&
557 _eqOrNan(_boresightRotAngle, other.getBoresightRotAngle()) && _rotType == other.getRotType() &&
558 _observatory == other.getObservatory() && _weather == other.getWeather() &&
559 _instrumentLabel == other.getInstrumentLabel() && _id == other.getId() &&
560 _eqOrNan(_focusZ, other.getFocusZ()) && _observationType == other.getObservationType() &&
561 _scienceProgram == other.getScienceProgram() &&
562 _observationReason == other.getObservationReason() && _object == other.getObject() &&
563 _hasSimulatedContent == other.getHasSimulatedContent();
564}
bool _eqOrNonFinite(lsst::geom::SpherePoint const &lhs, lsst::geom::SpherePoint const &rhs) noexcept
Test whether two SpherePoints are exactly equal or invalid.
Definition VisitInfo.cc:547
bool _eqOrNan(double lhs, double rhs) noexcept
Test whether two numbers are exactly equal or both NaN.
Definition VisitInfo.cc:539

◆ readFits() [1/3]

static std::shared_ptr< VisitInfo > lsst::afw::table::io::PersistableFacade< VisitInfo >::readFits ( fits::Fits & fitsfile)
inlinestaticinherited

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 183 of file Persistable.h.

◆ readFits() [2/3]

static std::shared_ptr< VisitInfo > lsst::afw::table::io::PersistableFacade< VisitInfo >::readFits ( fits::MemFileManager & manager,
int hdu = fits::DEFAULT_HDU )
inlinestaticinherited

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 205 of file Persistable.h.

◆ readFits() [3/3]

static std::shared_ptr< VisitInfo > lsst::afw::table::io::PersistableFacade< VisitInfo >::readFits ( std::string const & fileName,
int hdu = fits::DEFAULT_HDU )
inlinestaticinherited

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 194 of file Persistable.h.

◆ singleClassEquals()

template<class T >
static bool lsst::afw::typehandling::Storable::singleClassEquals ( T const & lhs,
Storable const & rhs )
inlinestaticprotectedinherited

Test if a Storable is of a particular class and equal to another object.

This method template simplifies implementations of equals that delegate to operator== without supporting cross-class comparisons.

Template Parameters
TThe class expected of the two objects to be compared.
Parameters
lhs,rhsThe objects to compare. Note that rhs need not be a T, while lhs must be.
Returns
true if rhs is a T and lhs == rhs; false otherwise.
Exception Safety
Provides the same level of exception safety as operator==. Most implementations of operator== do not throw.
Note
This method template calls operator== with both arguments of compile-time type T const&. Its use is not recommended if there would be any ambiguity as to which operator== gets picked by overload resolution.

This method template is typically called from equals as:

bool MyType::equals(Storable const& other) const noexcept {
    return singleClassEquals(*this, other);
}

Definition at line 151 of file Storable.h.

151 {
152 auto typedRhs = dynamic_cast<T const*>(&rhs);
153 if (typedRhs != nullptr) {
154 return lhs == *typedRhs;
155 } else {
156 return false;
157 }
158 }

◆ toString()

std::string lsst::afw::image::VisitInfo::toString ( ) const
overridevirtual

Create a string representation of this object.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 638 of file VisitInfo.cc.

638 {
639 std::stringstream buffer;
640 buffer << "VisitInfo(";
641 buffer << "exposureTime=" << getExposureTime() << ", ";
642 buffer << "darkTime=" << getDarkTime() << ", ";
643 buffer << "date=" << (getDate().isValid() ? getDate().toString(daf::base::DateTime::TAI) : "<invalid>")
644 << ", ";
645 buffer << "UT1=" << getUt1() << ", ";
646 buffer << "ERA=" << getEra() << ", ";
647 buffer << "boresightRaDec=" << getBoresightRaDec() << ", ";
648 buffer << "boresightAzAlt=" << getBoresightAzAlt() << ", ";
649 buffer << "boresightAirmass=" << getBoresightAirmass() << ", ";
650 buffer << "boresightRotAngle=" << getBoresightRotAngle() << ", ";
651 buffer << "rotType=" << static_cast<int>(getRotType()) << ", ";
652 buffer << "observatory=" << getObservatory() << ", ";
653 buffer << "weather=" << getWeather() << ", ";
654 buffer << "instrumentLabel='" << getInstrumentLabel() << "', ";
655 buffer << "id=" << getId() << ", ";
656 buffer << "focusZ=" << getFocusZ() << ", ";
657 buffer << "observationType='" << getObservationType() << "', ";
658 buffer << "scienceProgram='" << getScienceProgram() << "', ";
659 buffer << "observationReason='" << getObservationReason() << "', ";
660 buffer << "object='" << getObject() << "', ";
661 buffer << "hasSimulatedContent=" << std::boolalpha << getHasSimulatedContent();
662 buffer << ")";
663 return buffer.str();
664}
T boolalpha(T... args)
daf::base::DateTime getDate() const
get uniform date and time at middle of exposure
Definition VisitInfo.h:150
coord::Weather getWeather() const
get basic weather information
Definition VisitInfo.h:185
double getUt1() const
get UT1 (universal time) MJD date at middle of exposure
Definition VisitInfo.h:153
double getBoresightAirmass() const
get airmass at the boresight, relative to zenith at sea level (and at the middle of the exposure,...
Definition VisitInfo.h:168
std::string getScienceProgram() const
Definition VisitInfo.h:203
lsst::geom::Angle getBoresightRotAngle() const
Get rotation angle at boresight at middle of exposure.
Definition VisitInfo.h:176
table::RecordId getId() const
Definition VisitInfo.h:197
std::string getObservationReason() const
Definition VisitInfo.h:204
double getExposureTime() const
get exposure duration (shutter open time); (sec)
Definition VisitInfo.h:144
RotType getRotType() const
get rotation type of boresightRotAngle
Definition VisitInfo.h:179
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:164
std::string getObject() const
Definition VisitInfo.h:205
std::string getInstrumentLabel() const
Definition VisitInfo.h:195
bool getHasSimulatedContent() const
Definition VisitInfo.h:206
double getDarkTime() const
get time from CCD flush to exposure readout, including shutter open time (despite the name); (sec)
Definition VisitInfo.h:147
std::string getObservationType() const
Definition VisitInfo.h:202
std::string toString(Timescale scale) const
Get date as an ISO8601-formatted string.
Definition DateTime.cc:500
bool isValid() const
Is this date valid?
Definition DateTime.h:203
T str(T... args)

◆ write()

void lsst::afw::image::VisitInfo::write ( OutputArchiveHandle & handle) const
overrideprotectedvirtual

Write the object to one or more catalogs.

The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 576 of file VisitInfo.cc.

576 {
577 VisitInfoSchema const& keys = VisitInfoSchema::get();
578 table::BaseCatalog cat = handle.makeCatalog(keys.schema);
579 std::shared_ptr<table::BaseRecord> record = cat.addNew();
580 record->set(keys.exposureTime, getExposureTime());
581 record->set(keys.darkTime, getDarkTime());
582 record->set(keys.tai, getDate().nsecs(::DateTime::TAI));
583 record->set(keys.ut1, getUt1());
584 record->set(keys.era, getEra());
585 record->set(keys.boresightRaDec, getBoresightRaDec());
586 auto boresightAzAlt = getBoresightAzAlt();
587 record->set(keys.boresightAzAlt_az, boresightAzAlt[0]);
588 record->set(keys.boresightAzAlt_alt, boresightAzAlt[1]);
589 record->set(keys.boresightAirmass, getBoresightAirmass());
590 record->set(keys.boresightRotAngle, getBoresightRotAngle());
591 record->set(keys.rotType, static_cast<int>(getRotType()));
592 auto observatory = getObservatory();
593 record->set(keys.latitude, observatory.getLatitude());
594 record->set(keys.longitude, observatory.getLongitude());
595 record->set(keys.elevation, observatory.getElevation());
596 auto weather = getWeather();
597 record->set(keys.airTemperature, weather.getAirTemperature());
598 record->set(keys.airPressure, weather.getAirPressure());
599 record->set(keys.humidity, weather.getHumidity());
600 record->set(keys.instrumentLabel, getInstrumentLabel());
601 record->set(keys.version, SERIALIZATION_VERSION);
602 record->set(keys.idnum, getId());
603 record->set(keys.focusZ, getFocusZ());
604 record->set(keys.observationType, getObservationType());
605 record->set(keys.scienceProgram, getScienceProgram());
606 record->set(keys.observationReason, getObservationReason());
607 record->set(keys.object, getObject());
608 record->set(keys.hasSimulatedContent, getHasSimulatedContent());
609 handle.saveCatalog(cat);
610}
CatalogT< BaseRecord > BaseCatalog
Definition fwd.h:72

◆ writeFits() [1/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::Fits & fitsfile) const
inherited

Write the object to an already-open FITS object.

Parameters
[in]fitsfileOpen FITS object to write to.

Definition at line 18 of file Persistable.cc.

18 {
19 OutputArchive archive;
20 archive.put(this);
21 archive.writeFits(fitsfile);
22}

◆ writeFits() [2/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::MemFileManager & manager,
std::string const & mode = "w" ) const
inherited

Write the object to a FITS image in memory.

Parameters
[in]managerName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

Definition at line 29 of file Persistable.cc.

29 {
30 fits::Fits fitsfile(manager, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
31 writeFits(fitsfile);
32}
void writeFits(std::string const &fileName, std::string const &mode="w") const
Write the object to a regular FITS file.

◆ writeFits() [3/3]

void lsst::afw::table::io::Persistable::writeFits ( std::string const & fileName,
std::string const & mode = "w" ) const
inherited

Write the object to a regular FITS file.

Parameters
[in]fileNameName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

Definition at line 24 of file Persistable.cc.

24 {
25 fits::Fits fitsfile(fileName, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
26 writeFits(fitsfile);
27}

Friends And Related Symbol Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream & os,
Storable const & storable )
related

Output operator for Storable.

Parameters
osthe desired output stream
storablethe object to print
Returns
a reference to os
Exceptions
UnsupportedOperationExceptionThrown if storable does not have an implementation of Storable::toString.

Definition at line 174 of file Storable.h.

174 {
175 return os << storable.toString();
176}

The documentation for this class was generated from the following files: