63 class TPVelocityLayer;
64 class TravelTimeResult;
131 TauPSite(
const string& staname,
const string& phase);
167 const string& layrnam =
"");
176 double rt,
double rb,
177 const string& layrnam =
"",
178 double normradius = 1.0);
188 double rt,
double rb,
189 const string& layrnam =
"",
190 double normradius = 1.0);
199 double a2,
double a3,
200 double rt,
double rb,
201 const string& layrnam =
"",
202 double normradius = 1.0);
212 bool evalderivs =
true);
236 bool matchPhase)
const;
244 const map<double, TravelTimeResult*>& getAllTravelTimes()
const;
257 bool bottom_pass =
false);
282 bool bottom_pass =
false);
313 double f0 = 0.0,
double f1 = 1.0);
325 virtual void toStream(ostream& os,
string indent)
const;
330 static string class_name();
333 virtual string get_class_name()
const;
336 virtual int class_size()
const;
339 static string commonName();
342 virtual string getCommonName()
const;
345 const string& getName()
const;
348 const string& getPhase()
const;
351 void setModelName(
const string& modname);
354 const string& getModelName()
const;
357 void setEarthRadius(
double r);
360 double getEarthRadius()
const;
363 void setBrentsTolerance(
double tol);
366 double getBrentsTolerance()
const;
369 const vector<TPVelocityLayer*>& getVelocityModels()
const;
372 virtual int64 get_memory()
const;
385 virtual void writeData(ostream& os)
const;
394 int i,
bool isUpper,
bool isLower);
400 bool isintrfcupper,
bool isintrfclower,
401 bool isspltlower,
bool isspltupper,
411 void debugOutZeros(
int n,
double p0,
double p1);
494 void evaluateDerivatives(
double pT,
double pB,
double T00,
495 double dist,
double depth,
496 double edist,
double edepth,
497 double* derivs,
double pI = -1.0,
504 void reEvaluateDerivatives(
double pT,
double pB,
double T00,
505 double dist,
double depth,
506 double edist,
double edepth,
507 double* derivs,
double pI,
537 int evalDerivsPrimary(
double pT,
double pB,
double T00,
538 double dist,
double depth,
539 double edist,
double edepth,
540 double* derivs,
double pI);
570 int evalDerivsAlternateA(
double pT,
double pB,
double T00,
571 double dist,
double depth,
572 double edist,
double edepth,
573 double* derivs,
double pI);
603 int evalDerivsAlternateB(
double pT,
double pB,
double T00,
604 double dist,
double depth,
605 double edist,
double edepth,
606 double* derivs,
double pI);
636 int evalDerivsAlternateC(
double pT,
double pB,
double T00,
637 double dist,
double depth,
638 double edist,
double edepth,
639 double* derivs,
double pI);
669 int evalDerivsAlternateD(
double pT,
double pB,
double T00,
670 double dist,
double depth,
671 double edist,
double edepth,
672 double* derivs,
double pI);
702 int evalDerivsAlternateE(
double pT,
double pB,
double T00,
703 double dist,
double depth,
704 double edist,
double edepth,
705 double* derivs,
double pI);
735 int evalDerivsAlternateF(
double pT,
double pB,
double T00,
736 double dist,
double depth,
737 double edist,
double edepth,
738 double* derivs,
double pI);
749 double layeredTravelTime(
double pT,
double pB,
double dist,
750 double depth,
double& T,
double pI);
760 static int tpsClassCount;
763 static const double tpsDerivStepSize;
766 static const double tpsBrentsZeroInTol;
770 static vector<TravelTimeResult*> tpsReuseTTR;
776 vector<TPVelocityLayer*> tpsVLayer;
781 bool tpsIsVelModlOwned;
827 map<double, TravelTimeResult*> tpsTTR;
854 void toStream(ostream& os,
string indent =
"")
const;
948 inline string TauPSite::class_name()
958 inline string TauPSite::get_class_name()
const
968 inline int TauPSite::class_size()
const
978 inline string TauPSite::commonName()
980 return (
"1-D Radial TauP Travel Time Site Model");
988 inline string TauPSite::getCommonName()
const
998 inline int64 TauPSite::get_memory()
const
1000 return (
sizeof(
TauPSite) + TauPSite::get_alloc_memory());
1008 inline const string& TauPSite::getName()
const
1018 inline const string& TauPSite::getPhase()
const
1020 return tpsRcvrPhase;
1028 inline void TauPSite::setModelName(
const string& modname)
1030 tpsModelName = modname;
1038 inline const string& TauPSite::getModelName()
const
1040 return tpsModelName;
1048 inline const vector<TPVelocityLayer*>& TauPSite::getVelocityModels()
const
1058 inline void TauPSite::setEarthRadius(
double r)
1060 tpsZeroF.setPlanetRadius(r);
1068 inline double TauPSite::getEarthRadius()
const
1070 return tpsZeroF.getPlanetRadius();
1078 inline void TauPSite::setBrentsTolerance(
double tol)
1080 tpsZeroIn.setTolerance(tol);
1088 inline double TauPSite::getBrentsTolerance()
const
1090 return tpsZeroIn.getTolerance();
1098 inline const map<double, TravelTimeResult*>& TauPSite::getAllTravelTimes()
const
Abstract base class velocity layer model inherited by all concrete velocity layer classes....
The primary layer search functional used by Brents zeroIn(...) function to find layers that contain a...
TauPSite(const TauPSite &tps)
Copy Constructor.
virtual void writeData(const string &filename) const
Writes the TauPSite as a standard ASCII file in CLR format (see TauPModel function readData for a des...
TauPSite(const string &staname, const string &phase)
Standard Constructor. Sets the station name and phase represented by this TauPSite.
void appendConstVelocityModel(double c, double rt, double rb, const string &layrnam="")
Appends a new OWNED constant velocity model to the profile stack. If this is the first entry a new mo...
void appendCubicVelocityModel(double a0, double a1, double a2, double a3, double rt, double rb, const string &layrnam="", double normradius=1.0)
Appends a new OWNED cubic velocity model to the profile stack. If this is the first entry a new model...
TauPSite()
Default Constructor.
void appendLinearVelocityModel(double a0, double a1, double rt, double rb, const string &layrnam="", double normradius=1.0)
Appends a new OWNED linear velocity model to the profile stack. If this is the first entry a new mode...
bool integrateTime(double p, double &d, bool bottom_pass=false)
Returns the total integrated travel time of a ray with ray parameter p in the input parameter t....
virtual ~TauPSite()
Destructor.
TravelTimeResult * getTravelTimeResult(const string &phase, bool matchPhase)
TauPSite & operator=(const TauPSite &tps)
Assignment operator.
double getFirstNonDiffractedTravelTime() const
Returns the first travel time (smallest) for the last call to calculateTravelTimes(dist,...
void appendVelocityModel(TPVelocityLayer *vm)
Appends another velocity model to the profile for 'this' TauPSite. If this is the first then model po...
string toString() const
Print object data to string.
double getFirstTravelTime() const
Returns the first travel time (smallest) for the last call to calculateTravelTimes(dist,...
void dumpLayerInfo(ostream &os)
Debug function to output layer information.
bool integrateDistance(double p, double &d, bool bottom_pass=false)
Returns the total integrated distance of a ray with ray parameter p in the input parameter d....
double getTravelTime(const string &phase, bool matchPhase) const
virtual int64 get_alloc_memory() const
Returns the total heap allocated memory resource for this TauPSite.
void setSiteDepth(double depth)
Sets 'this' sites depth.
void calculateTravelTimes(double srcdist, double srcdepth, bool evalderivs=true)
Calculates travel times for all valid phases at the input distance and depth. This is the primary wor...
void writeLayerData(int i, ostream &os, int n, double f0=0.0, double f1=1.0)
This function writes out the surface to surface distance for waves turning in layer i of the input wa...
void setVelocityModels(const vector< TPVelocityLayer * > &vm)
Sets the velocity models for 'this' TauPSite ... model ownership is set to NOT OWNED (tpsIsVelModlOwn...
bool integrateDistance(double p, double r, double &d)
Returns the total integrated distance of a ray with ray parameter p in the input parameter d....
bool integrateTime(double p, double r1, double r2, double &t)
Returns the total integrated travel time of a ray with ray parameter p in the input parameter d....
void dumpLocalSrcRcvrLayers(ostream &os)
Debug function to output source receiver local conditions.
void clearVelocityModels()
Clears all velocity models from the current profile. If the models are OWNED they are deleted.
void appendQuadraticVelocityModel(double a0, double a1, double a2, double rt, double rb, const string &layrnam="", double normradius=1.0)
Appends a new OWNED quadratic velocity model to the profile stack. If this is the first entry a new m...
virtual void toStream(ostream &os, string indent) const
Print object data to input stream os.
bool integrateDistance(double p, double r1, double r2, double &d)
Returns the total integrated distance of a ray with ray parameter p in the input parameter d....
bool integrateTime(double p, double r, double &d)
Returns the total integrated travel time of a ray with ray parameter p in the input parameter t....
TravelTimeResult * getFirstTravelTimeResult()
Returns the first travel time result. If no travel time exists a NULL pointer is returned.
A public container (struct) that holds the result of a specific ray that satisfied the source distanc...
double ttrDSrc
The surface-to-source ray distance.
double ttrT
The total travel time of the ray from source to receiver.
double ttrTRay
The surface-to-surface ray time.
double ttrR
The ray turning radius.
int ttrLayerIndex
The index of the velocity layer within which the ray turned.
bool ttrIsSplitLower
A boolean, which if true, defines the ray as turning in the lower half of a retrograde layer.
string ttrPhaseEval
The velocity layers evaluated default name. This string is never empty. This will be Xnb,...
TPVelocityLayer * ttrVelLayer
The velocity layer within which the ray turned.
string toString(string indent="") const
Dump TTR to string.
double ttrTRcvr
The surface-to-receiver ray time.
double ttrDIntrfc
The distance along the layer boundary if ttrIsInterface is true.
double ttrTIntrfc
The time along the layer boundary if ttrIsInterface is true.
bool ttrIsSplitUpper
A boolean, which if true, defines the ray as turning in the upper half of a retrograde layer.
double ttrP
The ray parameter (slowness) of the ray.
TravelTimeResult()
Default constructor.
double ttrV
The velocity at the turning point.
double ttrDRay
The surface-to-surface ray distance.
void toStream(ostream &os, string indent="") const
Dump TTR to stream.
string ttrRayType
A string that contains "Turning", "UpGoing", or "DownGoing" indicating the type of ray stored by this...
double ttrDRcvr
The surface-to-receiver ray distance.
double ttrTSrc
The surface-to-source ray time.
string ttrPhaseName
The velocity layers input provided phase name if given. Else the string is empty.
Class supports Brents zeroF and minF functions that finds the root of or minimum (maximum) of a provi...