SeisTools.h

Go to the documentation of this file.
00001 #ifndef SEISTOOLS_H_
00002 #define SEISTOOLS_H_
00003 
00004 #include <algorithm>
00005 #include <cassert>
00006 #include <boost/bind.hpp>
00007 #include <vector>
00008 #include <gsl/gsl_math.h>
00009 /** \addtogroup seistools Seismic data analysis and modeling */
00010 /* @{ */
00011 
00012 //! Calculate density from a given S-velocity, the formula is taken from Owen et al. JGR 89,7783-7795 and modified for vs
00013 struct CalcDensity{
00014         double operator()(const double svel)
00015         {
00016                 return (0.77 + 0.554 * svel);
00017         }
00018 };
00019 
00020 inline void Normalize(std::vector<double> &Trace)
00021 {
00022         const double maxamp = 1./ *max_element(Trace.begin(),Trace.end());
00023         assert(gsl_finite(maxamp));
00024         std::transform(Trace.begin(),Trace.end(),Trace.begin(),boost::bind(std::multiplies<double>(),_1,maxamp));
00025 }
00026 /* @} */
00027 #endif /*SEISTOOLS_H_*/

Generated on Fri Jul 4 15:30:21 2008 for GPLIB++ by  doxygen 1.5.5