39 # define __attribute__(x)
50 #include <boost/archive/text_oarchive.hpp>
51 #include <boost/archive/text_iarchive.hpp>
52 #include <boost/archive/binary_oarchive.hpp>
53 #include <boost/archive/binary_iarchive.hpp>
54 #include <boost/archive/xml_oarchive.hpp>
55 #include <boost/archive/xml_iarchive.hpp>
56 #include <boost/serialization/nvp.hpp>
57 #include <boost/serialization/vector.hpp>
59 #include <boost/serialization/export.hpp>
74 BOOST_CLASS_EXPORT(lsst::afw::math::FixedKernel)
75 BOOST_CLASS_EXPORT(lsst::afw::math::AnalyticKernel)
76 BOOST_CLASS_EXPORT(lsst::afw::math::DeltaFunctionKernel)
77 BOOST_CLASS_EXPORT(lsst::afw::math::LinearCombinationKernel)
78 BOOST_CLASS_EXPORT(lsst::afw::math::SeparableKernel)
80 BOOST_CLASS_EXPORT(lsst::afw::math::Function<
float>)
81 BOOST_CLASS_EXPORT(lsst::afw::math::NullFunction1<
float>)
82 BOOST_CLASS_EXPORT(lsst::afw::math::NullFunction2<
float>)
84 BOOST_CLASS_EXPORT(lsst::afw::math::Function<
double>)
85 BOOST_CLASS_EXPORT(lsst::afw::math::NullFunction1<
double>)
86 BOOST_CLASS_EXPORT(lsst::afw::math::NullFunction2<
double>)
88 BOOST_CLASS_EXPORT(lsst::afw::math::IntegerDeltaFunction2<
float>)
89 BOOST_CLASS_EXPORT(lsst::afw::math::GaussianFunction1<
float>)
90 BOOST_CLASS_EXPORT(lsst::afw::math::GaussianFunction2<
float>)
91 BOOST_CLASS_EXPORT(lsst::afw::math::DoubleGaussianFunction2<
float>)
92 BOOST_CLASS_EXPORT(lsst::afw::math::PolynomialFunction1<
float>)
93 BOOST_CLASS_EXPORT(lsst::afw::math::PolynomialFunction2<
float>)
94 BOOST_CLASS_EXPORT(lsst::afw::math::Chebyshev1Function1<
float>)
95 BOOST_CLASS_EXPORT(lsst::afw::math::Chebyshev1Function2<
float>)
96 BOOST_CLASS_EXPORT(lsst::afw::math::LanczosFunction1<
float>)
97 BOOST_CLASS_EXPORT(lsst::afw::math::LanczosFunction2<
float>)
99 BOOST_CLASS_EXPORT(lsst::afw::math::IntegerDeltaFunction2<
double>)
100 BOOST_CLASS_EXPORT(lsst::afw::math::GaussianFunction1<
double>)
101 BOOST_CLASS_EXPORT(lsst::afw::math::GaussianFunction2<
double>)
102 BOOST_CLASS_EXPORT(lsst::afw::math::DoubleGaussianFunction2<
double>)
103 BOOST_CLASS_EXPORT(lsst::afw::math::PolynomialFunction1<
double>)
104 BOOST_CLASS_EXPORT(lsst::afw::math::PolynomialFunction2<
double>)
105 BOOST_CLASS_EXPORT(lsst::afw::math::Chebyshev1Function1<
double>)
106 BOOST_CLASS_EXPORT(lsst::afw::math::Chebyshev1Function2<
double>)
107 BOOST_CLASS_EXPORT(lsst::afw::math::LanczosFunction1<
double>)
108 BOOST_CLASS_EXPORT(lsst::afw::math::LanczosFunction2<
double>)
110 #define EXEC_TRACE 20
111 static void execTrace(std::string s,
int level =
EXEC_TRACE) {
115 namespace afwMath = lsst::afw::math;
116 namespace afwForm = lsst::afw::formatters;
117 namespace dafBase = lsst::daf::base;
118 namespace dafPersist = lsst::daf::persistence;
119 namespace pexPolicy = lsst::pex::policy;
121 using boost::serialization::make_nvp;
152 dafPersist::Formatter(typeid(this)), _policy(policy) {
164 execTrace(
"KernelFormatter write start");
168 throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError,
"Persisting non-Kernel");
171 execTrace(
"KernelFormatter write BoostStorage");
175 execTrace(
"KernelFormatter write end");
179 execTrace(
"KernelFormatter write XmlStorage");
183 execTrace(
"KernelFormatter write end");
186 throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError,
"Unrecognized Storage for Kernel");
191 execTrace(
"KernelFormatter read start");
194 execTrace(
"KernelFormatter read BoostStorage");
198 execTrace(
"KernelFormatter read end");
202 execTrace(
"KernelFormatter read XmlStorage");
206 execTrace(
"KernelFormatter read end");
209 throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError,
"Unrecognized Storage for Kernel");
215 throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError,
"Unexpected call to update for Kernel");
224 template <
class Archive>
227 execTrace(
"KernelFormatter delegateSerialize start");
231 throw LSST_EXCEPT(lsst::pex::exceptions::RuntimeError,
"Serializing non-Kernel");
233 ar & make_nvp(
"base",
234 boost::serialization::base_object<dafBase::Persistable>(*kp));
235 ar & make_nvp(
"width", kp->
_width);
236 ar & make_nvp(
"height", kp->
_height);
237 ar & make_nvp(
"ctrX", kp->
_ctrX);
238 ar & make_nvp(
"ctrY", kp->
_ctrY);
242 execTrace(
"KernelFormatter delegateSerialize end");
Declare the Kernel class and subclasses.
Class for XML file storage.
Include files required for standard LSST Exception handling.
virtual boost::archive::text_iarchive & getIArchive(void)
boost::shared_ptr< PropertySet > Ptr
boost::shared_ptr< Policy > Ptr
definition of the Trace messaging facilities
A kernel described by a pair of functions: func(x, y) = colFunc(x) * rowFunc(y)
Define a collection of useful Functions.
limited backward compatibility to the DC2 run-time trace facilities
virtual boost::archive::xml_iarchive & getIArchive(void)
Interface for XmlStorage class.
A kernel that is a linear combination of fixed basis kernels.
unsigned int _nKernelParams
#define LSST_EXCEPT(type,...)
virtual boost::archive::text_oarchive & getOArchive(void)
virtual boost::archive::xml_oarchive & getOArchive(void)
boost::shared_ptr< Storage > Ptr
std::vector< SpatialFunctionPtr > _spatialFunctionList
Define the basic Function classes.
Class for boost::serialization storage.
Base class for all persistable classes.
A kernel described by a function.
Interface for LogicalLocation class.
Kernels are used for convolution with MaskedImages and (eventually) Images.
A kernel that has only one non-zero pixel (of value 1)
A kernel created from an Image.
Interface for BoostStorage class.