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>
112 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
116 LOGL_DEBUG(_log,
"ExposureFormatter write start");
125 LOGL_DEBUG(_log,
"ExposureFormatter write BoostStorage");
126 boost->getOArchive() & *ip;
127 LOGL_DEBUG(_log,
"ExposureFormatter write end");
132 LOGL_DEBUG(_log,
"ExposureFormatter write FitsStorage");
135 if (additionalData) {
141 LOGLS_WARN(_log,
"Unable to construct Exposure write options (" 142 << exc.
what() <<
"); writing with default options");
146 ip->
writeFits(
fits->getPath(), imageOptions, maskOptions, varianceOptions);
147 LOGL_DEBUG(_log,
"ExposureFormatter write end");
153 template <
typename ImagePixelT,
typename MaskPixelT,
typename VariancePixelT>
157 LOGL_DEBUG(_log,
"ExposureFormatter read start");
161 LOGL_DEBUG(_log,
"ExposureFormatter read BoostStorage");
164 boost->getIArchive() & *ip;
165 LOGL_DEBUG(_log,
"ExposureFormatter read end");
170 LOGL_DEBUG(_log,
"ExposureFormatter read FitsStorage");
172 if (additionalData->exists(
"llcX")) {
173 int llcX = additionalData->
get<
int>(
"llcX");
174 int llcY = additionalData->
get<
int>(
"llcY");
175 int width = additionalData->
get<
int>(
"width");
176 int height = additionalData->
get<
int>(
"height");
180 if (additionalData->exists(
"imageOrigin")) {
182 if (originStr ==
"LOCAL") {
184 }
else if (originStr ==
"PARENT") {
188 (boost::format(
"Unknown ImageOrigin type %s specified in additional" 189 "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...)
table::Key< table::Array< std::uint8_t > > wcs
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