SLBM: slbm::GreatCircle Class Reference

SLBM 3.0 Regional Seismic Travel Time

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
slbm::GreatCircle Class Referenceabstract

The GreatCircle class manages information related to a great circle path between two Locations on the Earth, including the ability to compute the total travel time from a seismic source to a receiver. More...

`#include <GreatCircle.h>`

Inherited by slbm::GreatCircle_Xg, and slbm::GreatCircle_Xn.

## Public Member Functions
| GreatCircle (const int &_phase, Grid &_grid, const double &latSource, const double &lonSource, const double &depthSource, const double &latReceiver, const double &lonReceiver, const double &depthReceiver)
| Parameterized constructor. More...
virtual | ~GreatCircle ()
| Destructor. Deletes LayerProfile objects associated with this GreatCircle object. More...
| GreatCircle (const GreatCircle &other)
| Copy constructor. More...
GreatCircle & | operator= (const GreatCircle &other)
| Equal operator. More...
Grid & | getGrid ()
| Retrieve a reference to the Grid object that this GreatCircle is associated with. More...
int | getPhase ()
| Retrieve the phase that this GreatCircle supports. Will be one of SLBMGlobals::Pn, SLBMGlobals::Sn, SLBMGlobals::Pg, SLBMGlobals::Lg. More...
const int & | getHeadWaveInterface ()
| Retrieve the index of the head wave interface (SLBMGlobals::MANTLE for Pn, Sn; SLBMGlobals::MIDDLE_CRUST for Pg, Lg). More...
string | getPhaseString ()
| Retrieve a string representation fo the the phase that this GreatCircle supports. Will be one of 'Pn', 'Sn', 'Pg', 'Lg'. More...
CrustalProfile * | getSourceProfile ()
| Retrieve a pointer to the source CrustalProfile. More...
CrustalProfile * | getReceiverProfile ()
| Retrieve a pointer to the receiver CrustalProfile. More...
double | getSourceRayParameter ()
double | getReceiverRayParameter ()
LayerProfile * | getProfile (const int &i)
| Retrieve a pointer to one of the LayerProfile objects that comprise the head wave portion of the ray path. More...
int | getNProfiles ()
| Retrieve the number of LayerProfile object positioned along the head wave interface. More...
void | getLayerProfileLocation (const int &i, Location &loc)
| Retrieve the Location of a LayerProfile. More...
double | getDistance ()
| Retrieve source-receiver separation, in radians. More...
double | getEsaz ()
| Retrieve source-receiver azimuth, in radians. More...
double | getSourceDistance ()
| Retrieve horizontal offset below the source, in radians. More...
double | getReceiverDistance ()
| Retrieve horizontal offset below the receiver, in radians. More...
double | getHeadwaveDistance ()
| Retrieve angular distance traveled by the ray below the headwave interface, in radians. More...
double | getHeadwaveDistanceKm ()
| Retrieve horizontal distance traveled by the ray below the headwave interface, in radians. More...
double | getActualPathIncrement ()
| Retrieve horizontal separation of LayerProfiles, in radians. More...
double | getTravelTime ()
| Retrieve the travel time from the source to the receiver. More...
void | getTravelTime (double &tTotal, double &tSource, double &tReceiver, double &tMantle, double &tGradient)
| Retrieve the total travel time and the 4 components that contribute to it. More...
virtual string | toString (const int &verbosity)=0
| Retrieve a formatted string providing a detailed description of the information managed by this GreatCircle object. More...
void | getData (int &phase, double &actual_path_increment, double sourceDepth[NLAYERS], double sourceVelocity[NLAYERS], double receiverDepth[NLAYERS], double receiverVelocity[NLAYERS], int &npoints, double headWaveVelocity[], double gradient[])
| Retrieve information about the great circle path including the interface depths at source and receiver, the velocity profiles at the source and receiver, and mantle velocity and velocity gradient at points along the great circle path from source pierce point to receiver pierce point. More...
void | getData (int &phase, double &actual_path_increment, vector< double > &sourceDepth, vector< double > &sourceVelocity, vector< double > &receiverDepth, vector< double > &receiverVelocity, vector< double > &headWaveVelocity, vector< double > &gradient)
| Retrieve information about the great circle path including the interface depths at source and receiver, the velocity profiles at the source and receiver, and mantle velocity and velocity gradient at points along the great circle path from source pierce point to receiver pierce point. More...
void | getNodeInfo (int **neighbors, double **coefficients, const int &maxpoints, const int &maxnodes, int &npoints, int *nnodes)
| Retrieve information about the interpolated points along the headwave path, including the number of points, the indexes of the grid nodes that contributed to interpolation of values at the points, and the interpolation coefficients used to calculate values at the points. More...
void | getNodeInfo (vector< vector< int > > &neighbors, vector< vector< double > > &coefficients)
| Retrieve information about the interpolated points along the headwave path, including the number of points, the indexes of the grid nodes that contributed to interpolation of values at the points, and the interpolation coefficients used to calculate values at the points. More...
void | getGreatCircleLocation (const double &distance, Location &loc)
| Retrieve a location object that is located on the great circle at specified distance from source. More...
void | getWeights (vector< int > &nodeids, vector< double > &weights)
| Retrieve the weight assigned to each grid node that was touched by the GreatCircle. More...
void | getWeights (int nodeids[], double weights[], int &nweights)
| Retrieve the weight assigned to each grid node that was touched by the GreatCircle. More...
double | getFractionActive ()
double | getRayParameter ()
double | getTurningRadius ()
virtual void | getZhaoParameters (double &Vm, double &Gm, double &H, double &C, double &Cm, int &udSign)=0
virtual void | getPgLgComponents (double &tT, double &tTaup, double &tHeadwave, double &pTaup, double &pHeadwave, double &trTaup, double &trHeadwave)
virtual size_t | memSize ()
void | get_dtt_ddist (double &dtt_ddist)
| Retrieve the derivative of travel time wrt to source-receiver separation, in seconds/radian. More...
void | get_dtt_dlat (double &dtt_dlat)
| Retrieve the derivative of travel time wrt to source latitude, in seconds/radian. More...
void | get_dtt_dlon (double &dtt_dlon)
| Retrieve the derivative of travel time wrt to source longitude, in seconds/radian. More...
void | get_dtt_ddepth (double &dtt_ddepth)
| Retrieve the derivative of travel time wrt to source depth, in seconds/km. More...
void | setNAValues ()

