27 #include "boost/format.hpp" 30 #include "boost/algorithm/string/trim.hpp" 49 template <
typename ImageT,
typename MaskT,
typename VarianceT>
52 : daf::
base::Citizen(typeid(this)), _maskedImage(width, height), _info(new
ExposureInfo(wcs)) {}
54 template <
typename ImageT,
typename MaskT,
typename VarianceT>
57 : daf::
base::Citizen(typeid(this)), _maskedImage(dimensions), _info(new
ExposureInfo(wcs)) {}
59 template <
typename ImageT,
typename MaskT,
typename VarianceT>
61 : daf::
base::Citizen(typeid(this)), _maskedImage(bbox), _info(new
ExposureInfo(wcs)) {}
63 template <
typename ImageT,
typename MaskT,
typename VarianceT>
66 : daf::
base::Citizen(typeid(this)), _maskedImage(maskedImage), _info(new
ExposureInfo(wcs)) {}
68 template <
typename ImageT,
typename MaskT,
typename VarianceT>
70 : daf::
base::Citizen(typeid(this)),
71 _maskedImage(maskedImage),
74 template <
typename ImageT,
typename MaskT,
typename VarianceT>
76 : daf::
base::Citizen(typeid(this)),
77 _maskedImage(src.getMaskedImage(), deep),
80 template <
typename ImageT,
typename MaskT,
typename VarianceT>
83 template <
typename ImageT,
typename MaskT,
typename VarianceT>
86 : daf::
base::Citizen(typeid(this)),
87 _maskedImage(src.getMaskedImage(), bbox, origin, deep),
90 template <
typename ImageT,
typename MaskT,
typename VarianceT>
93 : daf::
base::Citizen(typeid(this)), _maskedImage(), _info(new
ExposureInfo()) {
94 fits::Fits fitsfile(fileName,
"r", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
95 _readFits(fitsfile, bbox, origin, conformMasks);
98 template <
typename ImageT,
typename MaskT,
typename VarianceT>
101 : daf::
base::Citizen(typeid(this)), _maskedImage(), _info(new
ExposureInfo()) {
102 fits::Fits fitsfile(manager,
"r", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
103 _readFits(fitsfile, bbox, origin, conformMasks);
106 template <
typename ImageT,
typename MaskT,
typename VarianceT>
109 : daf::
base::Citizen(typeid(this)) {
110 _readFits(fitsfile, bbox, origin, conformMasks);
113 template <
typename ImageT,
typename MaskT,
typename VarianceT>
118 _maskedImage =
MaskedImageT(fitsfile, metadata, bbox, origin, conformMasks,
false, imageMetadata);
119 _info->_readFits(fitsfile, metadata, imageMetadata);
122 template <
typename ImageT,
typename MaskT,
typename VarianceT>
127 template <
typename ImageT,
typename MaskT,
typename VarianceT>
129 _maskedImage = maskedImage;
132 template <
typename ImageT,
typename MaskT,
typename VarianceT>
135 if (_info->hasWcs()) {
137 auto newWcs = _info->getWcs()->copyAtShiftedPixelOrigin(shift);
138 _info->setWcs(newWcs);
140 _maskedImage.setXY0(origin);
143 template <
typename ImageT,
typename MaskT,
typename VarianceT>
145 template <
typename ImageT,
typename MaskT,
typename VarianceT>
150 template <
typename ImageT,
typename MaskT,
typename VarianceT>
152 fits::Fits fitsfile(fileName,
"w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
156 template <
typename ImageT,
typename MaskT,
typename VarianceT>
158 fits::Fits fitsfile(manager,
"w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
162 template <
typename ImageT,
typename MaskT,
typename VarianceT>
169 template <
typename ImageT,
typename MaskT,
typename VarianceT>
176 fits::Fits fitsfile(fileName,
"w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
177 writeFits(fitsfile, imageOptions, maskOptions, varianceOptions);
180 template <
typename ImageT,
typename MaskT,
typename VarianceT>
187 fits::Fits fitsfile(manager,
"w", fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
188 writeFits(fitsfile, imageOptions, maskOptions, varianceOptions);
191 template <
typename ImageT,
typename MaskT,
typename VarianceT>
199 _maskedImage.writeFits(fitsfile, imageOptions, maskOptions, varianceOptions, data.
metadata,
201 _info->_finishWriteFits(fitsfile, data);
std::shared_ptr< daf::base::PropertyList > maskMetadata
Extent< double, 2 > Extent2D
Class for storing ordered metadata with comments.
A class to contain the data, WCS, and other information needed to describe an image of the sky...
Options for writing an image to FITS.
std::shared_ptr< daf::base::PropertyList > imageMetadata
A simple struct that combines the two arguments that must be passed to most cfitsio routines and cont...
An integer coordinate rectangle.
std::shared_ptr< daf::base::PropertyList > varianceMetadata
Include files required for standard LSST Exception handling.
afw::table::PointKey< int > dimensions
A struct passed back and forth between Exposure and ExposureInfo when writing FITS files...
A base class for image defects.
Lifetime-management for memory that goes into FITS memory files.
Exposure(unsigned int width, unsigned int height, std::shared_ptr< geom::SkyWcs const > wcs=std::shared_ptr< geom::SkyWcs const >())
Construct an Exposure with a blank MaskedImage of specified size (default 0x0) and a SkyWcs (which ma...
A collection of all the things that make an Exposure different from a MaskedImage.
std::shared_ptr< daf::base::PropertyList > metadata