134 const double& latSource,
135 const double& lonSource,
136 const double& depthSource,
137 const double& latReceiver,
138 const double& lonReceiver,
139 const double& depthReceiver);
162 virtual bool operator != (
const GreatCircle& other)
const {
return !(*
this == other); } ;
192 string getPhaseString();
377 double getTravelTime();
392 void getTravelTime(
double& tTotal,
double& tSource,
double& tReceiver,
393 double& tMantle,
double& tGradient);
454 double& actual_path_increment,
455 double sourceDepth[NLAYERS],
456 double sourceVelocity[NLAYERS],
457 double receiverDepth[NLAYERS],
458 double receiverVelocity[NLAYERS],
460 double headWaveVelocity[],
496 double& actual_path_increment,
497 vector<double>& sourceDepth,
498 vector<double>& sourceVelocity,
499 vector<double>& receiverDepth,
500 vector<double>& receiverVelocity,
501 vector<double>& headWaveVelocity,
502 vector<double>& gradient
534 double** coefficients,
535 const int& maxpoints,
556 void getNodeInfo( vector<vector<int> >& neighbors, vector<vector<double> >& coefficients );
600 void getWeights(vector<int>& nodeids, vector<double>& weights,
bool headWaveWeights =
true);
634 void getWeights(
int nodeids[],
double weights[],
int& nweights);
636 double getFractionActive();
642 virtual void getZhaoParameters(
double& Vm,
double& Gm,
double& H,
double& C,
double& Cm,
int& udSign) = 0;
645 double& tTaup,
double& tHeadwave,
646 double& pTaup,
double& pHeadwave,
647 double& trTaup,
double& trHeadwave)
648 { tT = tTaup = tHeadwave = pTaup = pHeadwave = trTaup = trHeadwave = NA_VALUE; };
650 virtual size_t memSize();
655 static void setDelDistance(
const double& del_distance) { DEL_DISTANCE = del_distance; }
659 static void setDelDepth(
const double& del_depth) { DEL_DEPTH = del_depth; }
663 static void setPathIncrement(
const double& path_increment) { PATH_INCREMENT = path_increment; }
674 void get_dtt_ddist(
double& dtt_ddist);
682 void get_dtt_dlat(
double& dtt_dlat);
690 void get_dtt_dlon(
double& dtt_dlon);
998 double getActualPathIncrement(
const int& i);
1007 double sqr(
const double& x) {
return x*x; };
1123 inline double GreatCircle::getTravelTime()
1128 inline void GreatCircle::getTravelTime(
double& tT,
double& tS,
double& tR,
double& tM,
double& tG)
1137 inline size_t GreatCircle::memSize()
1164 +
sizeof(headWaveInterface)
1168 +
sizeof(vtp) + 3 *
sizeof(
double)
1170 +
sizeof(solutionMethod)
1172 +
sizeof(actual_path_increment)
1175 +
sizeof(rayParameter)
1184 +
sizeof(xHorizontal)
1185 +
sizeof(tHorizontal)
1187 +
sizeof(sourceRayParameter)
1188 +
sizeof(receiverRayParameter)
1189 +
sizeof(turningRadius)
1190 +
sizeof(sourceIndex)
1191 +
sizeof(receiverIndex)
1207 inline double GreatCircle::getActualPathIncrement(
const int& i)
1211 if (i > sourceIndex && i < receiverIndex)
1212 return actual_path_increment;
1219 if (i == sourceIndex && i == receiverIndex)
1220 return distance - xSource - xReceiver;
1225 if (i == sourceIndex)
1226 return (sourceIndex+1)*actual_path_increment - xSource;
1233 if (i == receiverIndex)
1234 return distance - xReceiver - receiverIndex*actual_path_increment;
1239 inline string GreatCircle::getPhaseString()
1241 return (phase==Pn ?
"Pn" : (phase==Sn ?
"Sn" : (phase==Pg ?
"Pg" : (phase==Lg ?
"Lg"
1242 :
"unknown phase"))));
1245 inline double GreatCircle::getFractionActive()
1248 for (
int i=0; i<(int)profiles.size(); ++i)
1249 if (getProfile(i)->isActiveProfile())
1251 return ((
double)nactive)/((
double)profiles.size());
1254 inline void GreatCircle::get_dtt_ddist(
double& dtt_ddist)
1256 if (getTravelTime() > -1.)
1257 dtt_ddist = (get_ttHplus() - getTravelTime())/DEL_DISTANCE;
1259 dtt_ddist = NA_VALUE;
1262 inline void GreatCircle::get_dtt_dlat(
double& dtt_dlat)
1264 if (getTravelTime() > -1.)
1265 dtt_dlat = (get_ttNorth() - getTravelTime())/DEL_DISTANCE;
1267 dtt_dlat = NA_VALUE;
1270 inline void GreatCircle::get_dtt_dlon(
double& dtt_dlon)
1272 if (getTravelTime() > -1.)
1273 dtt_dlon = (get_ttEast() - getTravelTime())/DEL_DISTANCE;
1275 dtt_dlon = NA_VALUE;
A profile through the Earth model that stores interface radius, and interval P or S wave velocity inf...
The GreatCircle class manages information related to a great circle path between two Locations on the...
double zSource
The vertical distance from the source Location to the source pierce point, in km.
double sSource
The ray length from the source Location to the source pierce point, in km.
static int getClassCount()
double actual_path_increment
The actual spacing between the elements of profiles, in radians.
static double PATH_INCREMENT
the desired spacing of great circle nodes along the head wave interface, in radians.
double getSourceDistanceS()
Retrieve the ray length below the source, in km.
double getHeadwaveDistanceKm()
Retrieve horizontal distance traveled by the ray below the headwave interface, in radians.
virtual void getZhaoParameters(double &Vm, double &Gm, double &H, double &C, double &Cm, int &udSign)=0
double getSourceRayParameter()
int getPhase()
Retrieve the phase that this GreatCircle supports. Will be one of SLBMGlobals::Pn,...
double distance
The horizontal source-receiver separation, in radians.
double getSourceDistanceZ()
Retrieve vertical offset below the source, in km.
virtual string toString(const int &verbosity)=0
Retrieve a formatted string providing a detailed description of the information managed by this Great...
double getReceiverDistanceX()
Retrieve horizontal offset below the receiver, in radians.
double get_ttHminus()
retrieve value of ttHminus. Compute the value if it is NA_VALUE.
int sourceIndex
The index of the element in the profiles array corresponding to the horizontal increment in which the...
double get_ttNorth()
retrieve value of ttHminus. Compute the value if it is NA_VALUE.
double getReceiverRayParameter()
static double DEL_DISTANCE
double sourceRayParameter
double get_ttZminus()
retrieve value of ttZplus. Compute the value if it is NA_VALUE.
static double getPathIncrement()
const int & getHeadWaveInterface()
Retrieve the index of the head wave interface (SLBMGlobals::MANTLE for Pn, Sn; SLBMGlobals::MIDDLE_CR...
static double getDelDepth()
static void setDelDepth(const double &del_depth)
void getWeights(int nodeids[], double weights[], int &nweights)
Retrieve the weight assigned to each grid node that was touched by the GreatCircle.
virtual void getPgLgComponents(double &tT, double &tTaup, double &tHeadwave, double &pTaup, double &pHeadwave, double &trTaup, double &trHeadwave)
double get_ttHZplus()
retrieve value of ttHZplus. Compute the value if it is NA_VALUE.
int phase
The phase that this GreatCircle object is set up for (Pn, Sn, Pg or Lg).
virtual void computeTravelTime()=0
Method to compute the travel time from source to receiver, in seconds.
static int greatCircleClassCount
double tTotal
The total travel time from source to receiver, in seconds.
GreatCircle(const GreatCircle &other)
Copy constructor.
double getSourceDistance()
Retrieve horizontal offset below the source, in radians.
double tHorizontal
The time spent by the ray traveling horizontally as a head wave, in seconds.
CrustalProfile * getReceiverProfile()
Retrieve a pointer to the receiver CrustalProfile.
double esaz
The source-receiver azimuth, in radians.
double get_ttZplus()
retrieve value of ttZplus. Compute the value if it is NA_VALUE.
double receiverRayParameter
double xReceiver
The horizontal distance from the receiver Location to the receiver pierce point, in radians.
static void setDelDistance(const double &del_distance)
double get_ttNorthZ()
retrieve value of ttHZplus. Compute the value if it is NA_VALUE.
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 p...
double sReceiver
The path length from the receiver Location to the receiver pierce point, in km.
static void setPathIncrement(const double &path_increment)
double get_ttEastZ()
retrieve value of ttHZplus. Compute the value if it is NA_VALUE.
double getReceiverDistanceZ()
Retrieve vertical offset below the receiver, in km.
double get_ttWest()
retrieve value of ttHplus. Compute the value if it is NA_VALUE.
Location location
A Location object used in a variety of places to manipulate Location information.
double getTurningRadius()
CrustalProfile * source
The source CrustalProfile object.
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 receive...
CrustalProfile * receiver
The receiver CrustalProfile object.
double xSource
The horizontal distance from the source Location to the source pierce point, in radians.
virtual ~GreatCircle()
Destructor. Deletes LayerProfile objects associated with this GreatCircle object.
double xHorizontal
The horizontal distance traveled by the ray as a head wave, in km.
double sqr(const double &x)
void getNodeInfo(vector< vector< int > > &neighbors, vector< vector< double > > &coefficients)
Retrieve information about the interpolated points along the headwave path, including the number of p...
void getGreatCircleLocation(const double &distance, Location &loc)
Retrieve a location object that is located on the great circle at specified distance from source.
Grid & grid
A reference to the Grid from which the source and receiver CrustalProfile objects and the LayerProfil...
void get_dtt_ddepth(double &dtt_ddepth)
Retrieve the derivative of travel time wrt to source depth, in seconds/km.
double getSourceDistanceX()
Retrieve horizontal offset below the source, in radians.
LayerProfile * getProfile(const int &i)
Retrieve a pointer to one of the LayerProfile objects that comprise the head wave portion of the ray ...
GreatCircle & operator=(const GreatCircle &other)
Equal operator.
double tGamma
The gradient correction term of the total travel time, in sec.
double getReceiverDistance()
Retrieve horizontal offset below the receiver, in radians.
void getWeights(vector< int > &nodeids, vector< double > &weights, bool headWaveWeights=true)
Retrieve the weight assigned to each grid node that was touched by the GreatCircle.
double tReceiver
The time required for the ray to travel from the receiver pierce point to the receiver Location,...
int receiverIndex
The index of the element in the profiles array corresponding to the horizontal increment in which the...
double get_ttEast()
retrieve value of ttHminus. Compute the value if it is NA_VALUE.
vector< LayerProfile * > profiles
The LayerProfile objects which are positioned on the interface along which the head wave propagates.
string solutionMethod
The method used to calculate travel times.
static double getDelDistance()
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 receive...
double getEsaz()
Retrieve source-receiver azimuth, in radians.
double get_ttHplus()
retrieve value of ttHplus. Compute the value if it is NA_VALUE.
double getActualPathIncrement()
Retrieve horizontal separation of LayerProfiles, in radians.
CrustalProfile * getSourceProfile()
Retrieve a pointer to the source CrustalProfile.
double get_ttSouth()
retrieve value of ttHplus. Compute the value if it is NA_VALUE.
void getLayerProfileLocation(const int &i, Location &loc)
Retrieve the Location of a LayerProfile.
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.
int getNProfiles()
Retrieve the number of LayerProfile object positioned along the head wave interface.
Grid & getGrid()
Retrieve a reference to the Grid object that this GreatCircle is associated with.
double getDistance()
Retrieve source-receiver separation, in radians.
double tSource
The time required for the ray to travel from the source Location to piercePointSource,...
double getReceiverDistanceS()
Retrieve the ray length below the receiver, in km.
double zReceiver
The vertical distance from the receiver Location to the receiver pierce point, in km.
int headWaveInterface
The index of the earth model interface along which head waves propagate. If phase is Pn or Sn,...
double getHeadwaveDistance()
Retrieve angular distance traveled by the ray below the headwave interface, in radians.
static double MAX_DISTANCE
Retrieve the derivative of travel time wrt to source latitude, in seconds/radian.
A 2 dimensional, horizontal grid of GirdProfile objects.
A Profile object based on values interpolated from nearby GridProfile objects.
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.