30 #define __attribute__(x) 38 #include "boost/serialization/shared_ptr.hpp" 39 #include <boost/archive/binary_iarchive.hpp> 40 #include <boost/archive/binary_oarchive.hpp> 41 #include <boost/archive/text_iarchive.hpp> 42 #include <boost/archive/text_oarchive.hpp> 54 LOG_LOGGER _log =
LOG_GET(
"afw.MaskedImageFormatter");
67 namespace formatters {
69 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
101 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
107 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
112 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
115 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
119 LOGL_DEBUG(_log,
"MaskedImageFormatter write start");
128 LOGL_DEBUG(_log,
"MaskedImageFormatter write BoostStorage");
129 boost->getOArchive() & *ip;
130 LOGL_DEBUG(_log,
"MaskedImageFormatter write end");
135 LOGL_DEBUG(_log,
"MaskedImageFormatter write FitsStorage");
138 if (additionalData) {
144 LOGLS_WARN(_log,
"Unable to construct MaskedImage write options (" 145 << exc.
what() <<
"); writing with default options");
148 ip->
writeFits(
fits->getPath(), imageOptions, maskOptions, varianceOptions);
149 LOGL_DEBUG(_log,
"MaskedImageFormatter write end");
155 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
158 LOGL_DEBUG(_log,
"MaskedImageFormatter read start");
162 LOGL_DEBUG(_log,
"MaskedImageFormatter read BoostStorage");
164 boost->getIArchive() & *ip;
165 LOGL_DEBUG(_log,
"MaskedImageFormatter read end");
170 LOGL_DEBUG(_log,
"MaskedImageFormatter read FitsStorage");
172 LOGL_DEBUG(_log,
"MaskedImageFormatter read end");
178 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
184 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
185 template <
class Archive>
188 LOGL_DEBUG(_log,
"MaskedImageFormatter delegateSerialize start");
194 ar & ip->_image & ip->_variance & ip->_mask;
195 LOGL_DEBUG(_log,
"MaskedImageFormatter delegateSerialize end");
198 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
207 #define INSTANTIATE(I, M, V) \ 208 template class MaskedImageFormatter<I, M, V>; \ 209 template void MaskedImageFormatter<I, M, V>::delegateSerialize<boost::archive::text_oarchive>( \ 210 boost::archive::text_oarchive&, unsigned int const, Persistable*); \ 211 template void MaskedImageFormatter<I, M, V>::delegateSerialize<boost::archive::text_iarchive>( \ 212 boost::archive::text_iarchive&, unsigned int const, Persistable*); \ 213 template void MaskedImageFormatter<I, M, V>::delegateSerialize<boost::archive::binary_oarchive>( \ 214 boost::archive::binary_oarchive&, unsigned int const, Persistable*); \ 215 template void MaskedImageFormatter<I, M, V>::delegateSerialize<boost::archive::binary_iarchive>( \ 216 boost::archive::binary_iarchive&, unsigned int const, Persistable*); #define LOGLS_WARN(logger, message)
Options for writing an image to FITS.
#define LOGL_DEBUG(logger, message...)
A base class for image defects.
A class to manipulate images, masks, and variance as a single object.
#define INSTANTIATE(FROMSYS, TOSYS)
T dynamic_pointer_cast(T... args)
std::int32_t MaskPixel
default type for Masks and MaskedImage Masks
void writeFits(std::string const &fileName, std::shared_ptr< daf::base::PropertySet const > metadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > imageMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > maskMetadata=std::shared_ptr< daf::base::PropertySet const >(), std::shared_ptr< daf::base::PropertySet const > varianceMetadata=std::shared_ptr< daf::base::PropertySet const >()) const
Write a MaskedImage to a regular FITS file.
#define LSST_EXCEPT(type,...)
float VariancePixel
default type for MaskedImage variance images