version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
MultiTaperSpecDivDecon.h
1#ifndef __PAVLIS_MULTITAPER_DECON_H__
2#define __PAVLIS_MULTITAPER_DECON_H__
3#include "mspass/algorithms/deconvolution/ComplexArray.h"
4#include "mspass/algorithms/deconvolution/FFTDeconOperator.h"
5#include "mspass/algorithms/deconvolution/ScalarDecon.h"
6#include "mspass/algorithms/deconvolution/ShapingWavelet.h"
7#include "mspass/seismic/CoreTimeSeries.h"
8#include "mspass/utility/Metadata.h"
9#include "mspass/utility/dmatrix.h"
10#include <boost/archive/text_iarchive.hpp>
11#include <boost/archive/text_oarchive.hpp>
12#include <boost/serialization/base_object.hpp>
13#include <boost/serialization/vector.hpp>
14#include <vector>
15namespace mspass::algorithms::deconvolution {
17public:
21 const std::vector<double> &noise,
22 const std::vector<double> &wavelet,
23 const std::vector<double> &data);
27 void changeparameter(const mspass::utility::Metadata &md) {
28 this->read_metadata(md, true);
29 };
37 int loadnoise(const std::vector<double> &noise);
46 int load(const std::vector<double> &w, const std::vector<double> &d,
47 const std::vector<double> &n);
48 void process();
81 mspass::seismic::CoreTimeSeries inverse_wavelet(const double t0parent = 0.0);
89 std::vector<mspass::seismic::CoreTimeSeries>
90 all_inverse_wavelets(const double t0parent = 0.0);
92 std::vector<mspass::seismic::CoreTimeSeries>
93 all_rfestimates(const double t0parent = 0.0);
95 std::vector<mspass::seismic::CoreTimeSeries>
96 all_actual_outputs(const double t0parent = 0.0);
102 int get_taperlen() { return taperlen; };
103 int get_number_tapers() { return nseq; };
104 double get_time_bandwidth_product() { return nw; };
105
106private:
107 std::vector<double> noise;
108 double nw, damp;
109 int nseq; // number of tapers
110 unsigned int taperlen;
112 /* With this algorithm we have to keep frequeny domain
113 * representations of the inverse for each taper. The
114 * xcor version of this alorithm doesn't need that because
115 * the averaging is different. */
116 std::vector<ComplexArray> winv_taper;
117 /* We also cache the actual output fft because the cost is
118 * small compared to need to recompute it when requested.
119 * This is a feature added for the GID method that adds
120 * an inefficiency for straight application */
121 std::vector<ComplexArray> ao_fft;
122 /* This contains the rf estimates from each of the tapers. They
123 are averaged to produce final result, but we keep them for the
124 option of bootstrap errors. */
125 std::vector<ComplexArray> rfestimates;
126 /* Private methods */
127 /* Returns a tapered data in container of ComplexArray objects*/
128 std::vector<ComplexArray> taper_data(const std::vector<double> &signal);
130 int read_metadata(const mspass::utility::Metadata &md, bool refresh);
131 int apply();
132 friend boost::serialization::access;
133 template <class Archive>
134 void serialize(Archive &ar, const unsigned int version) {
135 ar &boost::serialization::base_object<ScalarDecon>(*this);
136 ar &boost::serialization::base_object<FFTDeconOperator>(*this);
137 ar & noise;
138 ar & nw;
139 ar & damp;
140 ar & nseq;
141 ar & taperlen;
142 ar & tapers;
143 ar & winv_taper;
144 ar & ao_fft;
145 ar & rfestimates;
146 }
147};
148} // namespace mspass::algorithms::deconvolution
149#endif
Object to hold components needed in all fft based decon algorithms.
Definition FFTDeconOperator.h:20
Definition MultiTaperSpecDivDecon.h:16
std::vector< mspass::seismic::CoreTimeSeries > all_rfestimates(const double t0parent=0.0)
Definition MultiTaperSpecDivDecon.cc:447
int loadnoise(const std::vector< double > &noise)
Load a section of preevent noise.
Definition MultiTaperSpecDivDecon.cc:127
MultiTaperSpecDivDecon()
Definition MultiTaperSpecDivDecon.h:19
mspass::seismic::CoreTimeSeries actual_output()
Definition MultiTaperSpecDivDecon.cc:349
mspass::seismic::CoreTimeSeries inverse_wavelet()
Return default FIR represesentation of the inverse filter.
Definition MultiTaperSpecDivDecon.cc:423
int load(const std::vector< double > &w, const std::vector< double > &d, const std::vector< double > &n)
load all data components.
Definition MultiTaperSpecDivDecon.cc:147
std::vector< mspass::seismic::CoreTimeSeries > all_inverse_wavelets(const double t0parent=0.0)
Definition MultiTaperSpecDivDecon.cc:431
mspass::utility::Metadata QCMetrics()
Return appropriate quality measures.
Definition MultiTaperSpecDivDecon.cc:485
std::vector< mspass::seismic::CoreTimeSeries > all_actual_outputs(const double t0parent=0.0)
Definition MultiTaperSpecDivDecon.cc:466
Base class decon operator for single station 3C decon (receiver functions).
Definition ScalarDecon.h:29
Scalar time series data object.
Definition CoreTimeSeries.h:17
Definition Metadata.h:71
Lightweight, simple matrix object.
Definition dmatrix.h:104