## Static Public Member Functions
static int | getClassCount ()
static void | setDelDistance (const double &del_distance)
static double | getDelDistance ()
static void | setDelDepth (const double &del_depth)
static double | getDelDepth ()
static void | setPathIncrement (const double &path_increment)
static double | getPathIncrement ()

## Static Public Attributes
static double | MAX_DISTANCE
| Retrieve the derivative of travel time wrt to source latitude, in seconds/radian. More...
static double | MAX_DEPTH

## Protected Member Functions
double | getActualPathIncrement (const int &i)
| Retrieve the component of the horizontal separation between elements of profiles that actually contribute to the head wave, in radians. More...
virtual void | computeTravelTime ()=0
| Method to compute the travel time from source to receiver, in seconds. More...
double | sqr (const double &x)
double | get_ttHminus ()
| retrieve value of ttHminus. Compute the value if it is NA_VALUE. More...
double | get_ttHplus ()
| retrieve value of ttHplus. Compute the value if it is NA_VALUE. More...
double | get_ttZplus ()
| retrieve value of ttZplus. Compute the value if it is NA_VALUE. More...
double | get_ttZminus ()
| retrieve value of ttZplus. Compute the value if it is NA_VALUE. More...
double | get_ttHZplus ()
| retrieve value of ttHZplus. Compute the value if it is NA_VALUE. More...
double | get_ttEast ()
| retrieve value of ttHminus. Compute the value if it is NA_VALUE. More...
double | get_ttWest ()
| retrieve value of ttHplus. Compute the value if it is NA_VALUE. More...
double | get_ttEastZ ()
| retrieve value of ttHZplus. Compute the value if it is NA_VALUE. More...
double | get_ttNorth ()
| retrieve value of ttHminus. Compute the value if it is NA_VALUE. More...
double | get_ttSouth ()
| retrieve value of ttHplus. Compute the value if it is NA_VALUE. More...
double | get_ttNorthZ ()
| retrieve value of ttHZplus. Compute the value if it is NA_VALUE. More...

