version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
ScalarDecon.h
1#ifndef __SIMPLE_DECON_H__
2#define __SIMPLE_DECON_H__
3
4#include "mspass/algorithms/deconvolution/BasicDeconOperator.h"
5#include "mspass/algorithms/deconvolution/ShapingWavelet.h"
6#include "mspass/seismic/CoreTimeSeries.h"
7#include "mspass/utility/Metadata.h"
8#include <vector>
9
10#include <boost/archive/text_iarchive.hpp>
11#include <boost/archive/text_oarchive.hpp>
12#include <boost/serialization/vector.hpp>
13
14namespace mspass::algorithms::deconvolution {
30public:
31 ScalarDecon() : shapingwavelet() {};
33 ScalarDecon(const std::vector<double> &d, const std::vector<double> &w);
34 ScalarDecon(const ScalarDecon &parent);
45 int load(const std::vector<double> &wavelet, const std::vector<double> &data);
47 int loaddata(const std::vector<double> &data);
49 int loadwavelet(const std::vector<double> &wavelet);
50 virtual void process() = 0;
51 ~ScalarDecon() {};
52 ScalarDecon &operator=(const ScalarDecon &parent);
53 std::vector<double> getresult() { return result; };
54 /* This method does nothing, but needs to be defined to avoid
55 * gcc compile errors in programs using children of this class.*/
56 void changeparameter(const mspass::utility::Metadata &md);
65 ShapingWavelet get_shaping_wavelet() const { return this->shapingwavelet; };
66 /* \brief Return the ideal output of the deconvolution operator.
67
68 All deconvolution operators have a implicit or explicit ideal output
69 signal. e.g. for a spiking Wiener filter it is a delta function with or
70 without a lag. For a shaping wavelt it is the time domain version of the
71 wavelet. */
72 mspass::seismic::CoreTimeSeries ideal_output() {
73 return this->shapingwavelet.impulse_response();
74 };
82
94
95protected:
96 std::vector<double> data;
97 std::vector<double> wavelet;
98 std::vector<double> result;
99 ShapingWavelet shapingwavelet;
100
101private:
102 friend boost::serialization::access;
103 template <class Archive>
104 void serialize(Archive &ar, const unsigned int version) {
105 ar & data;
106 ar & wavelet;
107 ar & result;
108 ar & shapingwavelet;
109 }
110};
111} // namespace mspass::algorithms::deconvolution
112#endif
Base class decon operator for single station 3C decon (receiver functions).
Definition ScalarDecon.h:29
ShapingWavelet get_shaping_wavelet() const
Definition ScalarDecon.h:65
virtual mspass::seismic::CoreTimeSeries inverse_wavelet()=0
Return a FIR represention of the inverse filter.
virtual mspass::seismic::CoreTimeSeries actual_output()=0
Return the actual output of the deconvolution operator.
int load(const std::vector< double > &wavelet, const std::vector< double > &data)
Load all data required for decon.
Definition ScalarDecon.cc:33
void change_shaping_wavelet(const ShapingWavelet &nsw)
Definition ScalarDecon.cc:56
int loadwavelet(const std::vector< double > &wavelet)
Definition ScalarDecon.cc:48
int loaddata(const std::vector< double > &data)
Definition ScalarDecon.cc:43
virtual mspass::utility::Metadata QCMetrics()=0
Return appropriate quality measures.
Frequency domain shaping wavelet.
Definition ShapingWavelet.h:21
mspass::seismic::CoreTimeSeries impulse_response()
Definition ShapingWavelet.cc:265
Scalar time series data object.
Definition CoreTimeSeries.h:17
Definition Metadata.h:71