SLBM
3.0
Regional Seismic Travel Time
|
A Uncertainty object contains the raw data to calculate a modeling error in seconds as a function of distance in radians. More...
#include <Uncertainty.h>
Public Member Functions | |
Uncertainty () | |
Default constructor. More... | |
Uncertainty (const int &phase, const int &attribute) | |
Parameterized constructor that loads model error from a specified file. More... | |
Uncertainty (const string &phase, const string &attribute) | |
Parameterized constructor that loads model error from a specified file. More... | |
Uncertainty (string modelPath, const string &phase, int phasenum) | |
Uncertainty (string modelPath, const int &phase, const int &attribute) | |
Parameterized constructor that loads model error from a specified file. More... | |
Uncertainty (util::DataBuffer &buffer) | |
Parameterized constructor that loads uncertainty data from the input DataBuffer. More... | |
Uncertainty (const Uncertainty &u) | |
Copy constructor. More... | |
~Uncertainty () | |
Destructor. More... | |
Uncertainty & | operator= (const Uncertainty &u) |
Assignment operator. More... | |
bool | operator== (const Uncertainty &other) |
bool | operator!= (const Uncertainty &other) |
void | readFile (ifstream &fin) |
void | readFile (geotess::IFStreamAscii &fin) |
void | readFile (geotess::IFStreamBinary &fin) |
void | writeFile (geotess::IFStreamBinary &fout) |
int | getPhase () |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory. More... | |
string | getPhaseStr () |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory. More... | |
int | getAttribute () |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory. More... | |
string | getAttributeStr () |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory. More... | |
double | getUncertainty (const double &distance, double depth=0.0) |
Returns the model uncertainty as a function of angular distance (radians) and depth. More... | |
double | getVariance (const double &distance, double depth=0.0) |
Returns the model variance as a function of angular distance (radians) and depth. More... | |
vector< double > & | getDistances () |
A vector of doubles representing the angular distances (in degrees) More... | |
vector< double > & | getDepths () |
A vector of doubles representing the depths. More... | |
vector< vector< double > > & | getValues () |
A vector of doubles representing the model errors (in seconds) More... | |
void | writeFile (const string &directoryName) |
string | toStringTable () |
string | toStringFile () |
int | getBufferSize () |
Returns the model uncertainty DataBuffer size storage requirement. More... | |
void | serialize (util::DataBuffer &buffer) |
Writes the uncertainty object into the input DataBuffer. More... | |
void | deserialize (util::DataBuffer &buffer) |
Reads the uncertainty object from the input DataBuffer. More... | |
Static Public Member Functions | |
static Uncertainty * | getUncertainty (ifstream &input, const int &phase, const int &attribute) |
static Uncertainty * | getUncertainty (ifstream &input, const string &phase, const string &attribute) |
static Uncertainty * | getUncertainty (geotess::IFStreamAscii &input, const int &phase, const int &attribute) |
static Uncertainty * | getUncertainty (geotess::IFStreamAscii &input, const string &phase, const string &attribute) |
static Uncertainty * | getUncertainty (geotess::IFStreamBinary &input, const int &phase, const int &attribute) |
static Uncertainty * | getUncertainty (geotess::IFStreamBinary &input, const string &phase, const string &attribute) |
static Uncertainty * | getUncertainty (util::DataBuffer &input, const int &phase, const int &attribute) |
static Uncertainty * | getUncertainty (util::DataBuffer &input, const string &phase, const string &attribute) |
static Uncertainty * | getUncertainty (const string &directoryName, const int &phase, const int &attribute) |
static string | getPhase (const int &phaseIndex) |
static string | getAttribute (const int &attributeIndex) |
static int | getPhase (const string &phase) |
static int | getAttribute (const string &attribute) |
Private Member Functions | |
double | getUncertainty (double f, int idist, int idepth) |
Returns the distance interpolated uncertainty at depth, idepth, and fraction f between distance indices idist and idist+1. More... | |
double | getVariance (double f, int idist, int idepth) |
Returns the distance interpolated variance at depth, idepth, and fraction f between distance indices idist and idist+1. More... | |
void | getIndex (double x, const vector< double > &v, int &index, double &w) |
Private function used to find the bracketing index for performing uncertainty / variance distance interpolation. More... | |
void | readFile (const string &filename) |
A function called by the constructor to read model error data from an ASCII text file. More... | |
Private Attributes | |
string | fname |
The path and filename for the currently loaded seismic phase modeling error file. More... | |
int | phaseNum |
The seismic phase for which modeling error data was loaded. More... | |
int | attributeNum |
The attribute (TT, Sh or Az) for which modeling error data was loaded. More... | |
vector< double > | errDistances |
A vector of doubles representing the angular distances (in degrees) More... | |
vector< double > | errDepths |
A vector of doubles representing the depths. More... | |
vector< vector< double > > | errVal |
A vector of doubles representing the model errors (in seconds) More... | |
A Uncertainty object contains the raw data to calculate a modeling error in seconds as a function of distance in radians.
Code includes functionality to store and compute uncertainty for 2D uncertainty tables (distance and depth). But all the tables included with SLBM versions up to and including version 3.0 do not have any depth information. All uncertainties are a function of distance only. Therefore, functionality to handle 2D uncertainty has not been tested and it is considered unlikely that it will work as currently coded.
slbm::Uncertainty::Uncertainty | ( | ) |
Default constructor.
slbm::Uncertainty::Uncertainty | ( | const int & | phase, |
const int & | attribute | ||
) |
Parameterized constructor that loads model error data from a file. Uses an SLBM specific phase ordering index.
slbm::Uncertainty::Uncertainty | ( | const string & | phase, |
const string & | attribute | ||
) |
Parameterized constructor that loads model error data from a file. Uses an SLBM specific phase ordering index.
slbm::Uncertainty::Uncertainty | ( | string | modelPath, |
const string & | phase, | ||
int | phasenum | ||
) |
from a specified file.
Parameterized constructor that loads model error data from a file. Uses the input phase string to find the uncertainty data file and assigns a phase ordering index.
slbm::Uncertainty::Uncertainty | ( | string | modelPath, |
const int & | phase, | ||
const int & | attribute | ||
) |
Parameterized constructor that loads model error data from a file. Uses an SLBM specific phase ordering index.
slbm::Uncertainty::Uncertainty | ( | util::DataBuffer & | buffer | ) |
Parameterized constructor that loads model error data from a file.
slbm::Uncertainty::Uncertainty | ( | const Uncertainty & | u | ) |
Copy constructor.
slbm::Uncertainty::~Uncertainty | ( | ) |
Destructor.
void slbm::Uncertainty::deserialize | ( | util::DataBuffer & | buffer | ) |
Reads the uncertainty object from the input DataBuffer.
|
inline |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.
|
inlinestatic |
|
inlinestatic |
|
inline |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.
int slbm::Uncertainty::getBufferSize | ( | ) |
Returns the model uncertainty DataBuffer size storage requirement.
|
inline |
A vector of doubles representing the depths
|
inline |
A vector of doubles representing the angular distances (in degrees)
|
private |
Private function used to find the bracketing index for performing uncertainty / variance distance interpolation. The bracketing index is found in vector v such that v[index] <= x <= v[index+1]. The weight w is calculated as w = (x - v[index]) / (v[index+1] - v[index]);
|
inline |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.
|
inlinestatic |
|
inlinestatic |
|
inline |
A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
input | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
|
static |
Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.
directoryName | data source |
phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg |
attribute | 0:TT, 1:SH, 2:AZ |
double slbm::Uncertainty::getUncertainty | ( | const double & | distance, |
double | depth = 0.0 |
||
) |
Returns the model uncertainty as a function of angular distance (radians) and depth. Depth defaults to the surface (0.0).
|
inlineprivate |
Retrieve reference count; Add reference count; Remove reference count.
A vector of doubles representing the model errors (in seconds)
double slbm::Uncertainty::getVariance | ( | const double & | distance, |
double | depth = 0.0 |
||
) |
Returns the model variance as a function of angular distance (radians) and depth. Depth defaults to the surface (0.0).
|
inlineprivate |
Returns the distance interpolated variance at depth, idepth, and fraction f between distance indices idist and idist+1. For f = 0 errVal[idepth][idist]^2 is returned. For f = 1 errVal[idepth][idist+1]^2 is returned
|
inline |
Overloaded inequality operator
other | reference to the other Uncertainty object to which this Uncertainty object is to be compared |
Uncertainty& slbm::Uncertainty::operator= | ( | const Uncertainty & | u | ) |
Assignment operator.
bool slbm::Uncertainty::operator== | ( | const Uncertainty & | other | ) |
Overloaded equality operator
other | reference to the other Uncertainty object to which this Uncertainty object is to be compared |
void slbm::Uncertainty::readFile | ( | ifstream & | fin | ) |
void slbm::Uncertainty::readFile | ( | geotess::IFStreamAscii & | fin | ) |
void slbm::Uncertainty::readFile | ( | geotess::IFStreamBinary & | fin | ) |
|
private |
A function called by the constructor to read model error data from an ASCII text file.
void slbm::Uncertainty::serialize | ( | util::DataBuffer & | buffer | ) |
Writes the uncertainty object into the input DataBuffer.
string slbm::Uncertainty::toStringFile | ( | ) |
string slbm::Uncertainty::toStringTable | ( | ) |
void slbm::Uncertainty::writeFile | ( | geotess::IFStreamBinary & | fout | ) |
void slbm::Uncertainty::writeFile | ( | const string & | directoryName | ) |
|
private |
The attribute (TT, Sh or Az) for which modeling error data was loaded.
|
private |
A vector of doubles representing the depths
|
private |
A vector of doubles representing the angular distances (in degrees)
A vector of doubles representing the model errors (in seconds)
|
private |
The path and filename for the currently loaded seismic phase modeling error file.
|
private |
The seismic phase for which modeling error data was loaded.