## Protected Attributes
Grid & | grid
| A reference to the Grid from which the source and receiver CrustalProfile objects and the LayerProfile objects are interpolated. More...
int | phase
| The phase that this GreatCircle object is set up for (Pn, Sn, Pg or Lg). More...
int | headWaveInterface
| The index of the earth model interface along which head waves propagate. If phase is Pn or Sn, headWaveInterface will equal SLBMGlobals::MANTLE. If phase is Pg or Lg, headWaveInterface will equal SLBMGlobals::MIDDLE_CRUST. More...
CrustalProfile * | source
| The source CrustalProfile object. More...
CrustalProfile * | receiver
| The receiver CrustalProfile object. More...
Location | location
| A Location object used in a variety of places to manipulate Location information. More...
double | vtp [3]
| The vector triple product of the source and receiver Locations. Used to compute Locations along the great circle path from source to receiver. More...
vector< LayerProfile * > | profiles
| The LayerProfile objects which are positioned on the interface along which the head wave propagates. More...
string | solutionMethod
| The method used to calculate travel times. More...
double | tTotal
| The total travel time from source to receiver, in seconds. More...
double | actual_path_increment
| The actual spacing between the elements of profiles, in radians. More...
double | distance
| The horizontal source-receiver separation, in radians. More...
double | esaz
| The source-receiver azimuth, in radians. More...
double | rayParameter
double | xSource
| The horizontal distance from the source Location to the source pierce point, in radians. More...
double | tSource
| The time required for the ray to travel from the source Location to piercePointSource, in seconds. More...
double | xReceiver
| The horizontal distance from the receiver Location to the receiver pierce point, in radians. More...
double | tReceiver
| The time required for the ray to travel from the receiver pierce point to the receiver Location, in seconds. More...
double | xHorizontal
| The horizontal distance traveled by the ray as a head wave, in km. More...
double | tHorizontal
| The time spent by the ray traveling horizontally as a head wave, in seconds. More...
double | tGamma
| The gradient correction term of the total travel time, in sec. More...
double | sourceRayParameter
double | receiverRayParameter
double | turningRadius
int | sourceIndex
| The index of the element in the profiles array corresponding to the horizontal increment in which the source pierce point is located. More...
int | receiverIndex
| The index of the element in the profiles array corresponding to the horizontal increment in which the receiver pierce point is located. More...
double | ttHminus
double | ttHplus
double | ttHZplus
double | ttEast
double | ttWest
double | ttEastZ
double | ttNorth
double | ttSouth
double | ttNorthZ

## Static Protected Attributes
static int | greatCircleClassCount
static double | DEL_DISTANCE
static double | DEL_DEPTH
static double | PATH_INCREMENT
| the desired spacing of great circle nodes along the head wave interface, in radians. More...

## Detailed Description

The GreatCircle class manages information related to a great circle path between two locations on the Earth, including the ability to compute the total travel time from a seismic source to a receiver. The GreatCircle class has derived classes GreatCircle_Xn, which computes travel times for Pn and Sn phases, and GreatCircle_Xg, which computes travel times for Pg and Lg phases. Calling applications should use GreatCircleFactory to retrieve the appropriate type of GreatCircle object.

A GreatCircle maintains two CrustalProfile objects, one for the source and one for the receiver. These CrustalProfile objects contain information about the velocity as a function of depth from the surface down to the Moho. The Location objects owned by the CrustalProfile objects reflect the latitude, longitude and depths of the source and receiver.

A GreatCircle object will generate a number of closely spaced LayerProfile objects which lie along the great circle path between the source and and receiver, at the depth of the interface along which the head wave travels (the Moho for Pn and Sn, the top of the middle crust for Pg and Lg).

The desired spacing of the LayerProfile objects is specified in the GreatCircle constructor, but the actual spacing may be reduced slightly so that an integral number of horizontal increments will exactly span the distance between the source and receiver piercepoints. Actual spacing will be as large as possible but less than or equal to the specified value. The actual spacing can be determined by calling getActualPathIncrement().

The LayerProfile objects used by a GreatCircle are owned by the GreatCircle in that they are created by it on an as-needed basis, they are deleted by it in the GreatCircle destructor, and LayerProfile objects are not shared among different GreatCircle objects. CrustalProfile objects, on the other hand, can be shared among multiple GreatCircle objects. Grid maintains a map that associates waveType/location combinations with pointers to CrustalProfile objects. Upon creation, GreatCircle objects request CrustalProfile objects from Grid. If Grid already has a CrustalProfile object for the specified wave type / location, it provides GreatCircle with the pointer. GreatCircle does not delete CrustalProfile objects in its desctructor. CrustalProfiles are deleted by calling Grid::clearCrustalProfiles() or in the Grid destructor.

## Constructor & Destructor Documentation

slbm::GreatCircle::GreatCircle | ( | const int & | _phase,
|  | Grid & | _grid,
|  | const double & | latSource,
|  | const double & | lonSource,
|  | const double & | depthSource,
|  | const double & | latReceiver,
|  | const double & | lonReceiver,
|  | const double & | depthReceiver
| ) |  |

Parameterized constructor.

Parameters

  _phase | the phase that this GreatCircle object is to support. Must be one of SLBMGlobals::Pn, Sn, Pg, Lg.
  _grid | The Grid from which LayerProfile objects will be extracted.
  latSource | the geographic latitude of the source, in radians
  lonSource | the geographic longitude of the source, in radians
  depthSource | the depth of the source below sea level, in km
  latReceiver | the geographic latitude of the receiver, in radians
  lonReceiver | the geographic longitude of the receiver, in radians
  depthReceiver | the depth of the receiver below sea level, in km

virtual slbm::GreatCircle::~GreatCircle | ( |  | ) |
| virtual

Destructor. Deletes LayerProfile objects associated with this GreatCircle object.

