Commit a4fad596 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

base class

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3911
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent e940b7a6
......@@ -44,52 +44,58 @@
#include <stfinv/waveformheader.h>
/*! A struct to store the time series for a waveform triple.
/*! \brief Value type of samples.
*/
typedef float Tvalue;
/*----------------------------------------------------------------------*/
/*! \brief A struct to store the time series for a waveform triple.
*/
struct WaveformTriple {
/*! The header is expected to be the same for all three time series.
/*! \brief The header is expected to be the same for all three time series.
* In particular the number of samples must be appropriate for the memory
* allocated for all three time series arrays.
*/
struct TripleHeader header;
/*! Time series of recorded data.
/*! \brief Time series of recorded data.
*/
float* data;
/*! Time series of synthetic data.
Tvalue* data;
/*! \brief Time series of synthetic data.
* This is understood as the impulse response of the subsurface.
*/
float* synthetics;
/*! Time series of convolved synthetic data.
Tvalue* synthetics;
/*! \brief Time series of convolved synthetic data.
* This will contain the synthetic data convolved with the obtained source
* time function as a result of a call to the library functions.
*/
float* convolvedsynthetics;
Tvalue* convolvedsynthetics;
}; // struct WaveformTriple
/*----------------------------------------------------------------------*/
/*! A struct to store a single waveform.
/*! \brief A struct to store a single waveform.
* This will be used to pass the source time function.
*/
struct Waveform {
/*! Temporal sampling
/*! \brief Temporal sampling.
*/
struct WaveformHeader sampling;
/*! Time series of waveform.
/*! \brief Time series of waveform.
*/
float* series;
Tvalue* series;
}; // struct Waveform
/*----------------------------------------------------------------------*/
/*! Array of waveform triples.
/*! \brief Array of waveform triples.
* This is used to pass data for a complete profile.
*/
struct Triples {
/*! Number of triples in the array.
/*! \brief Number of triples in the array.
*/
int n;
/*! Pointer to array of waveform tripples.
/*! \brief Pointer to array of waveform tripples.
*/
struct WaveformTriple* triples;
}; // struct Triples
......
......@@ -42,8 +42,88 @@
#define STFINV_STFINVBASE_H_CVSID \
"$Id$"
#include<stfinv/stfinv.h>
#include<aff/series.h>
#include<list>
namespace stfinv {
/*! \brief Type of sample values.
*/
typedef aff::Series<Tvalue> Tseries;
/*----------------------------------------------------------------------*/
/*! \brief A class to store the time series for a waveform triple.
*/
class WaveformTriple {
/*! \brief The header is expected to be the same for all three time series.
* In particular the number of samples must be appropriate for the memory
* allocated for all three time series arrays.
*/
TripleHeader header;
/*! \brief Time series of recorded data.
*/
Tseries data;
/*! \brief Time series of synthetic data.
* This is understood as the impulse response of the subsurface.
*/
Tseries synthetics;
/*! \brief Time series of convolved synthetic data.
* This will contain the synthetic data convolved with the obtained source
* time function as a result of a call to the library functions.
*/
Tseries convolvedsynthetics;
}; // class WaveformTriple
/*----------------------------------------------------------------------*/
/*! \brief A class to store a single waveform.
* This will be used to pass the source time function.
*/
class Waveform {
/*! \brief Temporal sampling
*/
WaveformHeader sampling;
/*! \brief Time series of waveform.
*/
Tseries series;
}; // class Waveform
/*----------------------------------------------------------------------*/
/*! \brief List of triples.
*/
typedef std::list<stfinv::WaveformTriple> Tlistoftriples;
/*----------------------------------------------------------------------*/
/*! \brief Abstract base class for engines to derive source time functions
*/
class STFEngine {
public:
/*! \brief Constructor.
*/
STFEngine(const stfinv::Tlistoftriples& triples,
const stfinv::Waveform& stf,
const std::string& parameters)
:Mtriples(triples), Mstf(stf), Mparameters(parameters)
{
this->checkconsistency();
}
//! \brief Start engine and return source time function.
stfinv::Waveform run();
private:
//! \brief Check consistency of data members.
void checkconsistency() const;
//! \brief Waveform triples.
stfinv::Tlistoftriples Mtriples;
//! \brief Source time function.
stfinv::Waveform Mstf;
//! \brief Control parameters encoded in a string.
std::string Mparameters;
}; // class STFEngine
} // namespace stfinv
#endif // STFINV_STFINVBASE_H_VERSION (includeguard)
......
......@@ -46,37 +46,37 @@
extern "C" {
#endif
/*! Structure to hold header information for a time series array
/*! \brief Structure to hold header information for a time series array
*/
struct WaveformHeader {
/*! Sampling interval in seconds.
/*! \brief Sampling interval in seconds.
*/
double dt;
/*! Number of samples in time series array.
/*! \brief Number of samples in time series array.
*/
int n;
}; // struct WaveformHeader
/*----------------------------------------------------------------------*/
/*! Structure to hold header information for a triple of waveforms
/*! \brief Structure to hold header information for a triple of waveforms
*/
struct TripleHeader {
/*! Source coordinates in meters.
/*! \brief Source coordinates in meters.
*
* - \c sx: x-coordinate
* - \c sy: y-coordinate
* - \c sz: z-coordinate
*/
double sx, sy, sz;
/*! Receiver coordinates in meters.
/*! \brief Receiver coordinates in meters.
*
* - \c rx: x-coordinate
* - \c ry: y-coordinate
* - \c rz: z-coordinate
*/
double rx, ry, rz;
/*! Temporal sampling of all three waveforms.
/*! \brief Temporal sampling of all three waveforms.
*/
struct WaveformHeader sampling;
}; // struct TripleHeader
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment