RSTT: slbm::Uncertainty Class Reference

RSTT 3.1.0 Regional Seismic Travel Time

Public Member Functions | Static Public Member Functions | List of all members
slbm::Uncertainty Class Reference

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 | writeFile (geotess::IFStreamAscii &output)
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)

## Detailed Description

A Uncertainty object contains the raw data to calculate a modeling error in seconds as a function of distance in radians.

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.

Definition at line 72 of file Uncertainty.h.

## Constructor & Destructor Documentation

## ◆ Uncertainty() [1/7]

slbm::Uncertainty::Uncertainty | ( |  | ) |

Default constructor.

Default constructor.

## ◆ Uncertainty() [2/7]

slbm::Uncertainty::Uncertainty | ( | const int & | phase,
|  | const int & | attribute
| ) |  |

Parameterized constructor that loads model error from a specified file.

Parameterized constructor that loads model error data from a file. Uses an SLBM specific phase ordering index.

## ◆ Uncertainty() [3/7]

slbm::Uncertainty::Uncertainty | ( | const string & | phase,
|  | const string & | attribute
| ) |  |

Parameterized constructor that loads model error from a specified file.

Parameterized constructor that loads model error data from a file. Uses an SLBM specific phase ordering index.

## ◆ Uncertainty() [4/7]

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.

## ◆ Uncertainty() [5/7]

slbm::Uncertainty::Uncertainty | ( | string | modelPath,
|  | const int & | phase,
|  | const int & | attribute
| ) |  |

Parameterized constructor that loads model error from a specified file.

Parameterized constructor that loads model error data from a file. Uses an SLBM specific phase ordering index.

## ◆ Uncertainty() [6/7]

slbm::Uncertainty::Uncertainty | ( | util::DataBuffer & | buffer | ) |

Parameterized constructor that loads uncertainty data from the input DataBuffer.

Parameterized constructor that loads model error data from a file.

## ◆ Uncertainty() [7/7]

slbm::Uncertainty::Uncertainty | ( | const Uncertainty & | u | ) |

Copy constructor.

Copy constructor.

## ◆ ~Uncertainty()

slbm::Uncertainty::~Uncertainty | ( |  | ) |

Destructor.

Destructor.

## Member Function Documentation

## ◆ deserialize()

void slbm::Uncertainty::deserialize | ( | util::DataBuffer & | buffer | ) |

Reads the uncertainty object from the input DataBuffer.

Reads the uncertainty object from the input DataBuffer.

## ◆ getAttribute() [1/3]

int slbm::Uncertainty::getAttribute | ( |  | ) |
| inline

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

Definition at line 504 of file Uncertainty.h.

## ◆ getAttribute() [2/3]

static string slbm::Uncertainty::getAttribute | ( | const int & | attributeIndex | ) |
| inlinestatic

Definition at line 344 of file Uncertainty.h.

## ◆ getAttribute() [3/3]

static int slbm::Uncertainty::getAttribute | ( | const string & | attribute | ) |
| inlinestatic

Definition at line 368 of file Uncertainty.h.

## ◆ getAttributeStr()

string slbm::Uncertainty::getAttributeStr | ( |  | ) |
| inline

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

Definition at line 514 of file Uncertainty.h.

## ◆ getBufferSize()

int slbm::Uncertainty::getBufferSize | ( |  | ) |

Returns the model uncertainty DataBuffer size storage requirement.

Returns the model uncertainty DataBuffer size storage requirement.

## ◆ getDepths()

vector<double>& slbm::Uncertainty::getDepths | ( |  | ) |
| inline

A vector of doubles representing the depths.

A vector of doubles representing the depths

Definition at line 312 of file Uncertainty.h.

## ◆ getDistances()

vector<double>& slbm::Uncertainty::getDistances | ( |  | ) |
| inline

A vector of doubles representing the angular distances (in degrees)

A vector of doubles representing the angular distances (in degrees)

Definition at line 305 of file Uncertainty.h.

## ◆ getPhase() [1/3]

int slbm::Uncertainty::getPhase | ( |  | ) |
| inline

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

Definition at line 499 of file Uncertainty.h.

## ◆ getPhase() [2/3]

static string slbm::Uncertainty::getPhase | ( | const int & | phaseIndex | ) |
| inlinestatic

Definition at line 327 of file Uncertainty.h.

## ◆ getPhase() [3/3]

static int slbm::Uncertainty::getPhase | ( | const string & | phase | ) |
| inlinestatic

Definition at line 359 of file Uncertainty.h.

## ◆ getPhaseStr()