slbm::GreatCircle::GreatCircle | ( | const GreatCircle & | other | ) |

Copy constructor.

## Member Function Documentation

virtual void slbm::GreatCircle::computeTravelTime | ( |  | ) |
| protectedpure virtual

Method to compute the travel time from source to receiver, in seconds.

Implemented in slbm::GreatCircle_Xn, and slbm::GreatCircle_Xg.

void slbm::GreatCircle::get_dtt_ddepth | ( | double & | dtt_ddepth | ) |

Retrieve the derivative of travel time wrt to source depth, in seconds/km.

Parameters

  dtt_ddepth | the derivative of travel time wrt to source depth.

void slbm::GreatCircle::get_dtt_ddist | ( | double & | dtt_ddist | ) |
| inline

Retrieve the derivative of travel time wrt to source-receiver separation, in seconds/radian.

Returns
  the derivative of travel time wrt to source-receiver separation, in seconds/radian.

void slbm::GreatCircle::get_dtt_dlat | ( | double & | dtt_dlat | ) |
| inline

Retrieve the derivative of travel time wrt to source latitude, in seconds/radian.

Parameters

  dtt_dlat | the derivative of travel time wrt to source latitude.

void slbm::GreatCircle::get_dtt_dlon | ( | double & | dtt_dlon | ) |
| inline

Retrieve the derivative of travel time wrt to source longitude, in seconds/radian.

Parameters

  dtt_dlon | the derivative of travel time wrt to source longitude.

double slbm::GreatCircle::get_ttEast | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttEastZ | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttHminus | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttHplus | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttHZplus | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttNorth | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttNorthZ | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttSouth | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttWest | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttZminus | ( |  | ) |
| protected

double slbm::GreatCircle::get_ttZplus | ( |  | ) |
| protected

double slbm::GreatCircle::getActualPathIncrement | ( |  | ) |
| inline

Retrieve horizontal separation of LayerProfiles, in radians.

Returns
  the horizontal separation of the LayerProfiles, in radians.

double slbm::GreatCircle::getActualPathIncrement | ( | const int & | i | ) |
| inlineprotected

Retrieve the component of the horizontal separation between elements of profiles that actually contribute to the head wave, in radians. For horizontal increments of the source-receiver separation that are entirely between the source and source pierce point, or between the receiver pierce point and the receiver, this will return 0. For horizontal increments that lie entirely between the source and receiver pierce points, this will return actual_path_increment. For the horizontal increments that include the source pierce point and/or the receiver pierce point, this will return some fraction of actual_path_increment, reflecting the part of the horizontal increment that was actually traversed by the head wave.

static int slbm::GreatCircle::getClassCount | ( |  | ) |
| static

void slbm::GreatCircle::getData | ( | int & | phase,
|  | double & | actual_path_increment,
|  | double | sourceDepth[NLAYERS],
|  | double | sourceVelocity[NLAYERS],
|  | double | receiverDepth[NLAYERS],
|  | double | receiverVelocity[NLAYERS],
|  | int & | npoints,
|  | double | headWaveVelocity[],
|  | double | gradient[]
| ) |  |

Retrieve information about the great circle path including the interface depths at source and receiver, the velocity profiles at the source and receiver, and mantle velocity and velocity gradient at points along the great circle path from source pierce point to receiver pierce point.

The caller must supply all of the arrays required by this method and retains ownership of those arrays. This method assumes the arrays have been allocated with sufficient memory to hold the requested information and simply populates the supplied arrays.

Parameters

  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 | a double array of length NLAYERS containing the depths of all the model interfaces below the source, in km.
  sourceVelocity | a double array of length NLAYERS containing the P or S velocity of each interval below the source, in km/sec.
  receiverDepth | a double array of length NLAYERS containing the depths of all the model interfaces below the receiver, in km.
  receiverVelocity | a double array of length NLAYERS containing the P or S velocity of each interval below the receiver, in km/sec.
  npoints | the number of points along the headwave path where velocity and gradient values are interpolated.
  headWaveVelocity | a double array of length npoints containing 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 | a double array of length npoints containing 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.

void slbm::GreatCircle::getData | ( | int & | phase,
|  | double & | actual_path_increment,
|  | vector< double > & | sourceDepth,
|  | vector< double > & | sourceVelocity,
|  | vector< double > & | receiverDepth,
|  | vector< double > & | receiverVelocity,
|  | vector< double > & | headWaveVelocity,
|  | vector< double > & | gradient
| ) |  |

Retrieve information about the great circle path including the interface depths at source and receiver, the velocity profiles at the source and receiver, and mantle velocity and velocity gradient at points along the great circle path from source pierce point to receiver pierce point.

