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
00010
00011
00012
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