string slbm::Uncertainty::getPhaseStr | ( |  | ) |
| inline

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

A public convenience accessor used to verify the error data for the correct model phase is loaded in memory.

Definition at line 509 of file Uncertainty.h.

## ◆ getUncertainty() [1/10]

double slbm::Uncertainty::getUncertainty | ( | const double & | distance,
|  | double | depth = `0.0`
| ) |  |

Returns the model uncertainty as a function of angular distance (radians) and depth.

Returns the model uncertainty as a function of angular distance (radians) and depth. Depth defaults to the surface (0.0).

## ◆ getUncertainty() [2/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | const string & | directoryName,
|  | const int & | phase,
|  | const int & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  directoryName | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [3/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | geotess::IFStreamAscii & | input,
|  | const int & | phase,
|  | const int & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [4/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | geotess::IFStreamAscii & | input,
|  | const string & | phase,
|  | const string & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [5/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | geotess::IFStreamBinary & | input,
|  | const int & | phase,
|  | const int & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [6/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | geotess::IFStreamBinary & | input,
|  | const string & | phase,
|  | const string & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [7/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | ifstream & | input,
|  | const int & | phase,
|  | const int & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [8/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | ifstream & | input,
|  | const string & | phase,
|  | const string & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [9/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | util::DataBuffer & | input,
|  | const int & | phase,
|  | const int & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getUncertainty() [10/10]

static Uncertainty* slbm::Uncertainty::getUncertainty | ( | util::DataBuffer & | input,
|  | const string & | phase,
|  | const string & | attribute
| ) |  |
| static

Retrieve a new Uncertainty object for the specified phase and attribute, loaded from specified input source.

Parameters

  input | data source
  phase | 0:Pn, 1:Sn, 2:Pg, 3:Lg
  attribute | 0:TT, 1:SH, 2:AZ

Returns
  pointer to an Uncertainty object. Will return null if the number of distances in the file is zero.

## ◆ getValues()

vector<vector<double> >& slbm::Uncertainty::getValues | ( |  | ) |
| inline

A vector of doubles representing the model errors (in seconds)

A vector of doubles representing the model errors (in seconds)

Definition at line 319 of file Uncertainty.h.

## ◆ getVariance()

double slbm::Uncertainty::getVariance | ( | const double & | distance,
|  | double | depth = `0.0`
| ) |  |

Returns the model variance as a function of angular distance (radians) and depth.

Returns the model variance as a function of angular distance (radians) and depth. Depth defaults to the surface (0.0).

## ◆ operator!=()

bool slbm::Uncertainty::operator!= | ( | const Uncertainty & | other | ) |
| inline

Overloaded inequality operator

Parameters

  other | reference to the other Uncertainty object to which this Uncertainty object is to be compared

Returns
  true if this and other are not equal.

Definition at line 246 of file Uncertainty.h.

## ◆ operator=()

Uncertainty& slbm::Uncertainty::operator= | ( | const Uncertainty & | u | ) |

Assignment operator.

Assignment operator.

## ◆ operator==()

bool slbm::Uncertainty::operator== | ( | const Uncertainty & | other | ) |

Overloaded equality operator

Parameters

  other | reference to the other Uncertainty object to which this Uncertainty object is to be compared

Returns
  true if this and other are equal.

## ◆ readFile() [1/3]

void slbm::Uncertainty::readFile | ( | geotess::IFStreamAscii & | fin | ) |

## ◆ readFile() [2/3]

void slbm::Uncertainty::readFile | ( | geotess::IFStreamBinary & | fin | ) |

## ◆ readFile() [3/3]

void slbm::Uncertainty::readFile | ( | ifstream & | fin | ) |

## ◆ serialize()

void slbm::Uncertainty::serialize | ( | util::DataBuffer & | buffer | ) |

Writes the uncertainty object into the input DataBuffer.

Writes the uncertainty object into the input DataBuffer.

## ◆ toStringFile()

string slbm::Uncertainty::toStringFile | ( |  | ) |

## ◆ toStringTable()

string slbm::Uncertainty::toStringTable | ( |  | ) |

## ◆ writeFile() [1/3]

void slbm::Uncertainty::writeFile | ( | const string & | directoryName | ) |

## ◆ writeFile() [2/3]

void slbm::Uncertainty::writeFile | ( | geotess::IFStreamAscii & | output | ) |

## ◆ writeFile() [3/3]

void slbm::Uncertainty::writeFile | ( | geotess::IFStreamBinary & | fout | ) |

The documentation for this class was generated from the following file:

- rstt/SLBM/include/Uncertainty.h