61 return std::make_shared<ApCorrMap>(*apCorrMap);
77 _psf(
std::const_pointer_cast<detection::Psf>(psf)),
78 _photoCalib(photoCalib),
80 _validPolygon(polygon),
82 _metadata(metadata ? metadata
83 :
std::shared_ptr<daf::
base::PropertySet>(new daf::
base::PropertyList())),
84 _coaddInputs(coaddInputs),
85 _apCorrMap(_cloneApCorrMap(apCorrMap)),
86 _visitInfo(visitInfo),
87 _transmissionCurve(transmissionCurve) {}
92 _photoCalib(other._photoCalib),
93 _detector(other._detector),
94 _validPolygon(other._validPolygon),
95 _filter(other._filter),
96 _metadata(other._metadata),
97 _coaddInputs(other._coaddInputs),
98 _apCorrMap(_cloneApCorrMap(other._apCorrMap)),
99 _visitInfo(other._visitInfo),
100 _transmissionCurve(other._transmissionCurve) {}
108 _photoCalib(other._photoCalib),
109 _detector(other._detector),
110 _validPolygon(other._validPolygon),
111 _filter(other._filter),
112 _metadata(other._metadata),
113 _coaddInputs(other._coaddInputs),
114 _apCorrMap(_cloneApCorrMap(other._apCorrMap)),
115 _visitInfo(other._visitInfo),
116 _transmissionCurve(other._transmissionCurve) {
117 if (copyMetadata) _metadata = _metadata->deepCopy();
121 if (&other !=
this) {
124 _photoCalib = other._photoCalib;
125 _detector = other._detector;
126 _validPolygon = other._validPolygon;
127 _filter = other._filter;
128 _metadata = other._metadata;
129 _coaddInputs = other._coaddInputs;
130 _apCorrMap = _cloneApCorrMap(other._apCorrMap);
131 _visitInfo = other._visitInfo;
132 _transmissionCurve = other._transmissionCurve;
143 ExposureInfo::FitsWriteData ExposureInfo::_startWriteFits(
lsst::geom::Point2I const& xy0)
const {
148 data.maskMetadata = data.imageMetadata;
149 data.varianceMetadata = data.imageMetadata;
161 data.metadata->set(
"AR_HDU", 5,
"HDU (1-indexed) containing the archive used to store ancillary objects");
164 data.metadata->set(
"COADD_INPUTS_ID", coaddInputsId,
"archive ID for coadd inputs catalogs");
168 data.metadata->set(
"AP_CORR_MAP_ID", apCorrMapId,
"archive ID for aperture correction map");
171 int psfId = data.archive.put(
getPsf());
172 data.metadata->set(
"PSF_ID", psfId,
"archive ID for the Exposure's main Psf");
175 int wcsId = data.archive.put(
getWcs());
176 data.metadata->set(
"SKYWCS_ID", wcsId,
"archive ID for the Exposure's main Wcs");
180 data.metadata->set(
"VALID_POLYGON_ID", polygonId,
"archive ID for the Exposure's valid polygon");
184 data.metadata->set(
"TRANSMISSION_CURVE_ID", transmissionCurveId,
185 "archive ID for the Exposure's transmission curve");
189 data.metadata->set(
"DETECTOR_ID", detectorId,
"archive ID for the Exposure's Detector");
193 data.metadata->set(
"PHOTOCALIB_ID", photoCalibId,
"archive ID for photometric calibration");
205 auto newWcs =
getWcs()->copyAtShiftedPixelOrigin(shift);
208 wcsMetadata = newWcs->getFitsMetadata(
true);
213 data.imageMetadata->combine(newWcs->getFitsMetadata(
true));
223 data.imageMetadata->set(
"LTV1", static_cast<double>(-xy0.getX()));
224 data.imageMetadata->set(
"LTV2", static_cast<double>(-xy0.getY()));
226 data.metadata->set(
"FILTER",
getFilter().getName());
228 data.metadata->set(
"DETNAME",
getDetector()->getName());
229 data.metadata->set(
"DETSER",
getDetector()->getSerial());
240 void ExposureInfo::_finishWriteFits(
fits::Fits& fitsfile, FitsWriteData
const&
data)
const {
241 data.archive.writeFits(fitsfile);
static std::string const & getFitsSerializationVersionName()
Get the version of FITS serialization version info name.
bool hasTransmissionCurve() const
Does this exposure have a transmission curve?
Class for storing ordered metadata with comments.
std::shared_ptr< PhotoCalib const > getPhotoCalib() const
Return the exposure's photometric calibration.
std::shared_ptr< image::VisitInfo const > getVisitInfo() const
Return the exposure's visit info.
bool hasPsf() const
Does this exposure have a Psf?
std::shared_ptr< ApCorrMap > getApCorrMap()
Return the exposure's aperture correction map (null pointer if !hasApCorrMap())
bool hasDetector() const
Does this exposure have Detector information?
static int getFitsSerializationVersion()
Get the version of FITS serialization that this ExposureInfo understands.
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
bool hasWcs() const
Does this exposure have a Wcs?
table::Key< table::Array< std::uint8_t > > wcs
LSST DM logging module built on log4cxx.
ExposureInfo & operator=(ExposureInfo const &other)
Assignment; deep-copies all components except the metadata.
void setVisitInfoMetadata(daf::base::PropertyList &metadata, VisitInfo const &visitInfo)
Set FITS metadata from a VisitInfo.
bool hasApCorrMap() const
Return true if the exposure has an aperture correction map.
A base class for image defects.
std::shared_ptr< detection::Psf > getPsf() const
Return the exposure's point-spread function.
void initApCorrMap()
Set the exposure's aperture correction map to a new, empty map.
bool hasValidPolygon() const
Does this exposure have a valid Polygon.
table::Key< int > detector
std::shared_ptr< geom::polygon::Polygon const > getValidPolygon() const
Return the valid Polygon.
Holds an integer identifier for an LSST filter.
std::shared_ptr< daf::base::PropertySet > getMetadata() const
Return flexible metadata.
std::shared_ptr< cameraGeom::Detector const > getDetector() const
Return the exposure's Detector information.
bool hasPhotoCalib() const
Does this exposure have a photometric calibration?
ItemVariant const * other
table::Key< int > version
ExposureInfo(std::shared_ptr< geom::SkyWcs const > const &wcs=std::shared_ptr< geom::SkyWcs const >(), std::shared_ptr< detection::Psf const > const &psf=std::shared_ptr< detection::Psf const >(), std::shared_ptr< PhotoCalib const > const &photoCalib=std::shared_ptr< PhotoCalib const >(), std::shared_ptr< cameraGeom::Detector const > const &detector=std::shared_ptr< cameraGeom::Detector const >(), std::shared_ptr< geom::polygon::Polygon const > const &polygon=std::shared_ptr< geom::polygon::Polygon const >(), Filter const &filter=Filter(), std::shared_ptr< daf::base::PropertySet > const &metadata=std::shared_ptr< daf::base::PropertySet >(), std::shared_ptr< CoaddInputs > const &coaddInputs=std::shared_ptr< CoaddInputs >(), std::shared_ptr< ApCorrMap > const &apCorrMap=std::shared_ptr< ApCorrMap >(), std::shared_ptr< image::VisitInfo const > const &visitInfo=std::shared_ptr< image::VisitInfo const >(), std::shared_ptr< TransmissionCurve const > const &transmissionCurve=std::shared_ptr< TransmissionCurve >())
Construct an ExposureInfo from its various components.
Extent< double, 2 > Extent2D
Backwards-compatibility support for depersisting the old Calib (FluxMag0/FluxMag0Err) objects...
#define LOG_GET(logger)
Returns a Log object associated with logger.
A collection of all the things that make an Exposure different from a MaskedImage.
std::shared_ptr< CoaddInputs > getCoaddInputs() const
Return a pair of catalogs that record the inputs, if this Exposure is a coadd (otherwise null)...
Implementation of the Photometric Calibration class.
std::shared_ptr< geom::SkyWcs const > getWcs() const
Return the WCS of the exposure.
Filter getFilter() const
Return the exposure's filter.
Reports errors that are due to events beyond the control of the program.
bool hasCoaddInputs() const
Does this exposure have coadd provenance catalogs?
std::shared_ptr< TransmissionCurve const > getTransmissionCurve() const
Return the exposure's transmission curve.