RSTT
3.1.0
Regional Seismic Travel Time
|
Go to the documentation of this file.
65 #include "GeoTessPolygon.h"
108 static bool fileExists(
const string& fileName);
113 virtual bool operator == (
const Grid& other);
118 virtual bool operator != (
const Grid& other) {
return !(*
this == other);};
186 virtual GridProfile* getProfile(
const int& nodeId);
217 const double& latSource,
218 const double& lonSource,
219 const double& depthSource,
220 const double& latReceiver,
221 const double& lonReceiver,
222 const double& depthReceiver,
224 const double& ch_max);
247 const double& lat,
const double& lon,
const double& depth);
250 const double& lat,
const double& lon,
const double& depth);
255 virtual void clearCrustalProfiles();
332 virtual int getNCrustalProfiles();
354 vector<GridProfile*>& neighbors, vector<int>& nodeIds,
355 vector<double>& coefficients) = ABSTRACT;
367 double activeNodeLonMin,
368 double activeNodeLatMax,
369 double activeNodeLonMax);
394 {
return (activeNodeId < 0 ? -1 : activeNodes[activeNodeId]); };
402 {
return profiles[nodeId]->getActiveNodeId(); };
409 virtual void getNodeNeighbors(
const int& nodeId,
int neighbors[],
int& nNeighbors) = ABSTRACT;
426 double distance[],
double azimuth[],
int& nNeighbors);
436 vector<double>& distance, vector<double>& azimuth);
443 double distance[],
double azimuth[],
int& nNeighbors);
446 vector<double>& distance, vector<double>& azimuth);
458 virtual void getNodeAzimuth(
const int& node1,
const int& node2,
double& azimuth);
461 { hitCount = profiles[nodeId]->getHitCount(); };
463 virtual void clearNodeHitCount();
469 virtual size_t memSizeCrustalProfiles();
515 string outputDirectory;
522 if (n < 0 || n >= (
int)profiles.size())
525 os << setiosflags(ios::fixed) << setiosflags(ios::showpoint) << setprecision(4);
526 os << endl <<
"ERROR in Grid::getProfile. NodeId "<< n <<
" is out of range. " << endl
527 <<
"Valid range is >= 0 and < " << profiles.size() << endl
528 <<
"Version " << SlbmVersion <<
" File " << __FILE__ <<
" line " << __LINE__ << endl << endl;
551 const double& lat,
const double& lon,
const double& depth)
553 return sources->getCrustalProfile(phase, lat, lon, depth);
557 const double& lat,
const double& lon,
const double& depth)
559 return receivers->getCrustalProfile(phase, lat, lon, depth);
562 inline void Grid::clearCrustalProfiles()
568 inline int Grid::getNCrustalProfiles()
570 return receivers->getNCrustalProfiles()
571 + sources->getNCrustalProfiles();
574 inline size_t Grid::memSizeCrustalProfiles()
576 return receivers->
memSize() + sources->memSize();
579 inline void Grid::clearNodeHitCount()
581 for (
int i=0; i<(int)profiles.size(); ++i)
582 profiles[i]->clearHitCount();
585 inline bool Grid::fileExists(
const string& fileName)
589 f.open(fileName.c_str(), ios::in);
virtual string toString()
virtual int getActiveNodeId(int nodeId)
Retrieve the grid node id that corresponds to a specified active node id.
static string class_name()
An InterpolatedProfile object that also has information about the the P and S wave velocity as a func...
Manages all information related to a single node in a Grid object.
virtual bool is_directory(const string &dir)
virtual void getActiveNodeNeighbors(const int &nodeid, vector< int > &neighbors)
virtual void getNodeAzimuth(const int &node1, const int &node2, double &azimuth)
Retrieve the azimuth in radians from one grid node to another.
virtual void getNodeNeighbors(const int &nodeId, vector< int > &neighbors)
Retrieve the grid node ids of the nodes that are direct neighbors of the specified grid node.
virtual bool findProfile(Location &location, vector< GridProfile * > &neighbors, vector< int > &nodeIds, vector< double > &coefficients)
Find the neighboring GridProfile objects and associated interpolation coefficients at a specified Loc...
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.
string modelPath
The name of the file or directory from which the velocity model was loaded.
virtual double getAverageMantleVelocity(const int &waveType)
Retrieve the average P or S wave velocity of the mantle, in km/sec.
virtual int getNNodes()
Retrieve the number of nodes in the model.
void initializeActiveNodes(double activeNodeLatMin, double activeNodeLonMin, double activeNodeLatMax, double activeNodeLonMax)
Specify the latitude, longitude range in radians that will define which grid nodes are also active no...
Grid()
Default constructor.
vector< vector< Uncertainty * > > & getUncertainty()
virtual void saveVelocityModel(const string &filename, const int &format)
Save the Earth model currently in memory, to an ascii flat file.
A LayerProfile with mantle velocity gradient information.
virtual void getActiveNodeNeighborInfo(const int &nid, int neighbors[], double distance[], double azimuth[], int &nNeighbors)
void specifyOutputDirectory(const string &outputDir)
virtual int getNIntervals()
Retrieve the number of intervals in each Profile.
static Grid * getGrid(const string &modelDirectory)
CrustalProfileStore * receivers
vector< vector< Uncertainty * > > uncertainty
Manages all information related to a single node in a Grid object.
A profile through the Earth model that stores interface radius, and interval P or S wave velocity inf...
vector< UncertaintyPathDep * > & getUncertaintyPathDep()
virtual void loadFromFile(const string &filename)
Load the depth, velocity and gradient information from an ascii flat file.
virtual void getActiveNodeNeighborInfo(const int &nid, vector< int > &neighbors, vector< double > &distance, vector< double > &azimuth)
virtual int getNActiveNodes()
Retrieve the number of active nodes.
A 2 dimensional, horizontal grid of GirdProfile objects.
vector< UncertaintyPathDep * > uncertaintyPathDep
UncertaintyPathDep & getUncertaintyPathDep(int phase)
virtual void loadFromDirectory(const string &dirName)
Load the depth, velocity and gradient information from binary files in specified directory.
void reaDataBuffererFromFile(util::DataBuffer &buffer, string dirname, string fileName)
virtual ~Grid()
Destructor.
A Profile object based on values interpolated from nearby GridProfile objects.
virtual int getBufferSize() const
CrustalProfileStore supports pool allocation for CrustalProfile objects.
virtual void setAverageMantleVelocity(const int &waveType, const double &velocity)
Retrieve the average P or S wave velocity of the mantle, in km/sec.
virtual void getNodeSeparation(const int &node1, const int &node2, double &distance)
Retrieve the angular separation in radians between any pair of.
virtual string getInterpolatorType()
int getPhase()
Retrieve the phase that this GreatCircle supports. Will be one of SLBMGlobals::Pn,...
virtual int addGeoStack(GeoStack *geoStack)
virtual int getGridNodeId(int activeNodeId)
Retrieve the grid node id that corresponds to a specified active node id.
vector< GridProfile * > profiles
The GridProfile objects which constitute the nodes in a Grid object.
static Grid * getGrid(util::DataBuffer &buffer)
virtual void getActiveNodeNeighbors(const int &nodeid, int neighbors[], int &nNeighbors)
A Uncertainty object contains the raw data to calculate a modeling error in seconds as a function of ...
CrustalProfileStore * sources
Uncertainty & getUncertainty(int phase, int attribute)
An Exception class for Grid and related objects.
virtual void getNodeHitCount(const int &nodeId, int &hitCount)
virtual void saveVelocityModel(util::DataBuffer &buffer)
Save the Earth model currently in memory, to a DataBuffer.
virtual void loadFromDataBuffer(util::DataBuffer &buffer)
Load the depth, velocity and gradient information from DataBuffer.
virtual void getNodeNeighborInfo(const int &nodeId, int neighbors[], double distance[], double azimuth[], int &nNeighbors)
Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node.
virtual void getNodeNeighbors(const int &nodeId, int neighbors[], int &nNeighbors)
Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node.
virtual void clear()
Clears and releases all memory held by this Grid object.
A UncertaintyPathDep object contains the raw data to calculate a path dependent modeling error in sec...
virtual void setInterpolatorType(const string &interpolatorType)
void initializeActiveNodes(GeoTessPolygon *polygon)
Specify the Polygon that will define which grid nodes are also active nodes.
vector< int > activeNodes
const string getOutputDirectory()
void writeBufferToFile(util::DataBuffer &buffer, string fileName)
The GreatCircle class manages information related to a great circle path between two Locations on the...
virtual void getNodeNeighborInfo(const int &nodeId, vector< int > &neighbors, vector< double > &distance, vector< double > &azimuth)
Retrieve the grid node id of the nodes that are direct neighbors of the specified grid node.
A byte array container used to hold binary data in the same manner as disk based file system.
virtual GreatCircle * getGreatCircle(const int &phase, const double &latSource, const double &lonSource, const double &depthSource, const double &latReceiver, const double &lonReceiver, const double &depthReceiver, const double &delta, const double &ch_max)
Retrieve a GreatCircle object between a source and a receiver.
virtual string getTessId()