SLBM
2.7
|
The primary interface to the SLBM library, providing access to all supported functionality. More...
#include <SlbmInterface.h>
Public Member Functions | |
SlbmInterface () | |
Default constructor. Instantiates an SlbmInterface object based on an ellipsoidal earth. | |
SlbmInterface (const double &earthRadius) | |
Parameterized constructor. Instantiates an SlbmInterface object that is only partly based on an ellipsoidal earth. | |
virtual | ~SlbmInterface () |
Destructor. | |
string | getVersion () |
Retrieve the SLBM Version number. | |
void | loadVelocityModel (const string &modelFileName) |
Load the velocity model into memory from the specified file. | |
void | saveVelocityModel (const string &modelFileName) |
Save the velocity model currently in memory to the specified file. | |
void | loadVelocityModelBinary (const string &modelDirectory) |
Load the velocity model into memory from files located in the specified directory. | |
void | specifyOutputDirectory (const string &directoryName) |
Specify the directory where the model that is currently in memory should be written to the next time that saveVelocityModelBinary() is called. | |
void | saveVelocityModelBinary () |
void | createGreatCircle (const string &phase, const double &sourceLat, const double &sourceLon, const double &sourceDepth, const double &receiverLat, const double &receiverLon, const double &receiverDepth) |
Instantiate a new GreatCircle object between two locations. | |
void | createGreatCircle (const int &phase, const double &sourceLat, const double &sourceLon, const double &sourceDepth, const double &receiverLat, const double &receiverLon, const double &receiverDepth) |
Instantiate a new GreatCircle object between two locations. | |
void | clear () |
Delete the current GreatCircle object from memory and clear the pool of stored CrustalProfile objects. The model Grid is not deleted and remains accessible. | |
bool | isValid () |
string | getPhase () |
void | getDistance (double &distance) |
Retrieve the source-receiver separation, in radians. | |
void | getSourceDistance (double &dist) |
Retrieve horizontal offset below the source, in radians. | |
void | getReceiverDistance (double &dist) |
Retrieve horizontal offset below the receiver, in radians. | |
void | getHeadwaveDistance (double &dist) |
Retrieve angular distance traveled by the ray below the headwave interface, in radians. | |
void | getHeadwaveDistanceKm (double &dist) |
Retrieve horizontal distance traveled by the ray below the headwave interface, in radians. | |
void | getTravelTime (double &travelTime) |
Retrieve the total travel time for the GreatCircle, in seconds. | |
void | getTravelTimeComponents (double &tTotal, double &tSource, double &tReceiver, double &tHeadwave, double &tGradient) |
Retrieve the total travel time and the 4 components that contribute to it for the current GreatCircle. | |
void | getSlowness (double &slowness) |
Retrieve the horizontal slowness, i.e., the derivative of travel time wrt to receiver-source distance, in seconds/radian. | |
void | get_dtt_dlat (double &dtt_dlat) |
Retrieve the derivative of travel time wrt to source latitude, in seconds/radian. | |
void | get_dtt_dlon (double &dtt_dlon) |
Retrieve the derivative of travel time wrt to source longitude, in seconds/radian. | |
void | get_dtt_ddepth (double &dtt_ddepth) |
Retrieve the derivative of travel time wrt to source depth, in seconds/km. | |
void | getWeights (int nodeId[], double weight[], int &nWeights) |
Retrieve the weight assigned to each grid node that was touched by the GreatCircle. | |
void | getActiveNodeWeights (int nodeId[], double weight[], int &nWeights) |
Retrieve the weight assigned to each active node that was touched by the GreatCircle. | |
void | getWeights (vector< int > &nodeId, vector< double > &weight) |
Retrieve the weight assigned to each grid node that was touched by the GreatCircle. | |
void | getActiveNodeWeights (vector< int > &nodeId, vector< double > &weight) |
Retrieve the weight assigned to each active node that was touched by the GreatCircle. | |
void | getWeightsSource (int nodeids[], double weights[]) |
Retrieve the node IDs and the interpolation coefficients for the source CrustalProfile. | |
void | getActiveNodeWeightsSource (int nodeids[], double weights[]) |
Retrieve the active node IDs and the interpolation coefficients for the source CrustalProfile. | |
void | getWeightsReceiver (int nodeids[], double weights[]) |
Retrieve the node IDs and the interpolation coefficients for the receiver CrustalProfile. | |
void | getActiveNodeWeightsReceiver (int nodeids[], double weights[]) |
Retrieve the active node IDs and the interpolation coefficients for the receiver CrustalProfile. | |
string | toString (const int &verbosity) |
Returns a human-readable string representation of the GreatCircle object. | |
void | getNGridNodes (int &n) |
void | getNHeadWavePoints (int &nHeadWavePoints) |
Retrieve the number of LayerProfile objects positioned along the head wave interface. | |
void | getGridData (const int &nodeId, double &latitude, double &longitude, double depth[NLAYERS], double pvelocity[NLAYERS], double svelocity[NLAYERS], double gradient[2]) |
Retrieve the lat (radians), lon (radians), interface depths (km), P and S wave interval velocities (km/sec) and P and S mantle gradient (1/sec) information associated with a specified node in the velocity grid. | |
void | getActiveNodeData (const int &nodeId, double &latitude, double &longitude, double depth[NLAYERS], double pvelocity[NLAYERS], double svelocity[NLAYERS], double gradient[2]) |
Retrieve the lat (radians), lon (radians), interface depths (km), P and S wave interval velocities (km/sec) and P and S mantle gradient (1/sec) information associated with a specified active node in the velocity grid. | |
void | setGridData (const int &nodeId, double depths[NLAYERS], double pvelocity[NLAYERS], double svelocity[NLAYERS], double gradient[2]) |
Modify the velocity and gradient information associated with a specified node in the Grid. | |
void | setActiveNodeData (const int &nodeId, double depths[NLAYERS], double pvelocity[NLAYERS], double svelocity[NLAYERS], double gradient[2]) |
Modify the depth, velocity and gradient information associated with a specified active node in the Grid. | |
void | getGreatCircleData (string &phase, double &actual_path_increment, double sourceDepth[NLAYERS], double sourceVelocity[NLAYERS], double receiverDepth[NLAYERS], double receiverVelocity[NLAYERS], double headWaveVelocity[], double gradient[], int neighbors[][nCoefficients], double coefficients[][nCoefficients], int &npoints) |
Retrieve the data required for input to the travel time calculation, for the current GreatCircle object. | |
void | getInterpolatedPoint (const double &lat, const double &lon, int nodeId[nCoefficients], double coefficients[nCoefficients], double depth[NLAYERS], double pvelocity[NLAYERS], double svelocity[NLAYERS], double &pgradient, double &sgradient) |
Retrieve interpolated data from the earth model at a single specified latitude, longitude. | |
void | getInterpolatedTransect (double lat[], double lon[], const int &nLatLon, int nodeId[][nCoefficients], double coefficients[][nCoefficients], double depth[][NLAYERS], double pvelocity[][NLAYERS], double svelocity[][NLAYERS], double pgradient[NLAYERS], double sgradient[NLAYERS], int &nInvalid) |
Retrieve interpolated data from the earth model along a transect defined by equal sized, 1 dimensional arrays of latitude and longitude. | |
void | initializeActiveNodes (const double &latmin, const double &lonmin, const double &latmax, const double &lonmax) |
Specify the latitude and longitude range for active nodes. | |
int | getNActiveNodes () |
int | getGridNodeId (int activeNodeId) |
int | getActiveNodeId (int gridNodeId) |
void | getNodeHitCount (const int &nodeId, int &hitCount) |
Retrieve the number of times that the specified node has been 'touched' by a GreatCircle object. | |
void | getNodeNeighbors (const int &nid, int neighbors[], int &nNeighbors) |
Retrieve the node IDs of the nodes that surround the specified node. | |
void | getActiveNodeNeighbors (const int &nid, int neighbors[], int &nNeighbors) |
Retrieve the active node IDs of the nodes that surround the specified active node. | |
void | getNodeNeighbors (const int &nid, vector< int > &neighbors) |
void | getActiveNodeNeighbors (const int &nid, vector< int > &neighbors) |
Retrieve active the node IDs of the active nodes that surround the specified active node. | |
void | getNodeNeighborInfo (const int &nid, int neighbors[], double distance[], double azimuth[], int &nNeighbors) |
Retrieve the node IDs of the nodes that surround the specified node. | |
void | getActiveNodeNeighborInfo (const int &nid, int neighbors[], double distance[], double azimuth[], int &nNeighbors) |
Retrieve the active node IDs of the nodes that surround the specified node. | |
void | getActiveNodeNeighborInfo (const int &nid, vector< int > &neighbors, vector< double > &distance, vector< double > &azimuth) |
Retrieve the active node IDs of the nodes that surround the specified node. | |
void | getNodeSeparation (const int &node1, const int &node2, double &distance) |
void | getNodeAzimuth (const int &node1, const int &node2, double &azimuth) |
GreatCircle * | getGreatCircleObject () |
Retrieve a pointer to the GreatCircle object. | |
Grid * | getGridObject () |
Retrieve a pointer to the Grid object. | |
void | getTravelTimeUncertainty (const int &phase, const double &distance, double &uncert) |
Retrieve the travel time uncertainty in sec for specified phase, distance. | |
void | getTravelTimeUncertainty (double &travelTimeUncertainty) |
Retrieve travel time uncertainty in sec using the phase and distance specified in last call to getGreatCircle(). | |
void | getSlownessUncertainty (const int &phase, const double &distance, double &uncert) |
Retrieve the slowness uncertainty in sec/radian for specified phase, distance. | |
void | getSlownessUncertainty (double &slownessUncertainty) |
Retrieve uncertainty of the horizontal slowness, in seconds/radian using the phase and distance specified in last call to getGreatCircle(). | |
void | getZhaoParameters (double &Vm, double &Gm, double &H, double &C, double &Cm, int &udSign) |
Retrieve some of the parameters that contribute to the calculation of of total travel time using the Zhao algorithm. | |
void | getPgLgComponents (double &tTotal, double &tTaup, double &tHeadwave, double &pTaup, double &pHeadwave, double &trTaup, double &trHeadwave) |
Retrieve information about Pg/Lg travel time calculations. | |
void | getAverageMantleVelocity (const int &type, double &velocity) |
Retrieve the average P or S wave mantle velocity that is specified in the model input file, in km/sec. | |
void | setAverageMantleVelocity (const int &type, const double &velocity) |
Set the average P or S wave mantle velocity that is recorded in the model input file, in km/sec. | |
void | getTessId (string &tessId) |
void | getFractionActive (double &fractionActive) |
string | getClassCount () |
Retrieve a table that lists the number of instances of various SLBM classes that are currently instantiated. | |
const string & | getModelPath () const |
A string containing the path to the SLBM model. | |
void | getDistAz (const double &aLat, const double &aLon, const double &bLat, const double &bLon, double &distance, double &azimuth, const double &naValue) |
compute distance and azimuth between two points, A and B (all quantities are in radians). | |
void | movePoint (const double &aLat, const double &aLon, const double &distance, const double &azimuth, double &bLat, double &bLon) |
void | getGreatCircleLocations (double lat[], double lon[], double depth[], int &npoints) |
Retrieve the latitudes, longitudes and depths of all the profile positions along the headwave interface. | |
void | getPiercePointSource (double &lat, double &lon, double &depth) |
Retrieve the latitude and longitude of the moho pierce point below the source, in radians. | |
void | getPiercePointReceiver (double &lat, double &lon, double &depth) |
Retrieve the latitude and longitude of the moho pierce point below the receiver, in radians. | |
void | getGreatCirclePoints (const double &aLat, const double &aLon, const double &bLat, const double &bLon, const int &npoints, double latitude[], double longitude[]) |
Retrieve an array of lat, lon points along a great circle path between two specified points, a and b. | |
void | getGreatCirclePointsOnCenters (const double &aLat, const double &aLon, const double &bLat, const double &bLon, const int &npoints, double latitude[], double longitude[]) |
Retrieve an array of lat, lon points along a great circle path between two specified points, a and b. | |
void | setDelDistance (const double &del_distance) |
Change the value of step change in distance used to compute horizontal derivatives(in radians). | |
void | getDelDistance (double &del_distance) |
void | setDelDepth (const double &del_depth) |
void | getDelDepth (double &del_depth) |
Retrieve the value of step change in depth used to compute depth derivatives (km) | |
void | setPathIncrement (const double &pathIncrement) |
Set the desired spacing of great circle nodes along the head wave interface, in radians. | |
void | getPathIncrement (double &pathIncrement) |
Retrieve the current value of the spacing of great circle nodes along the head wave interface, in radians. | |
Static Public Member Functions | |
static void | setCHMax (const double &chMax) |
Set the value of chMax. c is the zhao c parameter and h is the turning depth of the ray below the moho. Zhao method only valid for c*h << 1. When c*h > chMax, then slbm will throw an exception. | |
static void | getCHMax (double &chMax) |
Retrieve the current value of chMax. c is the zhao c parameter and h is the turning depth of the ray below the moho. Zhao method only valid for c*h << 1. When c*h > chMax, then slbm will throw an exception. | |
static void | setMaxDistance (const double &maxDistance) |
Set the maximum source-receiver separation for Pn/Sn phase, in radians. | |
static void | getMaxDistance (double &maxDistance) |
static void | setMaxDepth (const double &maxDepth) |
Set the maximum source depth for Pn/Sn phase, in km. | |
static void | getMaxDepth (double &maxDepth) |
Protected Member Functions | |
void | clearGreatCircles () |
void | loadVelocityModelBinary (util::DataBuffer &buffer) |
Load the velocity model into memory from an FDB database configured DataBuffer. | |
int | getBufferSize () const |
void | saveVelocityModelBinary (util::DataBuffer &buffer) |
Protected Attributes | |
Grid * | grid |
GreatCircle * | greatCircle |
Uncertainty * | uncertainty [3][4] |
string | modelPath |
A string containing the path to the SLBM model. | |
bool | valid |
Static Protected Attributes | |
static double | CH_MAX |
The primary interface to the SLBM library, providing access to all supported functionality.
SlbmInterface maintains a Grid object which is loaded into memory with the loadVelocityModel() method. This Grid object remains in memory until the SlbmInterface destructor is called.
SlbmInterface also maintains a single instance of a GreatCircle object which is instantiated with a call to createGreatCircle(). Once instantiated, many SlbmInterface methods can retrieve information from it, such as getTravelTime(), getTravelTimeComponents(), getWeights(), and more. Once instantiated, the GreatCircle can be interrogated until it is replaced with another GreatCircle by a subsequent call to createGreatCircle(), or is deleted by clear().
slbm::SlbmInterface::SlbmInterface | ( | ) |
Default constructor. Instantiates an SlbmInterface object based on an ellipsoidal earth. Geographic latitudes are converted to geocentric latitudes, and the radius of the Earth varies as a function of latitude.
slbm::SlbmInterface::SlbmInterface | ( | const double & | earthRadius | ) |
Parameterized constructor. Instantiates an SlbmInterface object that is only partly based on an ellipsoidal earth. Geographic latitudes are converted to geocentric latitudes, but the radius of the Earth is considered a constant independent of latitude.
earthRadius | the constant radius of the earth in km. |
virtual slbm::SlbmInterface::~SlbmInterface | ( | ) | [virtual] |
Destructor. Deletes the GreatCircle object and the Grid object.
void slbm::SlbmInterface::clear | ( | ) |
Delete the current GreatCircle object from memory and clear the pool of stored CrustalProfile objects. The model Grid is not deleted and remains accessible.
The Grid object owned by SlbmInterface stores a vector of map objects which associates the phase and Location of a CrustalProfile object with a pointer to the instance of the CrustalProfile. When createGreatCircle() is called with a latitude, longitude and depth which has been used before, the Grid object will return a pointer to the existing CrustalProfile object, thereby enhancing performance. This vector of maps is cleared when SlbmInterface::clear() is called. The implications of all this is that applications that loop over many calls to createGreatCircle() will see a performance improvement if clear() is not called within the loop. However, for problems with a huge number of sources and or receivers, if memory becomes an issue, applications could call clear() within the loop to save memory.
void slbm::SlbmInterface::clearGreatCircles | ( | ) | [protected] |
deletes current greatCircle object and sets ttHminus, ttHplus, ttZplus and ttHZplus equal to NA_VALUE.
void slbm::SlbmInterface::createGreatCircle | ( | const string & | phase, |
const double & | sourceLat, | ||
const double & | sourceLon, | ||
const double & | sourceDepth, | ||
const double & | receiverLat, | ||
const double & | receiverLon, | ||
const double & | receiverDepth | ||
) | [inline] |
Instantiate a new GreatCircle object between two locations.
phase | the phase that this GreatCircle is to support. Recognized phases are Pn, Sn, Pg and Lg. |
sourceLat | the geographic latitude of the source in radians. |
sourceLon | the longitude of source in radians. |
sourceDepth | the depth of the source in km. |
receiverLat | the geographic latitude of the receiver in radians. |
receiverLon | the longitude of the receiver in radians. |
receiverDepth | the depth of the receiver in km. |
void slbm::SlbmInterface::createGreatCircle | ( | const int & | phase, |
const double & | sourceLat, | ||
const double & | sourceLon, | ||
const double & | sourceDepth, | ||
const double & | receiverLat, | ||
const double & | receiverLon, | ||
const double & | receiverDepth | ||
) |
Instantiate a new GreatCircle object between two locations.
phase | the phase that this GreatCircle is to support. Recognized phases are Pn, Sn, Pg and Lg. |
sourceLat | the geographic latitude of the source in radians. |
sourceLon | the longitude of source in radians. |
sourceDepth | the depth of the source in km. |
receiverLat | the geographic latitude of the receiver in radians. |
receiverLon | the longitude of the receiver in radians. |
receiverDepth | the depth of the receiver in km. |
void slbm::SlbmInterface::get_dtt_ddepth | ( | double & | dtt_ddepth | ) | [inline] |
Retrieve the derivative of travel time wrt to source depth, in seconds/km.
dtt_ddepth | the derivative of travel time wrt to source depth. |
void slbm::SlbmInterface::get_dtt_dlat | ( | double & | dtt_dlat | ) | [inline] |
Retrieve the derivative of travel time wrt to source latitude, in seconds/radian.
dtt_dlat | the derivative of travel time wrt to source latitude. |
void slbm::SlbmInterface::get_dtt_dlon | ( | double & | dtt_dlon | ) | [inline] |
Retrieve the derivative of travel time wrt to source longitude, in seconds/radian.
dtt_dlon | the derivative of travel time wrt to source longitude. |
void slbm::SlbmInterface::getActiveNodeData | ( | const int & | nodeId, |
double & | latitude, | ||
double & | longitude, | ||
double | depth[NLAYERS], | ||
double | pvelocity[NLAYERS], | ||
double | svelocity[NLAYERS], | ||
double | gradient[2] | ||
) |
Retrieve the interface depth, velocity and gradient information associated with a specified active node in the velocity grid.
nodeId | the active node ID of the grid point in the model (zero based index). |
latitude | the latitude of the grid node in radians. |
longitude | the longitude of the grid node in radians. |
depth | the depths of all the model interfaces, in km. |
pvelocity | an array containing the P velocities of all the intervals at the specified grid node, in km/sec. |
svelocity | an array containing the S velocities of all the intervals at the specified grid node, in km/sec. |
gradient | a 2-element array containing the P and S velocity gradients in the mantle, in 1/sec. |
int slbm::SlbmInterface::getActiveNodeId | ( | int | gridNodeId | ) | [inline] |
Retrieve the active node ID that corresponds to a specified grid node ID.
void slbm::SlbmInterface::getActiveNodeNeighborInfo | ( | const int & | nid, |
int | neighbors[], | ||
double | distance[], | ||
double | azimuth[], | ||
int & | nNeighbors | ||
) | [inline] |
Retrieve the active node IDs of the nodes that surround the specified node.
The caller must supply int array neighbors which is dimensioned large enough to hold the maximum number of neighbors that a node can have, which is 8. The actual number of neighbors is returned in nNeighbors.
void slbm::SlbmInterface::getActiveNodeNeighborInfo | ( | const int & | nid, |
vector< int > & | neighbors, | ||
vector< double > & | distance, | ||
vector< double > & | azimuth | ||
) | [inline] |
Retrieve the active node IDs of the nodes that surround the specified node.
The caller must supply int array neighbors which is dimensioned large enough to hold the maximum number of neighbors that a node can have, which is 8. The actual number of neighbors is returned in nNeighbors.
void slbm::SlbmInterface::getActiveNodeNeighbors | ( | const int & | nid, |
int | neighbors[], | ||
int & | nNeighbors | ||
) | [inline] |
Retrieve the active node IDs of the active nodes that surround the specified active node.
The caller must supply int array neighbors which is dimensioned large enough to hold the maximum number of neighbors that a node can have, which is 8. The actual number of neighbors is returned in nNeighbors.
void slbm::SlbmInterface::getActiveNodeNeighbors | ( | const int & | nid, |
vector< int > & | neighbors | ||
) | [inline] |
Retrieve the active node IDs of the active nodes that surround the specified active node.
void slbm::SlbmInterface::getActiveNodeWeights | ( | int | nodeId[], |
double | weight[], | ||
int & | nWeights | ||
) | [inline] |
Retrieve the weight assigned to each active node that was touched by the GreatCircle.
A map which associates an instance of a GridProfile object with a double weight is initialized. Then every LayerProfile on the head wave interface between the source and receiver is visited and the angular distance, d, that the ray traveled in the horizontal segment is retrieved. If d > 0, then the neighboring GridProfile objects that contributed to the interpolated value of the LayerProfile are visited. The product of d * R * C is added to the weight associated with that GridProfile object, where R is the radius of the head wave interface for the LayerProfile object being evaluated, and C is the interpolation coefficient for the GridProfile - LayerProfile pair under consideration. Then, all the GridProfile objects in the map are visited, the grid node IDs extracted into int array nodeId, and the weight extracted into double array weight.
Note: Only grid nodes touched by this GreatCircle are included in the output. Each grid node is included only once, even though more than one LayerProfile object may have contributed some weight to it. The sum of all the weights will equal the horizontal distance traveled by the ray along the head wave interface, from the source pierce point to the receiver pierce point, in km.
nodeId | the active node IDs of all the grid nodes touched by the current GreatCircle. These are active node ids, not grid node ids. If a grid node has weight but is not an active node, the nodeId will be -1. |
weight | the weights of all the grid nodes touched by the current GreatCircle. Calling application must dimension this array large enough to handle any possible size. |
nWeights | the number of elements in nodeId and weight. Calling application must dimension this array large enough to handle any possible size. |
void slbm::SlbmInterface::getActiveNodeWeights | ( | vector< int > & | nodeId, |
vector< double > & | weight | ||
) | [inline] |
Retrieve the weight assigned to each active node that was touched by the GreatCircle.
A map which associates an instance of a GridProfile object with a double weight is initialized. Then every LayerProfile on the head wave interface between the source and receiver is visited and the angular distance, d, that the ray traveled in the horizontal segment is retrieved. If d > 0, then the neighboring GridProfile objects that contributed to the interpolated value of the LayerProfile are visited. The product of d * R * C is added to the weight associated with that GridProfile object, where R is the radius of the head wave interface for the LayerProfile object being evaluated, and C is the interpolation coefficient for the GridProfile - LayerProfile pair under consideration. Then, all the GridProfile objects in the map are visited, the grid node IDs extracted into int array nodeId, and the weight extracted into double array weight.
Note: Only grid nodes touched by this GreatCircle are included in the output. Each grid node is included only once, even though more than one LayerProfile object may have contributed some weight to it. The sum of all the weights will equal the horizontal distance traveled by the ray along the head wave interface, from the source pierce point to the receiver pierce point, in km.
nodeId | the active node IDs of all the grid nodes touched by the current GreatCircle. |
weight | the weights of all the grid nodes touched by the current GreatCircle. |
void slbm::SlbmInterface::getActiveNodeWeightsReceiver | ( | int | nodeids[], |
double | weights[] | ||
) | [inline] |
Retrieve the active node IDs and the interpolation coefficients for the receiver CrustalProfile. There will be SLBMGlobals::nCoefficients of each. The sum of the weights will equal 1.
void slbm::SlbmInterface::getActiveNodeWeightsSource | ( | int | nodeids[], |
double | weights[] | ||
) | [inline] |
Retrieve the active node IDs and the interpolation coefficients for the source CrustalProfile. There will be SLBMGlobals::nCoefficients of each. The sum of the weights will equal 1.
void slbm::SlbmInterface::getAverageMantleVelocity | ( | const int & | type, |
double & | velocity | ||
) | [inline] |
Retrieve the average P or S wave mantle velocity that is specified in the model input file. This value is used in the calculation of the Zhao c parameter.
type | specify either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE. |
velocity | the P or S wave velocity is returned in this parameter, in km/sec. |
int slbm::SlbmInterface::getBufferSize | ( | ) | const [protected] |
Returns the size of a DataBuffer object required to store this SLBMInterface objects model data.
static void slbm::SlbmInterface::getCHMax | ( | double & | chMax | ) | [static] |
Retrieve the current value of chMax. c is the zhao c parameter and h is the turning depth of the ray below the moho. Zhao method only valid for c*h << 1. When c*h > chMax, then slbm will throw an exception. This call retrieves global parameter SLBMGlobals::CH_MAX
string slbm::SlbmInterface::getClassCount | ( | ) | [inline] |
Retrieve a table that lists the number of instances of various SLBM classes that are currently instantiated. Very useful for debugging memory leaks.
void slbm::SlbmInterface::getDelDepth | ( | double & | del_depth | ) |
Retrieve the value of step change in depth used to compute
void slbm::SlbmInterface::getDelDistance | ( | double & | del_distance | ) |
Retrieve the value of step change in distance used to compute horizontal derivatives (radians)
void slbm::SlbmInterface::getDistance | ( | double & | distance | ) | [inline] |
Retrieve the source-receiver separation, in radians.
distance | the source-receiver separation is returned in distance. If the GreatCircle is invalid, distance will equal SLBMGlobals::NA_VALUE. |
void slbm::SlbmInterface::getDistAz | ( | const double & | aLat, |
const double & | aLon, | ||
const double & | bLat, | ||
const double & | bLon, | ||
double & | distance, | ||
double & | azimuth, | ||
const double & | naValue | ||
) | [inline] |
compute distance and azimuth between two points, A and B (all quantities are in radians). Computed distance will range between 0 and PI and azimuth will range from -PI to PI. If distance is zero, or if A is located at north or south pole, azimuth will be set to naValue.
aLat | the latitude of the first specified point, in radians. |
aLon | the longitude of the first specified point, in radians. |
bLat | the latitude of the second specified point, in radians. |
bLon | the longitude of the second specified point, in radians. |
distance | from point A to point B, in radians. |
azimuth | from point A to point B, in radians. |
naValue | value to return if result is invalid, in radians. |
void slbm::SlbmInterface::getFractionActive | ( | double & | fractionActive | ) | [inline] |
Retrieve the fraction of the path length of the current GreatCircle object that is within the currently defined active region.
void slbm::SlbmInterface::getGreatCircleData | ( | string & | phase, |
double & | actual_path_increment, | ||
double | sourceDepth[NLAYERS], | ||
double | sourceVelocity[NLAYERS], | ||
double | receiverDepth[NLAYERS], | ||
double | receiverVelocity[NLAYERS], | ||
double | headWaveVelocity[], | ||
double | gradient[], | ||
int | neighbors[][nCoefficients], | ||
double | coefficients[][nCoefficients], | ||
int & | npoints | ||
) | [inline] |
Retrieve the data required for input to the travel time calculation, for the current GreatCircle object.
phase | the phase supported by the current GreatCircle. Will be one of Pn, Sn, Pg, Lg. |
actual_path_increment | the actual horizontal separation of the LayerProfile objects along the head wave interface, in radians. |
sourceDepth | the depths of all the model interfaces below the source, in km. |
sourceVelocity | the P or S velocity of each interval below the source, in km/sec. |
receiverDepth | the depths of all the model interfaces below the receiver, in km. |
receiverVelocity | the P or S velocity of each interval below the receiver, in km/sec. |
headWaveVelocity | the P or S velocity at the center of each horizontal segment between the source and the receiver, in km/sec. The first horizontal segment starts at the source, the last horizontal segment ends at the receiver, and each one is of size actual_path_increment. The head wave velocities are interpolated at the center of each of these horizontal segments, just below the head wave interface. |
gradient | the P or S velocity gradient in the mantle at the center of each horizontal segment of the head wave, in 1/sec. For Pg and Lg, the values will be SLBMGlobals::NA_VALUE. |
neighbors | the nodeIds of the neighboring grid nodes used to derive the interpolated data at each head wave profile. |
coefficients | the interpolation coefficients applied to each element of neighbors |
npoints | the number of horizontal increments sampled along the head wave interface. To discover this number before calling this method call getNHeadWavePoints(). |
void slbm::SlbmInterface::getGreatCircleLocations | ( | double | lat[], |
double | lon[], | ||
double | depth[], | ||
int & | npoints | ||
) | [inline] |
Retrieve the latitudes, longitudes and depths of all the profile positions along the headwave interface. Profile positions are located at the center of each segment of the head wave interface between the source and receiver. The first position is located actual_path_increment/2 radians from the source, the last profile position is located actual_path_increment/2 radians from the receiver, and the others are spaced actual_path_increment radians apart.
lat | the latitude at the center of each headwave segment, in radians. |
lon | the longitude at the center of each headwave segment, in radians. |
depth | the depth of the headwave interface at the center of each headwave segment, in km. |
npoints | the number of horizontal increments sampled along the head wave interface. |
GreatCircle * slbm::SlbmInterface::getGreatCircleObject | ( | ) | [inline] |
Retrieve a pointer to the GreatCircle object. This is not the recommended method for interacting with GreatCircle objects but will allow inquisitive applications direct access to all the public methods of GreatCircle and all the various objects accessible through it (CrustalProfile, LayerProfile, etc.). This method will not be available through any interfaces other than the c++ interface.
void slbm::SlbmInterface::getGreatCirclePoints | ( | const double & | aLat, |
const double & | aLon, | ||
const double & | bLat, | ||
const double & | bLon, | ||
const int & | npoints, | ||
double | latitude[], | ||
double | longitude[] | ||
) | [inline] |
Retrieve an array of lat, lon points along a great circle path between two specified points. The great circle path between a and b is divided into npoints-1 equal size cells and the computed points are located at the boundaries of those cells. First point will coincide with point a and last point with point b.
aLat | the latitude of the first specified point, in radians. |
aLon | the longitude of the first specified point, in radians. |
bLat | the latitude of the second specified point, in radians. |
bLon | the longitude of the second specified point, in radians. |
npoints | the desired number of points along the great circle, in radians. |
latitude | the latitudes of the points along the great circle, in radians. |
longitude | the longitudes of the points along the great circle, in radians. |
void slbm::SlbmInterface::getGreatCirclePointsOnCenters | ( | const double & | aLat, |
const double & | aLon, | ||
const double & | bLat, | ||
const double & | bLon, | ||
const int & | npoints, | ||
double | latitude[], | ||
double | longitude[] | ||
) | [inline] |
Retrieve an array of lat, lon points along a great circle path between two specified points. The great circle path between a and b is divided into npoints equal size cells and the computed points are located at the centers of those cells.
aLat | the latitude of the first specified point, in radians. |
aLon | the longitude of the first specified point, in radians. |
bLat | the latitude of the second specified point, in radians. |
bLon | the longitude of the second specified point, in radians. |
npoints | the desired number of points along the great circle |
latitude | the latitudes of the points along the great circle, in radians. |
longitude | the longitudes of the points along the great circle, in radians. |
void slbm::SlbmInterface::getGridData | ( | const int & | nodeId, |
double & | latitude, | ||
double & | longitude, | ||
double | depth[NLAYERS], | ||
double | pvelocity[NLAYERS], | ||
double | svelocity[NLAYERS], | ||
double | gradient[2] | ||
) |
Retrieve the interface depth, velocity and gradient information associated with a specified node in the velocity grid.
nodeId | the node ID of the grid point in the model (zero based index). |
latitude | the latitude of the grid node in radians. |
longitude | the longitude of the grid node in radians. |
depth | the depths of all the model interfaces, in km. |
pvelocity | an array containing the P velocities of all the intervals at the specified grid node, in km/sec. |
svelocity | an array containing the S velocities of all the intervals at the specified grid node, in km/sec. |
gradient | a 2-element array containing the P and S velocity gradients in the mantle, in 1/sec. |
int slbm::SlbmInterface::getGridNodeId | ( | int | activeNodeId | ) | [inline] |
Retrieve the grid node ID that corresponds to a specified active node ID.
Grid* slbm::SlbmInterface::getGridObject | ( | ) | [inline] |
Retrieve a pointer to the Grid object. This method will not be available through any interfaces other than the c++ interface.
void slbm::SlbmInterface::getHeadwaveDistance | ( | double & | dist | ) | [inline] |
Retrieve the angular distance traveled by the ray below the headwave interface, in radians. This is the total distance minus the horizontal offsets below the source and receiver. getSourceDistance() + getReceiverDistance() + getHeadwaveDistance() = getDistance().
dist | the angular distance traveled by the ray below the headwave interface, in radians. |
void slbm::SlbmInterface::getHeadwaveDistanceKm | ( | double & | dist | ) | [inline] |
Retrieve horizontal distance traveled by the ray below the headwave interface, in km. This is the sum of actual_path_increment(i) * R(i) where actual_path_increment(i) is the angular distance traveled by the ray in each angular distance increment along the head wave interface, and R(i) is the radius of the head wave interface in that same horizontal increment.
dist | the horizontal distance traveled by the ray below the headwave interface, in km. |
void slbm::SlbmInterface::getInterpolatedPoint | ( | const double & | lat, |
const double & | lon, | ||
int | nodeId[nCoefficients], | ||
double | coefficients[nCoefficients], | ||
double | depth[NLAYERS], | ||
double | pvelocity[NLAYERS], | ||
double | svelocity[NLAYERS], | ||
double & | pgradient, | ||
double & | sgradient | ||
) | [inline] |
Retrieve interpolated data from the earth model at a single specified latitude, longitude.
lat | the latitude where information is to be interpolated, in radians. |
lon | the longitude where information is to be interpolated, in radians. |
nodeId | the nodeIds of the grid nodes that were involved in the interpolation. |
coefficients | the interpolation coefficients that were applied to the information from the neighboring grid nodes. |
depth | the depths of the tops of the interfaces in the Earth model, in km. There will be one of these for each layer of the model. |
pvelocity | the P velocities of each layer of the model, in km/sec. |
svelocity | the S velocities of each layer of the model, in km/sec. |
pgradient | the mantle P velocity gradient, in 1/sec. |
sgradient | the mantle S velocity gradient, in 1/sec. |
void slbm::SlbmInterface::getInterpolatedTransect | ( | double | lat[], |
double | lon[], | ||
const int & | nLatLon, | ||
int | nodeId[][nCoefficients], | ||
double | coefficients[][nCoefficients], | ||
double | depth[][NLAYERS], | ||
double | pvelocity[][NLAYERS], | ||
double | svelocity[][NLAYERS], | ||
double | pgradient[NLAYERS], | ||
double | sgradient[NLAYERS], | ||
int & | nInvalid | ||
) | [inline] |
Retrieve interpolated data from the earth model along a transect defined by equal sized, 1 dimensional arrays of latitude and longitude.
lat | the latitudes along the transect, in radians. |
lon | the longitudes along the transect, in radians. |
nLatLon | the number of interpolated points along the transect. |
nodeId | the nodeIds of the grid nodes that were involved in the interpolations. There will be SLBMGlobals::nCoefficients of these. |
coefficients | the interpolation coefficients that were applied to the information from the neighboring grid nodes. There will be SLBMGlobals::nCoefficients of these. |
depth | the depths of the tops of the interfaces in the Earth model, in km. |
pvelocity | the P velocities of each layer of the model, in km/sec. |
svelocity | the S velocities of each layer of the model, in km/sec. |
pgradient | the mantle P velocity gradient, in 1/sec. |
sgradient | the mantle S velocity gradient, in 1/sec. |
nInvalid | the number of points that were out of model range. For any points outside of the model range, nodeIds are all -1 and all other returned arrays are populated with SLBMGlobals::NA_VALUE. |
static void slbm::SlbmInterface::getMaxDepth | ( | double & | maxDepth | ) | [static] |
Retrieve the current value for the maximum source depth, in km.
static void slbm::SlbmInterface::getMaxDistance | ( | double & | maxDistance | ) | [static] |
Retrieve the current value for the maximum source-receiver separation, in radians.
const string & slbm::SlbmInterface::getModelPath | ( | ) | const [inline] |
A string containing the path to the SLBM model used for locating phase-specific model error data files.
int slbm::SlbmInterface::getNActiveNodes | ( | ) | [inline] |
Retrieve the number of active nodes in the Grid.
void slbm::SlbmInterface::getNGridNodes | ( | int & | n | ) | [inline] |
Retrieve the number of Grid nodes in the Earth model.
void slbm::SlbmInterface::getNHeadWavePoints | ( | int & | nHeadWavePoints | ) | [inline] |
Retrieve the number of LayerProfile objects positioned along the head wave interface. It is useful to call this method before calling getGreatCircleData() since the value returned by this method will be the number of elements that will be populated in parameters headWaveVelocity[], neighbors[] and coefficients[].
void slbm::SlbmInterface::getNodeAzimuth | ( | const int & | node1, |
const int & | node2, | ||
double & | azimuth | ||
) | [inline] |
Retrieve the azimuth from grid node1 to grid node2, radians.
void slbm::SlbmInterface::getNodeHitCount | ( | const int & | nodeId, |
int & | hitCount | ||
) | [inline] |
Retrieve the number of times that the specified node has been 'touched' by a GreatCircle object. The hit count of each node is initialized in the loadVelocityModel() method. Every time the getWeights() method is called for a particular GreatCircle object, all the nodeIds that contribute any weight to that GreatCircle object have their hit count incremented by one.
void slbm::SlbmInterface::getNodeNeighborInfo | ( | const int & | nid, |
int | neighbors[], | ||
double | distance[], | ||
double | azimuth[], | ||
int & | nNeighbors | ||
) | [inline] |
Retrieve the node IDs of the nodes that surround the specified node.
The caller must supply int array neighbors which is dimensioned large enough to hold the maximum number of neighbors that a node can have, which is 8. The actual number of neighbors is returned in nNeighbors.
void slbm::SlbmInterface::getNodeNeighbors | ( | const int & | nid, |
int | neighbors[], | ||
int & | nNeighbors | ||
) | [inline] |
Retrieve the node IDs of the nodes that surround the specified node.
The caller must supply int array neighbors which is dimensioned large enough to hold the maximum number of neighbors that a node can have, which is 8. The actual number of neighbors is returned in nNeighbors.
void slbm::SlbmInterface::getNodeNeighbors | ( | const int & | nid, |
vector< int > & | neighbors | ||
) | [inline] |
Retrieve the node IDs of the nodes that surround the specified node.
void slbm::SlbmInterface::getNodeSeparation | ( | const int & | node1, |
const int & | node2, | ||
double & | distance | ||
) | [inline] |
Retrieve the angular separation of two grid nodes, in radians.
void slbm::SlbmInterface::getPathIncrement | ( | double & | pathIncrement | ) |
Retrieve the current value of the spacing of great circle nodes along the head wave interface, in radians. The actual spacing will be reduced from the requested value in order that an integral number of equally spaced LayerProfile objects will exactly span the source-receiver separation. The default value is 0.1 degrees.
the | current value of the spacing of great circle nodes along the head wave interface, in radians. |
void slbm::SlbmInterface::getPgLgComponents | ( | double & | tTotal, |
double & | tTaup, | ||
double & | tHeadwave, | ||
double & | pTaup, | ||
double & | pHeadwave, | ||
double & | trTaup, | ||
double & | trHeadwave | ||
) | [inline] |
Retrieve information about Pg/Lg travel time calculations. This method only returns useful information when the phase is Pg or Lg. For Pn and Sn, all information is returned as SLBMGlobals::NA_VALUE.
tTotal | is the total travel time in seconds. It will be exactly equal to the lesser of tTaup or tHeadwave, except that if tTaup is equal to SLBMGlobals::NA_VALUE, then tTotal will equal tHeadwave. |
tTaup | is the taup travel time in seconds. If this value is equal to SLBMGlobals::NA_VALUE, it means that the taup calculation failed for some reason (shadow zones, etc.). |
tHeadwave | is the headwave travel time in secods |
pTaup | TauP ray parameter. |
pHeadwave | headwave ray parameter. |
trTaup | is the radius at which the taup ray turned, in km. |
trHeadwave | is the radius at which the headwave ray turned, in km. |
string slbm::SlbmInterface::getPhase | ( | ) | [inline] |
Retrieve the phase specified in last call to createGreatCircle().
void slbm::SlbmInterface::getPiercePointReceiver | ( | double & | lat, |
double & | lon, | ||
double & | depth | ||
) | [inline] |
Retrieve the latitude and longitude of the moho pierce point below the receiver, in radians. For Pg, Lg an exception is thrown.
lat | the latitude of the receiver pierce point, in radians. |
lon | the longitude of the receiver pierce point, in radians. |
depth | moho depth in km below sea level |
void slbm::SlbmInterface::getPiercePointSource | ( | double & | lat, |
double & | lon, | ||
double & | depth | ||
) | [inline] |
Retrieve the latitude and longitude of the moho pierce point below the source, in radians. For Pg, Lg and sources in the mantle an exception is thrown.
lat | the latitude of the source pierce point, in radians. |
lon | the longitude of the source pierce point, in radians. |
depth | moho depth in km below sea level |
void slbm::SlbmInterface::getReceiverDistance | ( | double & | dist | ) | [inline] |
Retrieve horizontal offset below the receiver, in radians. This is the angular distance between the location of the receiver and the receiver pierce point where the ray impinged on the headwave interface.
dist | the horizontal offset below the receiver, in radians. |
void slbm::SlbmInterface::getSlowness | ( | double & | slowness | ) | [inline] |
Retrieve the horizontal slowness, in seconds/radian.
slowness | the derivative of travel time wrt to source latitude. |
void slbm::SlbmInterface::getSlownessUncertainty | ( | const int & | phase, |
const double & | distance, | ||
double & | uncert | ||
) | [inline] |
Retrieve the slowness uncertainty in sec/radian for specified phase, distance.
phase | Pn, Sn, Pg or Lg |
distance | source-receiver separation in radians. |
uncert | returns the uncertainty in sec/radian |
void slbm::SlbmInterface::getSlownessUncertainty | ( | double & | slownessUncertainty | ) | [inline] |
Retrieve uncertainty of the horizontal slowness, in seconds/radian, using the phase and distance specified in last call to getGreatCircle().
slownessUncertainty | uncertainty of the horizontal slowness, in seconds/radian. |
void slbm::SlbmInterface::getSourceDistance | ( | double & | dist | ) | [inline] |
Retrieve horizontal offset below the source, in radians. This is the angular distance between the location of the source and the source pierce point where the ray impinged on the headwave interface.
dist | the horizontal offset below the source, in radians. |
void slbm::SlbmInterface::getTessId | ( | string & | tessId | ) | [inline] |
Retrieve the tessellation ID of the model currently in memory.
void slbm::SlbmInterface::getTravelTime | ( | double & | travelTime | ) | [inline] |
Retrieve the total travel time for the GreatCircle, in seconds.
travelTime | the total travel time in seconds is returned in travelTime. If the GreatCircle is invalid, travelTime will equal SLBMGlobals::NA_VALUE. |
void slbm::SlbmInterface::getTravelTimeComponents | ( | double & | tTotal, |
double & | tSource, | ||
double & | tReceiver, | ||
double & | tHeadwave, | ||
double & | tGradient | ||
) | [inline] |
Retrieve the total travel time and the 4 components that contribute to it for the current GreatCircle. If the greatCircle is invalid, tTotal and all the components will equal SLBMGlobals::NA_VALUE.
tTotal | the total travel time, in seconds. |
tSource | the crustal travel time below the source, in seconds. |
tReceiver | the crustal travel time below the receiver, in seconds. |
tHeadwave | the head wave travel time, in seconds. |
tGradient | the Zhao gradient correction term, in seconds. For GreatCircle objects that support Pg and Lg, this is always 0. |
void slbm::SlbmInterface::getTravelTimeUncertainty | ( | const int & | phase, |
const double & | distance, | ||
double & | uncert | ||
) | [inline] |
Retrieve the travel time uncertainty in sec for specified phase, distance.
phase | Pn, Sn, Pg or Lg |
distance | source-receiver separation in radians. |
uncert | returns the uncertainty in sec |
void slbm::SlbmInterface::getTravelTimeUncertainty | ( | double & | travelTimeUncertainty | ) | [inline] |
Retrieve travel time uncertainty in sec using the phase and distance specified in last call to getGreatCircle().
travelTimeUncertainty | uncertainty of the travel time in seconds. |
string slbm::SlbmInterface::getVersion | ( | ) | [inline] |
Retrieve the SLBM Version number.
void slbm::SlbmInterface::getWeights | ( | int | nodeId[], |
double | weight[], | ||
int & | nWeights | ||
) | [inline] |
Retrieve the weight assigned to each grid node that was touched by the GreatCircle.
A map which associates an instance of a GridProfile object with a double weight is initialized. Then every LayerProfile on the head wave interface between the source and receiver is visited and the angular distance, d, that the ray traveled in the horizontal segment is retrieved. If d > 0, then the neighboring GridProfile objects that contributed to the interpolated value of the LayerProfile are visited. The product of d * R * C is added to the weight associated with that GridProfile object, where R is the radius of the head wave interface for the LayerProfile object being evaluated, and C is the interpolation coefficient for the GridProfile - LayerProfile pair under consideration. Then, all the GridProfile objects in the map are visited, the grid node IDs extracted into int array nodeId, and the weight extracted into double array weight.
Note: Only grid nodes touched by this GreatCircle are included in the output. Each grid node is included only once, even though more than one LayerProfile object may have contributed some weight to it. The sum of all the weights will equal the horizontal distance traveled by the ray along the head wave interface, from the source pierce point to the receiver pierce point, in km.
nodeId | the node IDs of all the grid nodes touched by the current GreatCircle. |
weight | the weights of all the grid nodes touched by the current GreatCircle. Calling application must dimension this array large enough to handle any possible size. |
nWeights | the number of elements in nodeId and weight. Calling application must dimension this array large enough to handle any possible size. |
void slbm::SlbmInterface::getWeights | ( | vector< int > & | nodeId, |
vector< double > & | weight | ||
) | [inline] |
Retrieve the weight assigned to each grid node that was touched by the GreatCircle.
A map which associates an instance of a GridProfile object with a double weight is initialized. Then every LayerProfile on the head wave interface between the source and receiver is visited and the angular distance, d, that the ray traveled in the horizontal segment is retrieved. If d > 0, then the neighboring GridProfile objects that contributed to the interpolated value of the LayerProfile are visited. The product of d * R * C is added to the weight associated with that GridProfile object, where R is the radius of the head wave interface for the LayerProfile object being evaluated, and C is the interpolation coefficient for the GridProfile - LayerProfile pair under consideration. Then, all the GridProfile objects in the map are visited, the grid node IDs extracted into int array nodeId, and the weight extracted into double array weight.
Note: Only grid nodes touched by this GreatCircle are included in the output. Each grid node is included only once, even though more than one LayerProfile object may have contributed some weight to it. The sum of all the weights will equal the horizontal distance traveled by the ray along the head wave interface, from the source pierce point to the receiver pierce point, in km.
nodeId | the active node IDs of all the grid nodes touched by the current GreatCircle. These are active node ids, not grid node ids. If a grid node has weight but is not an active node, the nodeId will be -1. |
weight | the weights of all the grid nodes touched by the current GreatCircle. |
void slbm::SlbmInterface::getWeightsReceiver | ( | int | nodeids[], |
double | weights[] | ||
) | [inline] |
Retrieve the node IDs and the interpolation coefficients for the receiver CrustalProfile. There will be SLBMGlobals::nCoefficients of each. The sum of the weights will equal 1.
void slbm::SlbmInterface::getWeightsSource | ( | int | nodeids[], |
double | weights[] | ||
) | [inline] |
Retrieve the node IDs and the interpolation coefficients for the source CrustalProfile. There will be SLBMGlobals::nCoefficients of each. The sum of the weights will equal 1.
void slbm::SlbmInterface::getZhaoParameters | ( | double & | Vm, |
double & | Gm, | ||
double & | H, | ||
double & | C, | ||
double & | Cm, | ||
int & | udSign | ||
) | [inline] |
Retrieve some of the parameters that contribute to the calculation of of total travel time using the Zhao algorithm. This method only returns meaningful results for phases Pn and Sn. For Pg and Lg, all the parameters of type double are returned with values SLBMGlobals::NA_VALUE and udSign is returned with value of -999.
Vm | the velocity at the top of the mantle averaged along the Moho between the source and receiver pierce points. |
Gm | the velocity gradient at the top of the mantle averaged along the Moho between the source and receiver pierce points. |
H | the turning depth of the ray relative to the Moho |
C | a constant whose product with V0 gives the mantle velocity gradient for a flat Earth. V0 is the velocity of the top of the mantle averaged over the whole model. |
Cm | a constant whose product with Vm gives the mantle velocity gradient for a flat Earth. |
udSign | a value of 0 indicates the source is in the crust. +1 indicates the ray leaves a mantle source in the downgoing direction. -1 indicates the ray leaves a mantle source in an upgoing direction. |
void slbm::SlbmInterface::initializeActiveNodes | ( | const double & | latmin, |
const double & | lonmin, | ||
const double & | latmax, | ||
const double & | lonmax | ||
) | [inline] |
Specify the latitude and longitude range for active nodes. Active nodes are defined as follows: for each triangle in the tessellation, if any of the 3 nodes that define the triangle is within the latitude longitude range specified by this method, then all 3 nodes are defined to be active nodes. Lats and lons must be specified in radians.
bool slbm::SlbmInterface::isValid | ( | ) | [inline] |
Returns true if the current GreatCirlce object has been instantiated and is ready to be interrogated.
void slbm::SlbmInterface::loadVelocityModel | ( | const string & | modelFileName | ) |
Load the velocity model into memory.
modelFileName | the full or relative path plus file name of the file containing the earth model. |
void slbm::SlbmInterface::loadVelocityModelBinary | ( | const string & | modelDirectory | ) |
Load the velocity model into memory from files located in the specified directory. Slbm expects the specified modelDirectory to exist and to contain two binary files: geostacks and connectivity. It also expects there to exist a directory called tess at the same diretory level as the specified directory and for that directory to contain the binary file that specifies the tessellation with which the model data is to be associated. For example, assume the following directory structure:
/SLBM_Root
/models
/tess
450fe54afbf70f1a2f62c30d249c5643
/unified_crust20
connectivity
geostacks
/unified_iasp
connectivity
geostacks
To access model unified_crust20, you would specify modelDirectory = SLBM_Root/models/unified_crust20. Note that the name of the tessellation file is embedded in the unified_crust20/connectivity file and slbm will expect to find that file by appending "/../tess/{filename)" onto the end of the specified modelDirectory parameter.
modelDirectory | the path to the model directory |
void slbm::SlbmInterface::loadVelocityModelBinary | ( | util::DataBuffer & | buffer | ) | [protected] |
Load the velocity model into memory from an FDB database configured DataBuffer. Slbm uses the same DataBuffer read statements as used by the file based function of the same name. See loadVelocityModelBinary(const string& modelDirectory);
void slbm::SlbmInterface::movePoint | ( | const double & | aLat, |
const double & | aLon, | ||
const double & | distance, | ||
const double & | azimuth, | ||
double & | bLat, | ||
double & | bLon | ||
) | [inline] |
Find point B that is the specified distance and azimuth from point A. All quantities are in radians.
void slbm::SlbmInterface::saveVelocityModel | ( | const string & | modelFileName | ) |
Save the velocity model currently in memory to the specified file. Attempting to save the model to the same file from which the model was originally read will result in an exception. If the file already exists, it will be overwritten without warning or backup.
modelFileName | the full or relative path plus file name of the file to which the earth model is to be written. |
void slbm::SlbmInterface::saveVelocityModelBinary | ( | ) |
Write the model currently in memory out to files. The model is written to a directory which was previously specified with a call to specifyOutputDirectory().
void slbm::SlbmInterface::saveVelocityModelBinary | ( | util::DataBuffer & | buffer | ) | [protected] |
Write the model currently in memory out to the input DataBuffer.
void slbm::SlbmInterface::setActiveNodeData | ( | const int & | nodeId, |
double | depths[NLAYERS], | ||
double | pvelocity[NLAYERS], | ||
double | svelocity[NLAYERS], | ||
double | gradient[2] | ||
) |
Modify the depth, velocity and gradient information associated with a specified active node in the Grid.
nodeId | the node number of the grid point in the model. (zero based index). |
depths | an array containing the depths of the tops of the layers, in km |
pvelocity | an array containing the P velocities of all the intervals at the specified grid node, in km/sec. |
svelocity | an array containing the S velocities of all the intervals at the specified grid node, in km/sec. |
gradient | a 2-element array containing the P and S velocity gradients in the mantle, in 1/sec. |
void slbm::SlbmInterface::setAverageMantleVelocity | ( | const int & | type, |
const double & | velocity | ||
) | [inline] |
Set the average P or S wave mantle velocity that is specified in the model input file. This value is used in the calculation of the Zhao c parameter.
type | specify either SLBMGlobals::PWAVE or SLBMGlobals::SWAVE. |
velocity | the P or S wave velocity that is to be set, in km/sec. This value will be stored in the model file, if the model file is written to file by a call to saveVelocityModel() subsequent to a call to this method. |
static void slbm::SlbmInterface::setCHMax | ( | const double & | chMax | ) | [static] |
Set the value of chMax. c is the zhao c parameter and h is the turning depth of the ray below the moho. Zhao method only valid for c*h << 1. When c*h > chMax, then slbm will throw an exception. This call modifies global parameter SLBMGlobals::CH_MAX
void slbm::SlbmInterface::setDelDepth | ( | const double & | del_depth | ) |
Change the value of step change in depth used to compute depth derivatives (km)
void slbm::SlbmInterface::setDelDistance | ( | const double & | del_distance | ) |
Change the value of step change in distance used to compute horizontal derivatives (radians)
void slbm::SlbmInterface::setGridData | ( | const int & | nodeId, |
double | depths[NLAYERS], | ||
double | pvelocity[NLAYERS], | ||
double | svelocity[NLAYERS], | ||
double | gradient[2] | ||
) |
Modify the velocity and gradient information associated with a specified node in the Grid.
nodeId | the node number of the grid point in the model. (zero based index). |
depths | an array containing the depths of the tops of the layers, in km |
pvelocity | an array containing the P velocities of all the intervals at the specified grid node, in km/sec. |
svelocity | an array containing the S velocities of all the intervals at the specified grid node, in km/sec. |
gradient | a 2-element array containing the P and S velocity gradients in the mantle, in 1/sec. |
static void slbm::SlbmInterface::setMaxDepth | ( | const double & | maxDepth | ) | [static] |
Set the maximum source depth for Pn/Sn phase, in km. Source depths greater than the specified value will result in an exception being thrown in createGreatCircle(). Default value is 9999 km.
static void slbm::SlbmInterface::setMaxDistance | ( | const double & | maxDistance | ) | [static] |
Set the maximum source-receiver separation for Pn/Sn phase, in radians. Source-receiver separations greater than the specified value will result in an exception being thrown in createGreatCircle(). Default value is PI radians.
void slbm::SlbmInterface::setPathIncrement | ( | const double & | pathIncrement | ) |
Set the desired spacing of great circle nodes along the head wave interface, in radians. The actual spacing will be reduced from the requested value in order that an integral number of equally spaced LayerProfile objects will exactly span the source-receiver separation. Defaults to 0.1 degrees if not specified.
the | desired spacing of great circle nodes along the head wave interface, in radians. |
void slbm::SlbmInterface::specifyOutputDirectory | ( | const string & | directoryName | ) |
Specify the directory where the model that is currently in memory should be written to the next time that saveVelocityModelBinary() is called. A call to specifyOutputDirectory() will check to make sure that the specified directory exists. If it does not exist, slbm will attempt to create it. Then slbm will write a very small file called deleteme.buf to the specified directory and then delete that file. All of this is done to ensure that when the model is actually written to the specified directory, the probability of error is minimized. Call method saveVelocityModelBinary() to actually write the model to the specified directory.
Note that specified directory name is associated with the Grid object currently in memory. If the current Grid object is deleted and a different Grid object loaded, the directoryName will be reset to "".
string slbm::SlbmInterface::toString | ( | const int & | verbosity | ) | [inline] |
Returns a human-readable string representation of the GreatCircle object.
verbosity | specifies the amount of information that is to be included in the return string. Each verbosity level includes all information in preceeding verbosity levels.
|
double slbm::SlbmInterface::CH_MAX [static, protected] |
c is the zhao c parameter and h is the turning depth of the ray below the moho. Zhao method only valid for c*h << 1. When c*h > ch_max, then slbm will throw an exception.
GreatCircle* slbm::SlbmInterface::greatCircle [protected] |
The most recently requested GreatCircle object.
Grid* slbm::SlbmInterface::grid [protected] |
The Grid object that stores the velocity model.
string slbm::SlbmInterface::modelPath [protected] |
A string containing the path to the SLBM model used for locating phase-specific model error data files.
Uncertainty* slbm::SlbmInterface::uncertainty[3][4] [protected] |
The most recently requested travel time Uncertainty object.
bool slbm::SlbmInterface::valid [protected] |
true if the current GreatCirlce object has been instantiated and is ready to be interrogated.