Parameters

  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 | a double array of length NLAYERS containing the depths of all the model interfaces below the source, in km.
  sourceVelocity | a double array of length NLAYERS containing the P or S velocity of each interval below the source, in km/sec.
  receiverDepth | a double array of length NLAYERS containing the depths of all the model interfaces below the receiver, in km.
  receiverVelocity | a double array of length NLAYERS containing the P or S velocity of each interval below the receiver, in km/sec.
  headWaveVelocity | a double array of length npoints containing 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 | a double array of length npoints containing 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.

static double slbm::GreatCircle::getDelDepth | ( |  | ) |
| inlinestatic

static double slbm::GreatCircle::getDelDistance | ( |  | ) |
| inlinestatic

double slbm::GreatCircle::getDistance | ( |  | ) |
| inline

Retrieve source-receiver separation, in radians. getDistance() = getSourceDistance() + getReceiverDistance() + getHeadwaveDistance().

Returns
  the source-receiver separation, in radians.

double slbm::GreatCircle::getEsaz | ( |  | ) |

Retrieve source-receiver azimuth, in radians.

Returns
  the source-receiver azimuth, in radians.

double slbm::GreatCircle::getFractionActive | ( |  | ) |
| inline

void slbm::GreatCircle::getGreatCircleLocation | ( | const double & | distance,
|  | Location & | loc
| ) |  |

Retrieve a location object that is located on the great circle at specified distance from source.

Parameters

  distance | angular distance from source in radians.
  loc | the Location object to be populated with new position information.

Grid& slbm::GreatCircle::getGrid | ( |  | ) |
| inline

Retrieve a reference to the Grid object that this GreatCircle is associated with.

double slbm::GreatCircle::getHeadwaveDistance | ( |  | ) |
| 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().

Returns
  the angular distance traveled by the ray below the headwave interface, in radians.

double slbm::GreatCircle::getHeadwaveDistanceKm | ( |  | ) |
| 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.

Returns
  the horizontal distance traveled by the ray below the headwave interface, in km.

const int& slbm::GreatCircle::getHeadWaveInterface | ( |  | ) |
| inline

Retrieve the index of the head wave interface (SLBMGlobals::MANTLE for Pn, Sn; SLBMGlobals::MIDDLE_CRUST for Pg, Lg).

void slbm::GreatCircle::getLayerProfileLocation | ( | const int & | i,
|  | Location & | loc
| ) |  |

Retrieve the Location of a LayerProfile. Method Location::getRadius() will return the radius of the head wave interface at the position of the requested LayerProfile.

void slbm::GreatCircle::getNodeInfo | ( | int ** | neighbors,
|  | double ** | coefficients,
|  | const int & | maxpoints,
|  | const int & | maxnodes,
|  | int & | npoints,
|  | int * | nnodes
| ) |  |

Retrieve information about the interpolated points along the headwave path, including the number of points, the indexes of the grid nodes that contributed to interpolation of values at the points, and the interpolation coefficients used to calculate values at the points.

The caller must supply all of the array required by this method and retains ownership of those arrays. This method assumes the arrays have been allocated with sufficient memory to hold the requested information and simply populates the supplied arrays.

Parameters

  neighbors | a ragged 2D array of ints with dimensions npoints x nnodes containing the nodeIds of the neighboring grid nodes used to derive the interpolated data at each head wave profile.
  coefficients | a ragged 2D array of doubles with dimensions npoints x nnodes containing the interpolation coefficients applied to each element of neighbors.
  maxpoints | the maximum size of the first dimension of arrays neighbors and coefficients. If npoints exceeds this value, an exception is thrown.
  maxnodes | the maximum size of the second dimension of arrays neighbors and coefficients. If any value of nnodes exceeds this value, an exception is thrown.
  npoints | the number of horizontal increments sampled along the head wave interface.
  nnodes | an int array of length npoints containing the number of nodes that contributed to the interpolation of information at the center of each horizontal segment of the ray path.

void slbm::GreatCircle::getNodeInfo | ( | vector< vector< int > > & | neighbors,
|  | vector< vector< double > > & | coefficients
| ) |  |

Retrieve information about the interpolated points along the headwave path, including the number of points, the indexes of the grid nodes that contributed to interpolation of values at the points, and the interpolation coefficients used to calculate values at the points.

Parameters

  neighbors | a ragged 2D array of ints with dimensions npoints x nnodes containing the nodeIds of the neighboring grid nodes used to derive the interpolated data at each head wave profile.
  coefficients | a ragged 2D array of doubles with dimensions npoints x nnodes containing the interpolation coefficients applied to each element of neighbors.

int slbm::GreatCircle::getNProfiles | ( |  | ) |
| inline

Retrieve the number of LayerProfile object positioned along the head wave interface.

static double slbm::GreatCircle::getPathIncrement | ( |  | ) |
| inlinestatic

