SLBM
3.0
Regional Seismic Travel Time
|
#include <GeoTessModelSLBM.h>
Inherits GeoTessModel.
Public Member Functions | |
GeoTessModelSLBM (vector< vector< Uncertainty * > > &uncert, const GeoTessOptimizationType *optimization=&GeoTessOptimizationType::SPEED) | |
GeoTessModelSLBM (const string &modelInputFile, const string &relativeGridPath, vector< vector< Uncertainty * > > &uncertainties, const GeoTessOptimizationType *optimization=&GeoTessOptimizationType::SPEED) | |
GeoTessModelSLBM (const string &modelInputFile, vector< vector< Uncertainty * > > &uncertainties, const GeoTessOptimizationType *optimization=&GeoTessOptimizationType::SPEED) | |
GeoTessModelSLBM (const string &gridFileName, GeoTessMetaData *metaData, vector< vector< Uncertainty * > > &uncertainties, double *avgMantleVel) | |
GeoTessModelSLBM (GeoTessGrid *grid, GeoTessMetaData *metaData, vector< vector< Uncertainty * > > &uncertainties, double *avgMantleVel) | |
virtual | ~GeoTessModelSLBM () |
void | writeModelDataBuffer (util::DataBuffer &buffer) |
double | getAverageMantleVelocity (const int &index) const |
void | setAverageMantleVelocity (const int &index, const double &velocity) |
void | setIOUncertainty (bool io) |
int | getBufferSize () |
Protected Member Functions | |
void | loadModelAscii (IFStreamAscii &input, const string &inputDirectory, const string &relGridFilePath) |
void | loadModelBinary (IFStreamBinary &input, const string &inputDirectory, const string &relGridFilePath) |
void | writeModelAscii (IFStreamAscii &output, const string &gridFileName) |
void | writeModelBinary (IFStreamBinary &output, const string &gridFileName) |
Private Member Functions | |
void | init () |
Private Attributes | |
double | averageMantleVelocity [2] |
vector< vector< Uncertainty * > > & | uncertainty |
bool | ioUncertainty |
This is an SLBM extension of GeoTessModel for use by SLBM. Specific capabilities, beyond those of the base class, are management of the average mantle P and S velocity values required by SLBM and management of Uncertainty information for phases Pn, Sn, Pg and Lg for attributes TT, SH and AZ.
slbm::GeoTessModelSLBM::GeoTessModelSLBM | ( | vector< vector< Uncertainty * > > & | uncert, |
const GeoTessOptimizationType * | optimization = &GeoTessOptimizationType::SPEED |
||
) |
Default constructor.
uncert | the Uncertainty obects to set. |
optimization | either OptimizationType.SPEED or OptimizationType.MEMORY. This argument is deprecated and has no effect. |
slbm::GeoTessModelSLBM::GeoTessModelSLBM | ( | const string & | modelInputFile, |
const string & | relativeGridPath, | ||
vector< vector< Uncertainty * > > & | uncertainties, | ||
const GeoTessOptimizationType * | optimization = &GeoTessOptimizationType::SPEED |
||
) |
Construct a new GeoTessModel object and populate it with information from the specified file.
modelInputFile | name of file containing the model. |
relativeGridPath | the relative path from the directory where the model is stored to the directory where the grid is stored. Often, the model and grid are stored together in the same file in which case this parameter is ignored. Sometimes, however, the grid is stored in a separate file and only the name of the grid file (without path information) is stored in the model file. In this case, the code needs to know which directory to search for the grid file. The default is "" (empty string), which will cause the code to search for the grid file in the same directory in which the model file resides. Bottom line is that the default value is appropriate when the grid is stored in the same file as the model, or the model file is in the same directory as the model file. |
uncertainties | the Uncertainty obects to set. |
optimization | either OptimizationType.SPEED or OptimizationType.MEMORY. This argument is deprecated and has no effect. |
slbm::GeoTessModelSLBM::GeoTessModelSLBM | ( | const string & | modelInputFile, |
vector< vector< Uncertainty * > > & | uncertainties, | ||
const GeoTessOptimizationType * | optimization = &GeoTessOptimizationType::SPEED |
||
) |
Construct a new GeoTessModel object and populate it with information from the specified file.
relativeGridPath is assumed to be "" (empty string), which is appropriate when the grid information is stored in the same file as the model or when the grid is stored in a separate file located in the same directory as the model file.
modelInputFile | name of file containing the model. |
uncertainties | the Uncertainty obects to set. |
optimization | either OptimizationType.SPEED or OptimizationType.MEMORY. This argument is deprecated and has no effect. |
slbm::GeoTessModelSLBM::GeoTessModelSLBM | ( | const string & | gridFileName, |
GeoTessMetaData * | metaData, | ||
vector< vector< Uncertainty * > > & | uncertainties, | ||
double * | avgMantleVel | ||
) |
Parameterized constructor, specifying the grid and metadata for the model. The grid is constructed and the data structures are initialized based on information supplied in metadata. The data structures are not populated with any information however (all Profiles are null). The application should populate the new model's Profiles after this constructor completes.
Before calling this constructor, the supplied MetaData object must be populated with required information by calling the following MetaData methods:
gridFileName | name of file from which to load the grid. |
metaData | MetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made. |
uncertainties | the Uncertainty obects to set. |
avgMantleVel | a 2-element array containing the average P and S velocity of the upper mantle. |
GeoTessException | if metadata is incomplete. |
slbm::GeoTessModelSLBM::GeoTessModelSLBM | ( | GeoTessGrid * | grid, |
GeoTessMetaData * | metaData, | ||
vector< vector< Uncertainty * > > & | uncertainties, | ||
double * | avgMantleVel | ||
) |
Parameterized constructor, specifying the grid and metadata for the model. The grid is constructed and the data structures are initialized based on information supplied in metadata. The data structures are not populated with any information however (all Profiles are null). The application should populate the new model's Profiles after this constructor completes.
Before calling this constructor, the supplied MetaData object must be populated with required information by calling the following MetaData methods:
grid | a pointer to the GeoTessGrid that will support this GeoTessModel. GeoTessModel assumes ownership of the supplied grid object and will delete it when it is done with it. |
metaData | MetaData the new GeoTessModel instantiates a reference to the supplied metaData. No copy is made. |
uncertainties | the Uncertainties to set. |
avgMantleVel | a 2-element array containing the average P and S velocity of the top of the mantle, in km/sec |
GeoTessException | if metadata is incomplete. |
|
virtual |
Destructor.
|
inline |
Get the average mantle velocity for P (index=0) or S (index=1).
int slbm::GeoTessModelSLBM::getBufferSize | ( | ) |
|
private |
|
protected |
Load a model (3D grid and data) from an ascii File.
The format of the file is:
int fileFormatVersion (currently only recognizes 1).
String gridFile: either *, or relative path to gridFile.
int nVertices, nLayers, nAttributes, dataType(DOUBLE or FLOAT).
int[] tessellations = new int[nLayers];
Profile[nVertices][nLayers]: data
input | ascii stream that provides input |
inputDirectory | the directory where the model file resides |
relGridFilePath | the relative path from the directory where the model file resides to the directory where the grid file resides. |
GeoTessException |
|
protected |
Load a model (3D grid and data) from a binary File.
The format of the file is:
int fileFormatVersion (currently only recognizes 1).
String gridFile: either *, or relative path to gridFile.
int nVertices, nLayers, nAttributes, dataType(DOUBLE or FLOAT).
int[] tessellations = new int[nLayers];
Profile[nVertices][nLayers]: data
input | binary stream that provides input |
inputDirectory | the directory where the model file resides |
relGridFilePath | the relative path from the directory where the model file resides to the directory where the grid file resides. |
GeoTessException |
|
inline |
Get the average mantle velocity for P (index=0) or S (index=1).
|
inline |
If true then uncertainty information is output to output file next time writeModel is called.
|
protected |
Write the model currently in memory to an ascii file. A model can be stored with the data and grid in the same or separate files. This method will write the data from the 3D model to the specified outputfile. If the supplied gridFileName is the single character "*", then the grid information is written to the same file as the data. If the gridFileName is anything else, it is assumed to be the relative path from the data file to an existing file where the grid information is stored. In the latter case, the grid information is not actually written to the specified file; all that happens is that the relative path is stored in the data file.
|
protected |
Write the model currently in memory to a binary file. A model can be stored with the data and grid in the same or separate files. This method will write the data from the 3D model to the specified outputfile. If the supplied gridFileName is the single character "*", then the grid information is written to the same file as the data. If the gridFileName is anything else, it is assumed to be the relative path from the data file to an existing file where the grid information is stored. In the latter case, the grid information is not actually written to the specified file; all that happens is that the relative path is stored in the data file.
void slbm::GeoTessModelSLBM::writeModelDataBuffer | ( | util::DataBuffer & | buffer | ) |
Write the model currently in memory to a DataBuffer. GeoTessModel does not have a method to write itself to a DataBuffer so this method will write the entire model, including all the information from the base class (GeoTessModel) and all the extra data from the derived class (GeoTessModelSLBM).
|
private |
The average P and S velocity of the upper mantle.
|
private |
If true, then uncertainty information is read/written by io operations.
|
private |
A 2D array of Uncertainty objects. The array dimensions are nPhases x nAttriubtes where nPhases = 4 (Pn, Sn, Pg, Lg) and nAttributes is 3 (TT, SH, AZ).