GPLIB++
|
The class SeismicModel is the base class for some of the model format for seismic codes. More...
#include <SeismicModel.h>
Public Types | |
enum | tArrivalType { DirectS, DirectP } |
Do we want to calculate the arrival of a direct S-Wave or a P-wave. More... | |
Public Member Functions | |
unsigned int | GetNpts () const |
Get the number of points for synthetic seismogram calculation. More... | |
void | SetNpts (const unsigned int s) |
Set the number of points for synthetic seismogram calculation. More... | |
double | GetSourceDepth () const |
Get the depth to the seismic source that generates the wavefield. More... | |
void | SetSourceDepth (const double s) |
Set the depth to the seismic source. More... | |
double | GetDt () const |
Get the time between two samples in s, this is for synthetic forward calculations. More... | |
void | SetDt (const double s) |
Set the time between two samples in s, this is for synthetic forward calculations. More... | |
const trealdata & | GetPVelocity () const |
Read-only access to the vector of P-velocities in km/s in each layer. More... | |
trealdata & | SetPVelocity () |
Read-write access to the vector of P-velocities in km/s in each layer. More... | |
const trealdata & | GetSVelocity () const |
Read-only access to the vector of S-velocities in km/s in each layer. More... | |
trealdata & | SetSVelocity () |
Read-write access to the vector of S-velocities in km/s in each layer. More... | |
const trealdata & | GetDensity () const |
Read-only access to the vector of densities in g/cm^3 in each layer. More... | |
trealdata & | SetDensity () |
Read-write access to the vector of densities in g/cm^3 in each layer. More... | |
const trealdata & | GetThickness () const |
Read-only access to the vector of thicknesses in km in each layer. More... | |
trealdata & | SetThickness () |
Read-write access to the vector of thicknesses in km in each layer. More... | |
const trealdata & | GetQp () const |
Read-only access to the vector of P quality factors for each layer. More... | |
trealdata & | SetQp () |
Read-write access to the vector of P quality factors for each layer. More... | |
const trealdata & | GetQs () const |
Read-only access to the vector of S quality factors for each layer. More... | |
trealdata & | SetQs () |
Read-write access to the vector of S quality factors for each layer. More... | |
void | SetSVelErrors (const trealdata &sve) |
Set error bars on S-velocities for plotting. More... | |
void | SetThickErrors (const trealdata &te) |
Set error bars on Thicknesses for plotting. More... | |
int | FindLayer (const double depth) |
Returns the index of the layer that correponds to depth in km. More... | |
double | MatchSlowness (const double slowness, const tArrivalType mode) |
Given a slowness in s/km and a wave type calculate the distance that matches this slowness. More... | |
double | CalcArrival (const tArrivalType mode, const double recdist) |
double | CalcTravelTime (const tArrivalType mode, const double sdepth, const double rdepth, const double p) |
virtual void | ReadModel (const std::string filename)=0 |
Read the model in its native format from a file. More... | |
virtual void | WriteModel (const std::string filename)=0 |
Write the model in its native format to a file. More... | |
virtual void | WriteRunFile (const std::string &filename)=0 |
Write out a script that performs a forward calculation for the current model. More... | |
void | WritePlot (const std::string &filename) |
Write out an ascii file for plotting with xmgrace etc. More... | |
void | PlotVelWithErrors (const std::string &filename) |
Write out an ascii file with error bars for plotting with xmgrace etc. More... | |
void | Init (const int nlayers) |
Init provides a convenient way to allocate memory in all structures for a given number of layers. More... | |
SeismicModel (const int nlayers=0) | |
SeismicModel (const SeismicModel &source) | |
SeismicModel & | operator= (const SeismicModel &source) |
virtual | ~SeismicModel () |
The class SeismicModel is the base class for some of the model format for seismic codes.
We store the basic seismic parameters here and implement some of the common functionailty.
Definition at line 17 of file SeismicModel.h.
Do we want to calculate the arrival of a direct S-Wave or a P-wave.
Enumerator | |
---|---|
DirectS | |
DirectP |
Definition at line 21 of file SeismicModel.h.
gplib::SeismicModel::SeismicModel | ( | const int | nlayers = 0 | ) |
Definition at line 13 of file SeismicModel.cpp.
References Init().
gplib::SeismicModel::SeismicModel | ( | const SeismicModel & | source | ) |
Definition at line 23 of file SeismicModel.cpp.
|
virtual |
Definition at line 19 of file SeismicModel.cpp.
double gplib::SeismicModel::CalcArrival | ( | const tArrivalType | mode, |
const double | recdist | ||
) |
Definition at line 157 of file SeismicModel.cpp.
References CalcTravelTime(), DirectS, and MatchSlowness().
double gplib::SeismicModel::CalcTravelTime | ( | const tArrivalType | mode, |
const double | sdepth, | ||
const double | rdepth, | ||
const double | p | ||
) |
Definition at line 130 of file SeismicModel.cpp.
References DirectS, FindLayer(), and MatchSlowness().
Referenced by CalcArrival().
int gplib::SeismicModel::FindLayer | ( | const double | depth | ) |
Returns the index of the layer that correponds to depth in km.
Definition at line 89 of file SeismicModel.cpp.
Referenced by CalcTravelTime(), MatchSlowness(), and gplib::FkModel::WriteModel().
|
inline |
Read-only access to the vector of densities in g/cm^3 in each layer.
Definition at line 91 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().
|
inline |
Get the time between two samples in s, this is for synthetic forward calculations.
Definition at line 61 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteRunFile().
|
inline |
Get the number of points for synthetic seismogram calculation.
Definition at line 41 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteRunFile().
|
inline |
Read-only access to the vector of P-velocities in km/s in each layer.
Definition at line 71 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().
|
inline |
Read-only access to the vector of P quality factors for each layer.
Definition at line 111 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().
|
inline |
Read-only access to the vector of S quality factors for each layer.
Definition at line 121 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().
|
inline |
Get the depth to the seismic source that generates the wavefield.
Definition at line 51 of file SeismicModel.h.
Referenced by gplib::FkModel::WriteModel().
|
inline |
Read-only access to the vector of S-velocities in km/s in each layer.
Definition at line 81 of file SeismicModel.h.
Referenced by main(), gplib::SeismicModelDiff::SafeParallel(), gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().
|
inline |
Read-only access to the vector of thicknesses in km in each layer.
Definition at line 101 of file SeismicModel.h.
Referenced by main(), gplib::SeismicModelDiff::SafeParallel(), gplib::FkModel::WriteModel(), and gplib::ResPkModel::WriteModel().
void gplib::SeismicModel::Init | ( | const int | nlayers | ) |
Init provides a convenient way to allocate memory in all structures for a given number of layers.
Definition at line 71 of file SeismicModel.cpp.
Referenced by main(), gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), gplib::ResPkModel::ReadModel(), and SeismicModel().
double gplib::SeismicModel::MatchSlowness | ( | const double | slowness, |
const tArrivalType | mode | ||
) |
Given a slowness in s/km and a wave type calculate the distance that matches this slowness.
Definition at line 108 of file SeismicModel.cpp.
References DirectS, and FindLayer().
Referenced by CalcArrival(), and CalcTravelTime().
SeismicModel & gplib::SeismicModel::operator= | ( | const SeismicModel & | source | ) |
Definition at line 42 of file SeismicModel.cpp.
Referenced by gplib::ResPkModel::operator=(), and gplib::ResPkModel::ResPkModel().
void gplib::SeismicModel::PlotVelWithErrors | ( | const std::string & | filename | ) |
Write out an ascii file with error bars for plotting with xmgrace etc.
Definition at line 186 of file SeismicModel.cpp.
References size.
|
pure virtual |
Read the model in its native format from a file.
Implemented in gplib::ResPkModel, and gplib::FkModel.
|
inline |
Read-write access to the vector of densities in g/cm^3 in each layer.
Definition at line 96 of file SeismicModel.h.
Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().
|
inline |
Set the time between two samples in s, this is for synthetic forward calculations.
Definition at line 66 of file SeismicModel.h.
Referenced by gplib::C1DRecObjective::PreParallel(), and gplib::FkModel::ReadModel().
|
inline |
Set the number of points for synthetic seismogram calculation.
Definition at line 46 of file SeismicModel.h.
Referenced by gplib::C1DRecObjective::PreParallel(), and gplib::FkModel::ReadModel().
|
inline |
Read-write access to the vector of P-velocities in km/s in each layer.
Definition at line 76 of file SeismicModel.h.
Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().
|
inline |
Read-write access to the vector of P quality factors for each layer.
Definition at line 116 of file SeismicModel.h.
Referenced by gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().
|
inline |
Read-write access to the vector of S quality factors for each layer.
Definition at line 126 of file SeismicModel.h.
Referenced by gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().
|
inline |
Set the depth to the seismic source.
Definition at line 56 of file SeismicModel.h.
Referenced by gplib::FkModel::ReadModel().
|
inline |
Set error bars on S-velocities for plotting.
Definition at line 131 of file SeismicModel.h.
|
inline |
Read-write access to the vector of S-velocities in km/s in each layer.
Definition at line 86 of file SeismicModel.h.
Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().
|
inline |
Set error bars on Thicknesses for plotting.
Definition at line 136 of file SeismicModel.h.
|
inline |
Read-write access to the vector of thicknesses in km in each layer.
Definition at line 106 of file SeismicModel.h.
Referenced by gplib::C1DRecObjective::PreParallel(), gplib::FkModel::ReadModel(), and gplib::ResPkModel::ReadModel().
|
pure virtual |
Write the model in its native format to a file.
Implemented in gplib::ResPkModel, and gplib::FkModel.
void gplib::SeismicModel::WritePlot | ( | const std::string & | filename | ) |
Write out an ascii file for plotting with xmgrace etc.
Definition at line 208 of file SeismicModel.cpp.
References size.
Referenced by main(), and gplib::C1DRecObjective::WritePlot().
|
pure virtual |
Write out a script that performs a forward calculation for the current model.
Implemented in gplib::ResPkModel.