virtual void slbm::GreatCircle::getPgLgComponents | ( | double & | tT,
|  | double & | tTaup,
|  | double & | tHeadwave,
|  | double & | pTaup,
|  | double & | pHeadwave,
|  | double & | trTaup,
|  | double & | trHeadwave
| ) |  |
| inlinevirtual

Reimplemented in slbm::GreatCircle_Xg.

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

Retrieve the phase that this GreatCircle supports. Will be one of SLBMGlobals::Pn, SLBMGlobals::Sn, SLBMGlobals::Pg, SLBMGlobals::Lg.

string slbm::GreatCircle::getPhaseString | ( |  | ) |
| inline

Retrieve a string representation fo the the phase that this GreatCircle supports. Will be one of 'Pn', 'Sn', 'Pg', 'Lg'.

LayerProfile* slbm::GreatCircle::getProfile | ( | const int & | i | ) |

Retrieve a pointer to one of the LayerProfile objects in profiles that comprise the head wave portion of the ray path. This object can be queried for depth, radius, velocity and gradient information.

If the requested LayerProfile object has not yet been instantiated (is NULL), it is instantiated by this method.

The profiles are located at the centers of horizontal increments of length actual_path_increment (radians). The first horizontal increment starts at the point on the head wave propagation interface with latitude and longitude equal to that of the source. The last horizontal increment ends at the point on the head wave propagation interface with latitude and longitude equal to the that of the receiver. The spacing is nominally equal to the value path_increment specified in the constructor, but is generally reduced somewhat so that an integral number of horizontal increments that are all the same size will fit into the distance from source to receiver. The actual spacing can be retrieved with a call to getActualPathIncrement().

double slbm::GreatCircle::getRayParameter | ( |  | ) |
| inline

double slbm::GreatCircle::getReceiverDistance | ( |  | ) |
| 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.

Returns
  the horizontal offset below the receiver, in radians.

CrustalProfile* slbm::GreatCircle::getReceiverProfile | ( |  | ) |
| inline

Retrieve a pointer to the receiver CrustalProfile. This object can be queried for velocity vs depth, travel time, Location, etc.

double slbm::GreatCircle::getReceiverRayParameter | ( |  | ) |
| inline

double slbm::GreatCircle::getSourceDistance | ( |  | ) |
| 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.

Returns
  the horizontal offset below the source, in radians.

CrustalProfile* slbm::GreatCircle::getSourceProfile | ( |  | ) |
| inline

Retrieve a pointer to the source CrustalProfile. This object can be queried for velocity vs depth, travel time, Location, etc.

double slbm::GreatCircle::getSourceRayParameter | ( |  | ) |
| inline

double slbm::GreatCircle::getTravelTime | ( |  | ) |
| inline

Retrieve the travel time from the source to the receiver. The travelTime was actually computed when the GreatCircle constructor was called. This method returns the previously computed value.

Returns
  travel time in seconds. Returns SLBMGlobals::NA_VALUE if result is invalid.

void slbm::GreatCircle::getTravelTime | ( | double & | tTotal,
|  | double & | tSource,
|  | double & | tReceiver,
|  | double & | tMantle,
|  | double & | tGradient
| ) |  |
| inline

Retrieve the total travel time and the 4 components that contribute to it. The values were actually computed when the GreatCircle constructor was called. This method returns the previously computed values. The values will equal SLBMGlobals::NA_VALUE if they are invalid.

Parameters

  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.
  tMantle | the head wave travel time in the mantle, in seconds.
  tGradient | the Zhao gradient correction term, in seconds.

double slbm::GreatCircle::getTurningRadius | ( |  | ) |
| inline

void slbm::GreatCircle::getWeights | ( | vector< int > & | nodeids,
|  | vector< double > & | weights
| ) |  |

Retrieve the weight assigned to each grid node that was touched by the GreatCircle.

The weight vector is initialized to 0 for each visited GridProfile object. 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.

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.

Parameters

  nodeids | the ID numbers of all the GridProfile objects touched by this GreatCircle.
  weights | the weight associated with each GridProfile object touched by this GreatCircle.

void slbm::GreatCircle::getWeights | ( | int | nodeids[],
|  | double | weights[],
|  | int & | nweights
| ) |  |

Retrieve the weight assigned to each grid node that was touched by the GreatCircle.

The weight array is initialized to 0 for each visited GridProfile object. 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.

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.

Parameters

  nodeids | the ID numbers of all the GridProfile objects touched by this GreatCircle.
  weights | the weight associated with each GridProfile object touched by this GreatCircle.
  nweights | the number of elements in nodeId and weight. Calling application must dimension this array large enough to handle any possible size.

virtual void slbm::GreatCircle::getZhaoParameters | ( | double & | Vm,
|  | double & | Gm,
|  | double & | H,
|  | double & | C,
|  | double & | Cm,
|  | int & | udSign
| ) |  |
| pure virtual

