33 namespace lsst {
namespace afw {
namespace image {
40 if (metadata.exists(name)) {
41 r = metadata.get<
int>(name);
42 metadata.remove(name);
72 ) : _wcs(_cloneWcs(wcs)),
73 _psf(boost::const_pointer_cast<detection::Psf>(psf)),
78 _coaddInputs(coaddInputs)
82 _wcs(_cloneWcs(other._wcs)),
84 _calib(_cloneCalib(other._calib)),
85 _detector(other._detector),
86 _filter(other._filter),
88 _coaddInputs(other._coaddInputs)
92 _wcs(_cloneWcs(other._wcs)),
94 _calib(_cloneCalib(other._calib)),
95 _detector(other._detector),
96 _filter(other._filter),
98 _coaddInputs(other._coaddInputs)
104 if (&other !=
this) {
132 data.
metadata->set(
"AR_HDU", 5,
"HDU containing the archive used to store ancillary objects");
135 data.
metadata->set(
"COADD_INPUTS_ID", coaddInputsId,
"archive ID for coadd inputs catalogs");
139 data.
metadata->set(
"PSF_ID", psfId,
"archive ID for the Exposure's main Psf");
143 data.
metadata->set(
"WCS_ID", wcsId,
"archive ID for the Exposure's main Wcs");
153 newWcs->shiftReferencePixel(-xy0.getX(), -xy0.getY() );
201 if (!imageMetadata->
exists(
"INHERIT")) {
207 metadata = imageMetadata;
217 int archiveHdu = popInt(*metadata,
"AR_HDU");
220 fitsfile.
setHdu(archiveHdu);
226 int psfId = popInt(*metadata,
"PSF_ID");
229 }
catch (pex::exceptions::NotFoundError & err) {
231 boost::format(
"Could not read PSF; setting to null: %s") % err.what()
234 int wcsId = popInt(*metadata,
"WCS_ID");
237 }
catch (pex::exceptions::NotFoundError & err) {
239 boost::format(
"Could not read WCS; setting to null: %s") % err.what()
242 int coaddInputsId = popInt(*metadata,
"COADD_INPUTS_ID");
245 }
catch (pex::exceptions::NotFoundError & err) {
247 boost::format(
"Could not read CoaddInputs; setting to null: %s") % err.what()
boost::shared_ptr< detection::Psf > getPsf() const
Return the exposure's point-spread function.
void _finishWriteFits(fits::Fits &fitsfile, FitsWriteData const &data) const
Write any additional non-image HDUs to a FITS file.
boost::shared_ptr< daf::base::PropertyList > imageMetadata
Class for storing ordered metadata with comments.
static boost::shared_ptr< Wcs > _cloneWcs(boost::shared_ptr< Wcs const > wcs)
Implementation of the WCS standard for a any projection.
bool hasCoaddInputs() const
Does this exposure have coadd provenance catalogs?
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
static Log & getDefaultLog()
boost::shared_ptr< cameraGeom::Detector const > getDetector() const
Return the exposure's Detector information.
static boost::shared_ptr< Calib > _cloneCalib(boost::shared_ptr< Calib const > calib)
table::Key< table::Array< Kernel::Pixel > > image
definition of the DualLog class
lsst::daf::base::PropertySet PropertySet
boost::shared_ptr< daf::base::PropertySet > _metadata
ExposureInfo & operator=(ExposureInfo const &other)
Assignment; deep-copies all components except the metadata.
Wcs::Ptr makeWcs(boost::shared_ptr< lsst::daf::base::PropertySet > const &fitsMetadata, bool stripMetadata=false)
Include files required for standard LSST Exception handling.
A struct passed back and forth between Exposure and ExposureInfo when writing FITS files...
boost::shared_ptr< detection::Psf > _psf
boost::shared_ptr< Wcs > getWcs()
Return the coordinate system of the exposure.
void writeFits(fits::Fits &fitsfile) const
Write the archive to an already-open FITS object.
boost::shared_ptr< daf::base::PropertyList > maskMetadata
boost::shared_ptr< Wcs > _wcs
Holds an integer identifier for an LSST filter.
void setHdu(int hdu, bool relative=false)
Set the current HDU.
int stripCalibKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > metadata)
boost::shared_ptr< cameraGeom::Detector const > _detector
Filter getFilter() const
Return the exposure's filter.
bool hasPsf() const
Does this exposure have a Psf?
void setCalib(boost::shared_ptr< Calib const > calib)
Set the Exposure's Calib object.
bool hasWcs() const
Does this exposure have a Wcs?
void _readFits(fits::Fits &fitsfile, boost::shared_ptr< daf::base::PropertySet > metadata, boost::shared_ptr< daf::base::PropertySet > imageMetadata)
Read from a FITS file and metadata.
ExposureInfo(boost::shared_ptr< Wcs const > const &wcs=boost::shared_ptr< Wcs const >(), boost::shared_ptr< detection::Psf const > const &psf=boost::shared_ptr< detection::Psf const >(), boost::shared_ptr< Calib const > const &calib=boost::shared_ptr< Calib const >(), boost::shared_ptr< cameraGeom::Detector const > const &detector=boost::shared_ptr< cameraGeom::Detector const >(), Filter const &filter=Filter(), boost::shared_ptr< daf::base::PropertySet > const &metadata=boost::shared_ptr< daf::base::PropertySet >(), boost::shared_ptr< CoaddInputs > const &coaddInputs=boost::shared_ptr< CoaddInputs >())
Construct an ExposureInfo from its various components.
Class for storing generic metadata.
void warn(const std::string &message, const lsst::daf::base::PropertySet &properties)
table::io::OutputArchive archive
int put(Persistable const *obj, bool permissive=false)
Save an object to the archive and return a unique ID that can be used to retrieve it from an InputArc...
boost::shared_ptr< daf::base::PropertySet > getMetadata() const
Return flexible metadata.
int stripFilterKeywords(boost::shared_ptr< lsst::daf::base::PropertySet > metadata)
boost::shared_ptr< Calib > _calib
boost::shared_ptr< CoaddInputs > getCoaddInputs() const
Return a pair of catalogs that record the inputs, if this Exposure is a coadd (otherwise null)...
boost::shared_ptr< daf::base::PropertyList > metadata
A collection of all the things that make an Exposure different from a MaskedImage.
A polymorphic base class for representing an image's Point Spread Function.
boost::shared_ptr< daf::base::PropertyList > varianceMetadata
boost::shared_ptr< Calib > getCalib()
Return the exposure's photometric calibration.
daf::base::PropertySet & _metadata
bool exists(std::string const &name) const
bool hasDetector() const
Does this exposure have Detector information?
FitsWriteData _startWriteFits(geom::Point2I const &xy0=geom::Point2I()) const
Start the process of writing an exposure to FITS.
boost::shared_ptr< CoaddInputs > _coaddInputs