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> 56 LOG_LOGGER _log =
LOG_GET(
"afw.ExposureFormatter");
61 namespace formatters {
66 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
98 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
104 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
109 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
113 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
117 LOGL_DEBUG(_log,
"ExposureFormatter write start");
126 LOGL_DEBUG(_log,
"ExposureFormatter write BoostStorage");
127 boost->getOArchive() & *ip;
128 LOGL_DEBUG(_log,
"ExposureFormatter write end");
133 LOGL_DEBUG(_log,
"ExposureFormatter write FitsStorage");
136 if (additionalData) {
142 LOGLS_WARN(_log,
"Unable to construct Exposure write options (" << exc.
what() <<
143 "); writing with default options");
147 ip->
writeFits(fits->getPath(), imageOptions, maskOptions, varianceOptions);
148 LOGL_DEBUG(_log,
"ExposureFormatter write end");
154 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
158 LOGL_DEBUG(_log,
"ExposureFormatter read start");
162 LOGL_DEBUG(_log,
"ExposureFormatter read BoostStorage");
165 boost->getIArchive() & *ip;
166 LOGL_DEBUG(_log,
"ExposureFormatter read end");
171 LOGL_DEBUG(_log,
"ExposureFormatter read FitsStorage");
173 if (additionalData->exists(
"llcX")) {
174 int llcX = additionalData->
get<
int>(
"llcX");
175 int llcY = additionalData->
get<
int>(
"llcY");
176 int width = additionalData->
get<
int>(
"width");
177 int height = additionalData->
get<
int>(
"height");
181 if (additionalData->exists(
"imageOrigin")) {
183 if (originStr ==
"LOCAL") {
185 }
else if (originStr ==
"PARENT") {
189 (boost::format(
"Unknown ImageOrigin type %s specified in additional" 190 "data for retrieving Exposure from fits") %
198 LOGL_DEBUG(_log,
"ExposureFormatter read end");
204 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
213 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
214 template <
class Archive>
217 LOGL_DEBUG(_log,
"ExposureFormatter delegateSerialize start");
225 LOGL_DEBUG(_log,
"ExposureFormatter delegateSerialize end");
228 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
237 #define INSTANTIATE(I, M, V) \ 238 template class ExposureFormatter<I, M, V>; \ 239 template void ExposureFormatter<I, M, V>::delegateSerialize<boost::archive::text_oarchive>( \ 240 boost::archive::text_oarchive&, unsigned int const, dafBase::Persistable*); \ 241 template void ExposureFormatter<I, M, V>::delegateSerialize<boost::archive::text_iarchive>( \ 242 boost::archive::text_iarchive&, unsigned int const, dafBase::Persistable*); \ 243 template void ExposureFormatter<I, M, V>::delegateSerialize<boost::archive::binary_oarchive>( \ 244 boost::archive::binary_oarchive&, unsigned int const, dafBase::Persistable*); \ 245 template void ExposureFormatter<I, M, V>::delegateSerialize<boost::archive::binary_iarchive>( \ 246 boost::archive::binary_iarchive&, unsigned int const, dafBase::Persistable*); #define LOGLS_WARN(logger, message)
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.
#define LOGL_DEBUG(logger, message...)
An integer coordinate rectangle.
A base class for image defects.
std::shared_ptr< lsst::daf::base::PropertySet > getMetadata() const
Return flexible metadata.
#define INSTANTIATE(FROMSYS, TOSYS)
T dynamic_pointer_cast(T... args)
#define LSST_EXCEPT(type,...)
std::shared_ptr< geom::SkyWcs const > getWcs() const
void writeFits(std::string const &fileName) const
Write an Exposure to a regular multi-extension FITS file.
float VariancePixel
default type for MaskedImage variance images