Implemented in slbm::GreatCircle_Xg, and slbm::GreatCircle_Xn.

size_t slbm::GreatCircle::memSize | ( |  | ) |
| inlinevirtual

GreatCircle& slbm::GreatCircle::operator= | ( | const GreatCircle & | other | ) |

Equal operator.

static void slbm::GreatCircle::setDelDepth | ( | const double & | del_depth | ) |
| inlinestatic

static void slbm::GreatCircle::setDelDistance | ( | const double & | del_distance | ) |
| inlinestatic

void slbm::GreatCircle::setNAValues | ( |  | ) |

static void slbm::GreatCircle::setPathIncrement | ( | const double & | path_increment | ) |
| inlinestatic

double slbm::GreatCircle::sqr | ( | const double & | x | ) |
| inlineprotected

virtual string slbm::GreatCircle::toString | ( | const int & | verbosity | ) |
| pure virtual

Retrieve a formatted string providing a detailed description of the information managed by this GreatCircle object.

Parameters

  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. 0 : nothing. An empty string is returned. 1 : total distance and travel time summary 2 : gradient correction information for Pn/Sn. Nothing for Pg/Lg 3 : Source and receiver profiles 4 : Grid node weights. 5 : Head wave interface profiles 6 : Interpolation coefficients for great circle nodes on the head wave interface.

Implemented in slbm::GreatCircle_Xg, and slbm::GreatCircle_Xn.

## Member Data Documentation

double slbm::GreatCircle::actual_path_increment
| protected

The actual spacing between the elements of profiles, in radians.

double slbm::GreatCircle::DEL_DEPTH
| staticprotected

double slbm::GreatCircle::DEL_DISTANCE
| staticprotected

double slbm::GreatCircle::distance
| protected

The horizontal source-receiver separation, in radians.

double slbm::GreatCircle::esaz
| protected

The source-receiver azimuth, in radians.

int slbm::GreatCircle::greatCircleClassCount
| staticprotected

Grid& slbm::GreatCircle::grid
| protected

A reference to the Grid from which the source and receiver CrustalProfile objects and the LayerProfile objects are interpolated.

int slbm::GreatCircle::headWaveInterface
| protected

The index of the earth model interface along which head waves propagate. If phase is Pn or Sn, headWaveInterface will equal SLBMGlobals::MANTLE. If phase is Pg or Lg, headWaveInterface will equal SLBMGlobals::MIDDLE_CRUST.

Location slbm::GreatCircle::location
| protected

double slbm::GreatCircle::MAX_DEPTH
| static

double slbm::GreatCircle::MAX_DISTANCE
| static

Retrieve the derivative of travel time wrt to source latitude, in seconds/radian.

Parameters

  dtt_dlat | the derivative of travel time wrt to source latitude. Retrieve the derivative of travel time wrt to source longitude, in seconds/radian.

Retrieve the derivative of travel time wrt to source longitude, in seconds/radian.

Parameters

  dtt_dlon | the derivative of travel time wrt to source longitude. Retrieve the derivative of horizontal slowness wrt to source-receiver distance, in seconds/radian^2.

Retrieve the derivative of horizontal slowness wrt to source-receiver distance, in seconds/radian^2. Retrieve the derivative of horizontal slowness wrt to source latitude, in seconds/radian^2.

Retrieve the derivative of horizontal slowness wrt to source latitude, in seconds/radian^2.

Parameters

  dsh_dlat | the derivative of horizontal slowness wrt to source latitude. Retrieve the derivative of horizontal slowness wrt to source longitude, in seconds/radian^2.

Retrieve the derivative of horizontal slowness wrt to source longitude, in seconds/radian^2.

Parameters

  dsh_dlon | the derivative of horizontal slowness wrt to source longitude. Retrieve the derivative of horizontal slowness wrt to source depth, in seconds/radian-km.

Retrieve the derivative of horizontal slowness wrt to source depth, in seconds/radian-km.

Parameters

  dsh_ddepth | the derivative of horizontal slowness wrt to source depth.

double slbm::GreatCircle::PATH_INCREMENT
| staticprotected

the desired spacing of great circle nodes along the head wave interface, in radians. Defaults to 0.1 degrees if not specified. 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.

int slbm::GreatCircle::phase
| protected

The phase that this GreatCircle object is set up for. Will be one of Pn, Sn, Pg or Lg, which are int constants defined in SLBMGlobals.h.

vector<LayerProfile*> slbm::GreatCircle::profiles
| protected

