STFINV library: seek source wavelet correction filter
|
C interface to libstfinv. More...
Files | |
file | stfinv.h |
C API to library (prototypes) | |
Classes | |
struct | CPairs |
Array of waveform pairs.This is used to pass data for a set of synthetic time series, which should be convolved with the new source correction filter on the fly. A collection of time series consists of CPairs::n waveform pairs. For each waveform pair this struct holds a reference to a struct CWaveformPair which itself provides a reference to the users workspace for time series. More... | |
struct | CTripleHeader |
Structure to hold header information for a triple of waveforms.Each triple of waveforms reference by e.g. struct CWaveformTriple are associated to a receiver. The coordinates of the receiver as well as of the associated shot location are stored here. Further temporal sampling is defined by this->sampling. More... | |
struct | CTriples |
Array of waveform triples.This is used to pass data for a complete profile. A profile consists of CTriples::n receivers. For each receiver this struct holds a reference to a struct CWaveformTriple which itself provides a reference to the users workspace for time series. More... | |
struct | CWaveform |
A struct to store a single waveform. More... | |
struct | CWaveformHeader |
Temporal sampling for time series data. More... | |
struct | CWaveformPair |
A struct to store the time series for a pair of waveforms.This struct provides references to the users workspace, where the time series for on receiver are stored. More... | |
struct | CWaveformTriple |
A struct to store the time series for a waveform triple.This struct provides references to the users workspace, where the time series for on receiver are stored. More... | |
Typedefs | |
typedef float | Tvalue |
Value type of samples.All references to time series samples in user workspace are based on this type. More... | |
Functions | |
void | freestfinvengine () |
Free the engine. More... | |
void | initstfinvengine (struct CTriples triples, struct CWaveform stf, char *parameters) |
Initialize the engine. More... | |
void | initstfinvenginewithpairs (struct CTriples triples, struct CWaveform stf, struct CPairs pairs, char *parameters) |
Initialize the engine and pass additional time series to be convolved on the fly. More... | |
void | printengines () |
List procedures (engines) on stdout. More... | |
void | printhelp () |
Print usage summary to stdout. More... | |
void | printusage (char *id) |
Print detailed description for engine "id" to stdout. More... | |
void | runstfinvengine () |
Run the engine. More... | |
C interface to libstfinv.
All data structures and function prototypes are presented in stfinv.h
When using libstfinv from a C program, the first step is to initialize the engine by calling initstfinvengine(). The engine will keep references to the memory locations where time series samples are stored. You can update the content of these locations as you like, e.g. by storing a new set of synthetic seismograms therein. Upon each call to runstfinvengine() a new source wavelet correction filter will be derived and stored at its place in memory. At the same time the synthetic waveforms are convolved with the filter wavelet and stored at the memory location reserved for the convolved synthetics. It is good style to call freestfinvengine() when you have finished. This will remove the engine from memory. This call should at least be issued when the pointers to the memory locations for time series samples as passed to initstfinvengine() become invalid.
All expressions [...] in the code fragments below have to be replaced with proper C expression appropriate for your program.
Consider you like to use this interface in a C program. You have data for nrec
receivers each with nsamp
samples and dt
sampling interval:
Then you have to initialize a reference to your workspace:
You then have to fill the waveform triple structures with appropriate header information and pointers to your data arrays:
Further prepare a reference to your workspace for the source correction filter wavelet:
The you require a parameter string. For example:
Having prepared all these items, you can initialize the stf engine:
After having initialized the engine, you can call the engine repeatedly. Upon each call
the engine will read the time series data from the workspace
and
refer to. It will then calculate a source wavelet correction filter according to the selected strategy and subject to the parameters passed to the engine. The time series referred to by
will be convolved with this source correction filter wavelet and the resulting time series will be written to the workspace
point to. The source correction filter wavelet itself will be written to the workspace referred to by
Do not forget to free memory once you do not longer require the stf engine:
The C API offers a second init function:
The argument pairs
can be used to pass additional time series which will be convolved with the source correction filter wavelet. These time series however are not used in the process of finding the appropriate source wavelet correction filter.
Consider you like to pass npairs
time series with nsamp
samples each and a sampling interval dt
(note: nsamp
and dt
must be identical to those used for the other time series passed to libstfinv). nsamp
and dt
are already set. You have to adjust
Then you have to initialize a reference to your workspace:
You then have to fill the waveform pair structures with appropriate header information and pointers to your data arrays:
Having prepared this and all other items, you can initialize the stf engine:
Additionally to what is dedscribed above, upon each call to
the engine will read the time series from the area addressed by
will convolve this with the newly derived source correction filter wavelet. The resulting time series will be written to the workspace addressed by