00001 #ifndef ABSVELRECOBJECTIVE_H_ 00002 #define ABSVELRECOBJECTIVE_H_ 00003 00004 #include "C1DRecObjective.h" 00005 #include "RFVelCalc.h" 00006 #include "SurfaceWaveData.h" 00007 00008 namespace gplib 00009 { 00010 //! This objective function calculates the weighted misfit for a receiver function and the corresponding absolute velocity transformation 00011 class AbsVelRecObjective: public C1DRecObjective 00012 { 00013 private: 00014 //! The object to perform absolute velocity estimation 00015 RFVelCalc CalcAbsVel; 00016 SurfaceWaveData MeasuredAbsVel; 00017 SurfaceWaveData SynthAbsVel; 00018 double absvelweight; 00019 double recweight; 00020 public: 00021 //! return a pointer to a copy of the current object 00022 virtual AbsVelRecObjective *clone() const 00023 { 00024 return new AbsVelRecObjective(*this); 00025 } 00026 //! Set the relative weight for the absolute velocity information 00027 void SetAbsVelWeight(const double w) 00028 { 00029 absvelweight = w; 00030 } 00031 //! Set the relative weight for the pure receiver function 00032 void SetRecWeight(const double w) 00033 { 00034 recweight = w; 00035 } 00036 //! Write out the receiver function and absolute velocity data, the absolute velocity data gets .vel appended 00037 virtual void WriteData(const std::string &filename) 00038 { 00039 if (recweight > 0.0) 00040 C1DRecObjective::WriteData(filename); 00041 if (absvelweight > 0.0) 00042 SynthAbsVel.WriteAscii(filename + ".vel"); 00043 } 00044 virtual double PostParallel(const ttranscribed &member); 00045 AbsVelRecObjective& operator=(const AbsVelRecObjective& source); 00046 AbsVelRecObjective(const AbsVelRecObjective &Old); 00047 virtual ~AbsVelRecObjective(); 00048 //! This constructor is used for calculating absolute velocity information 00049 /*! @param TheRecData Object containing the measured receiver function as from call RFVelCalc 00050 * @param AbsVel Object containing the measured absolute velocity information 00051 * @param myshift the shift used for calculating the measured receiver function 00052 * @param mysigma sigma used for calculating the measured receiver function 00053 * @param myc water level used for calculating the measured receiver function 00054 * @param myslowness slowness used for calculating the measured receiver function 00055 * @param normalized Is the measured data normalized to an initial correlation peak of 1 00056 */ 00057 AbsVelRecObjective(boost::shared_ptr<const SeismicDataComp> TheRecData, 00058 SurfaceWaveData &AbsVel, const int myshift, const double mysigma, 00059 const double myc, const double myslowness, 00060 const RecCalc::trfmethod method = RecCalc::specdiv, 00061 const bool normalized = true); 00062 }; 00063 } 00064 #endif /*ABSVELRECOBJECTIVE_H_*/
1.5.8