The LayerProfile objects which are positioned on the interface along which the head wave propagates. The profiles are located at the centers of horizontal increments of length actual_path_increment (radians). The first horizontal increment starts at the point on the head wave propagation interface with latitude and longitude equal to the latitude and longitude of the source. The last horizontal increment ends at the point on the head wave propagation interface with latitude and longitude equal to the latitude and longitude of the receiver. The spacing is nominally equal to the value path_increment specified in the constructor, but may be reduced somewhat so that an integral number of horizontal increments that are all the same size will fit into the distance from source to receiver. The actual spacing can be retrieved with a call to getActualPathIncrement().

actual_path_increment is determined in the GreatCircle() constructor and profiles is resized at that point to hold the correct number of LayerProfile objects. The profiles are not instantiated in the constructor since the ones close to the source and receiver will never be needed. Profiles are instantiated as needed in protected method getProfile(const int& i).

double slbm::GreatCircle::rayParameter
| protected

The ray parameter, in sec/radian or sec/km.

CrustalProfile* slbm::GreatCircle::receiver
| protected

The receiver CrustalProfile object. This object can be queried for velocity vs depth, travel time, Location, etc.

int slbm::GreatCircle::receiverIndex
| protected

The index of the element in the profiles array corresponding to the horizontal increment in which the receiver pierce point is located.

double slbm::GreatCircle::receiverRayParameter
| protected

string slbm::GreatCircle::solutionMethod
| protected

The method used to calculate travel times. Will be a string that indicates the name of the c++ method that was used to calculate the travel times.

CrustalProfile* slbm::GreatCircle::source
| protected

The source CrustalProfile object. This object can be queried for velocity vs depth, travel time, Location, etc.

int slbm::GreatCircle::sourceIndex
| protected

The index of the element in the profiles array corresponding to the horizontal increment in which the source pierce point is located.

double slbm::GreatCircle::sourceRayParameter
| protected

double slbm::GreatCircle::tGamma
| protected

The gradient correction term of the total travel time, in sec. Zero of Pg, Lg.

double slbm::GreatCircle::tHorizontal
| protected

The time spent by the ray traveling horizontally as a head wave, in seconds.

double slbm::GreatCircle::tReceiver
| protected

The time required for the ray to travel from the receiver pierce point to the receiver Location, in seconds.

double slbm::GreatCircle::tSource
| protected

The time required for the ray to travel from the source Location to source pierce point, in seconds.

double slbm::GreatCircle::ttEast
| protected

the travel time at a source position which is very slightly to the east of the source measured along a great circle path through the source.

double slbm::GreatCircle::ttEastZ
| protected

the travel time at a source position which is very slightly to the east of the source measured along a great circle path through the source, and at a slightly deeper depth.

double slbm::GreatCircle::ttHminus
| protected

the travel time at a source position which is very slightly closer to the receiver than current source. Used in calculation of derivatives wrt source position.

double slbm::GreatCircle::ttHplus
| protected

the travel time at a source position which is very slightly further from the receiver than current source. Used in calculation of derivatives wrt source position.

double slbm::GreatCircle::ttHZplus
| protected

the travel time at a source position which is very slightly greater depth than current source. Used in calculation of derivatives wrt source position. the travel time at a source position which is very slightly further from the receiver, and at greater depth than current source. Used in calculation of derivatives wrt source position.

double slbm::GreatCircle::ttNorth
| protected

the travel time at a source position which is very slightly to the north of the source measured along a great circle path through the source.

double slbm::GreatCircle::ttNorthZ
| protected

the travel time at a source position which is very slightly to the north of the source measured along a great circle path through the source, and at a slightly deeper depth.

double slbm::GreatCircle::tTotal
| protected

The total travel time from source to receiver, in seconds. Includes both crustal legs, head wave component, and gradient correction, if appropriate. Computed in computeTravelTime(), which is called from the GreatCircle constructor.

double slbm::GreatCircle::ttSouth
| protected

the travel time at a source position which is very slightly to the South of the source measured along a great circle path through the source.

double slbm::GreatCircle::ttWest
| protected

the travel time at a source position which is very slightly to the west of the source measured along a great circle path through the source.

double slbm::GreatCircle::turningRadius
| protected

double slbm::GreatCircle::vtp[3]
| protected

The vector triple product of the source and receiver Locations. (source cross receiver) cross source. Used to compute Locations along the great circle path from source to receiver.

double slbm::GreatCircle::xHorizontal
| protected

The horizontal distance traveled by the ray as a head wave, in km.

double slbm::GreatCircle::xReceiver
| protected

The horizontal distance from the receiver Location to the receiver pierce point, in radians. This value is computed in CrustalProfile::xtCrust().

double slbm::GreatCircle::xSource
| protected

The horizontal distance from the source Location to the source pierce point, in radians. This value is computed in CrustalProfile::xtCrust().

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

- /nfs/tonto2/devlpool/sballar/RSTT/SLBM_Root.3.0.5/install/SLBM_Root.3.0.5.Linux/SLBM/include/GreatCircle.h