Package edu.sc.seis.TauP
Class SimpleSeismicPhase
- java.lang.Object
-
- edu.sc.seis.TauP.SimpleSeismicPhase
-
- All Implemented Interfaces:
SeismicPhase
,java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
FailedSeismicPhase
public class SimpleSeismicPhase extends java.lang.Object implements SeismicPhase
Stores and transforms seismic phase names to and from their corresponding sequence of branches.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description boolean
DEBUG
Enables debugging output.protected double[]
dist
Array of distances corresponding to the ray parameters stored in rayParams.protected double
maxDistance
The maximum distance that this phase can be theoretically observed.protected double
maxRayParam
Maximum ray parameter that exists for this phase.protected int
maxRayParamIndex
Index within TauModel.rayParams that corresponds to maxRayParam.protected int
maxRecursion
protected double
minDistance
The minimum distance that this phase can be theoretically observed.protected double
minRayParam
Minimum ray parameter that exists for this phase.protected int
minRayParamIndex
Index within TauModel.rayParams that corresponds to minRayParam.protected java.lang.String
name
The phase name, ie PKiKP.protected java.lang.String
puristName
name with depths corrected to be actuall discontinuities in the model.static boolean
PWAVE
protected double[]
rayParams
Array of possible ray parameters for this phase.protected double
receiverDepth
The receiver depth within the TauModel that was used to generate this phase.protected double
refineDistToleranceRadian
protected double
sourceDepth
The source depth within the TauModel that was used to generate this phase.static boolean
SWAVE
protected double[]
time
Array of times corresponding to the ray parameters stored in rayParams.protected TauModel
tMod
TauModel to generate phase for.boolean
verbose
Enables verbose output.
-
Constructor Summary
Constructors Constructor Description SimpleSeismicPhase(ProtoSeismicPhase proto, double[] rayParams, double[] time, double[] dist, double minRayParam, double maxRayParam, int minRayParamIndex, int maxRayParamIndex, double minDistance, double maxDistance, boolean debug)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description double
calcIncidentAngle(double arrivalRayParam)
java.util.List<TimeDist>
calcPierceTimeDist(Arrival currArrival)
double
calcRayParamForTakeoffAngle(double takeoffDegree)
double
calcReflTranPSV(Arrival arrival)
double
calcReflTranSH(Arrival arrival)
java.util.List<ArrivalPathSegment>
calcSegmentPaths(Arrival currArrival)
java.util.List<ArrivalPathSegment>
calcSegmentPaths(Arrival currArrival, TimeDist prevEnd, int prevIdx)
Calc path with a starting time-distance possibly not zero.double
calcTakeoffAngle(double arrivalRayParam)
java.util.List<Arrival>
calcTime(double deg)
Deprecated.java.util.List<Arrival>
calcTimeExactDistance(double searchDist)
Calculates arrivals for this phase, but only for the exact distance in radians.int
countFlatLegs()
Arrival
createArrivalAtIndex(int rayNum)
Creates an Arrival for a sampled ray parameter from the model.double
densityAtReceiver()
java.lang.String
describe()
java.lang.String
describeJson()
void
dump()
boolean
finalSegmentIsPWave()
True if the final, incident, wavetype is a P wave, false if an S wave.double[]
getDist()
double
getDist(int i)
Arrival
getEarliestArrival(double degrees)
SeismicPhaseSegment
getFinalPhaseSegment()
SeismicPhaseSegment
getInitialPhaseSegment()
double
getMaxDistance()
double
getMaxDistanceDeg()
double
getMaxRayParam()
int
getMaxRayParamIndex()
double
getMaxTime()
double
getMinDistance()
double
getMinDistanceDeg()
double
getMinRayParam()
int
getMinRayParamIndex()
double
getMinTime()
java.lang.String
getName()
int
getNumRays()
java.util.List<SeismicPhaseSegment>
getPhaseSegments()
Description of segments of the phase.java.lang.String
getPuristName()
double[]
getRayParams()
double
getRayParams(int i)
double
getReceiverDepth()
double
getSourceDepth()
double[]
getTau()
double
getTau(int i)
TauModel
getTauModel()
double[]
getTime()
double
getTime(int i)
boolean
hasArrivals()
boolean
isAllPWave()
True is all segments of this path are only P waves.boolean
isAllSWave()
True is all segments of this path are only S waves.boolean
phasesExistsInModel()
Arrival
refineArrival(int rayNum, double distRadian, double distTolRadian, int maxRecursion)
Arrival
refineArrival(Arrival leftEstimate, Arrival rightEstimate, double searchDist, double distTolRadian, int maxRecursion)
static java.util.List<TimeDist>
removeDuplicatePathPoints(java.util.List<TimeDist> inPath)
Arrival
shootRay(double rayParam)
boolean
sourceSegmentIsPWave()
True if the initial leg, leaving the source, wavetype is a P wave, false if an S wave.java.lang.String
toString()
double
velocityAtReceiver()
double
velocityAtSource()
-
-
-
Field Detail
-
DEBUG
public transient boolean DEBUG
Enables debugging output.
-
verbose
public transient boolean verbose
Enables verbose output.
-
tMod
protected TauModel tMod
TauModel to generate phase for.
-
sourceDepth
protected double sourceDepth
The source depth within the TauModel that was used to generate this phase.
-
receiverDepth
protected double receiverDepth
The receiver depth within the TauModel that was used to generate this phase. Normally this is 0.0 for a surface stations, but can be different for borehole or scattering calculations.
-
dist
protected double[] dist
Array of distances corresponding to the ray parameters stored in rayParams.
-
time
protected double[] time
Array of times corresponding to the ray parameters stored in rayParams.
-
rayParams
protected double[] rayParams
Array of possible ray parameters for this phase.
-
minRayParam
protected double minRayParam
Minimum ray parameter that exists for this phase.
-
maxRayParam
protected double maxRayParam
Maximum ray parameter that exists for this phase.
-
maxRayParamIndex
protected int maxRayParamIndex
Index within TauModel.rayParams that corresponds to maxRayParam. Note that maxRayParamIndex < minRayParamIndex as ray parameter decreases with increasing index.
-
minRayParamIndex
protected int minRayParamIndex
Index within TauModel.rayParams that corresponds to minRayParam. Note that maxRayParamIndex < minRayParamIndex as ray parameter decreases with increasing index.
-
minDistance
protected double minDistance
The minimum distance that this phase can be theoretically observed.
-
maxDistance
protected double maxDistance
The maximum distance that this phase can be theoretically observed.
-
name
protected java.lang.String name
The phase name, ie PKiKP.
-
puristName
protected java.lang.String puristName
name with depths corrected to be actuall discontinuities in the model.
-
refineDistToleranceRadian
protected double refineDistToleranceRadian
-
maxRecursion
protected int maxRecursion
-
PWAVE
public static final boolean PWAVE
- See Also:
- Constant Field Values
-
SWAVE
public static final boolean SWAVE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleSeismicPhase
public SimpleSeismicPhase(ProtoSeismicPhase proto, double[] rayParams, double[] time, double[] dist, double minRayParam, double maxRayParam, int minRayParamIndex, int maxRayParamIndex, double minDistance, double maxDistance, boolean debug)
-
-
Method Detail
-
phasesExistsInModel
public boolean phasesExistsInModel()
- Specified by:
phasesExistsInModel
in interfaceSeismicPhase
-
getEarliestArrival
public Arrival getEarliestArrival(double degrees)
- Specified by:
getEarliestArrival
in interfaceSeismicPhase
-
getTauModel
public TauModel getTauModel()
- Specified by:
getTauModel
in interfaceSeismicPhase
-
getMinDistanceDeg
public double getMinDistanceDeg()
- Specified by:
getMinDistanceDeg
in interfaceSeismicPhase
-
getMinDistance
public double getMinDistance()
- Specified by:
getMinDistance
in interfaceSeismicPhase
-
getMaxDistanceDeg
public double getMaxDistanceDeg()
- Specified by:
getMaxDistanceDeg
in interfaceSeismicPhase
-
getMaxDistance
public double getMaxDistance()
- Specified by:
getMaxDistance
in interfaceSeismicPhase
-
getMaxRayParam
public double getMaxRayParam()
- Specified by:
getMaxRayParam
in interfaceSeismicPhase
-
getMinRayParam
public double getMinRayParam()
- Specified by:
getMinRayParam
in interfaceSeismicPhase
-
getMaxRayParamIndex
public int getMaxRayParamIndex()
- Specified by:
getMaxRayParamIndex
in interfaceSeismicPhase
-
getMinRayParamIndex
public int getMinRayParamIndex()
- Specified by:
getMinRayParamIndex
in interfaceSeismicPhase
-
getMinTime
public double getMinTime()
- Specified by:
getMinTime
in interfaceSeismicPhase
-
getMaxTime
public double getMaxTime()
- Specified by:
getMaxTime
in interfaceSeismicPhase
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceSeismicPhase
-
getPuristName
public java.lang.String getPuristName()
- Specified by:
getPuristName
in interfaceSeismicPhase
-
getSourceDepth
public double getSourceDepth()
- Specified by:
getSourceDepth
in interfaceSeismicPhase
-
getReceiverDepth
public double getReceiverDepth()
- Specified by:
getReceiverDepth
in interfaceSeismicPhase
-
getPhaseSegments
public java.util.List<SeismicPhaseSegment> getPhaseSegments()
Description of segments of the phase.- Specified by:
getPhaseSegments
in interfaceSeismicPhase
-
countFlatLegs
public int countFlatLegs()
- Specified by:
countFlatLegs
in interfaceSeismicPhase
-
getRayParams
public double getRayParams(int i)
- Specified by:
getRayParams
in interfaceSeismicPhase
-
getRayParams
public double[] getRayParams()
- Specified by:
getRayParams
in interfaceSeismicPhase
-
getDist
public double getDist(int i)
- Specified by:
getDist
in interfaceSeismicPhase
-
getDist
public double[] getDist()
- Specified by:
getDist
in interfaceSeismicPhase
-
getTime
public double getTime(int i)
- Specified by:
getTime
in interfaceSeismicPhase
-
getTime
public double[] getTime()
- Specified by:
getTime
in interfaceSeismicPhase
-
getTau
public double getTau(int i)
- Specified by:
getTau
in interfaceSeismicPhase
-
getTau
public double[] getTau()
- Specified by:
getTau
in interfaceSeismicPhase
-
hasArrivals
public boolean hasArrivals()
- Specified by:
hasArrivals
in interfaceSeismicPhase
-
calcTime
@Deprecated public java.util.List<Arrival> calcTime(double deg)
Deprecated.- Specified by:
calcTime
in interfaceSeismicPhase
-
calcTimeExactDistance
public java.util.List<Arrival> calcTimeExactDistance(double searchDist)
Calculates arrivals for this phase, but only for the exact distance in radians. This does not check multiple laps nor going the long way around.
-
createArrivalAtIndex
public Arrival createArrivalAtIndex(int rayNum)
Creates an Arrival for a sampled ray parameter from the model. No interpolation between rays as this is a sample.- Specified by:
createArrivalAtIndex
in interfaceSeismicPhase
- Parameters:
rayNum
-- Returns:
-
refineArrival
public Arrival refineArrival(int rayNum, double distRadian, double distTolRadian, int maxRecursion)
-
refineArrival
public Arrival refineArrival(Arrival leftEstimate, Arrival rightEstimate, double searchDist, double distTolRadian, int maxRecursion)
-
shootRay
public Arrival shootRay(double rayParam) throws SlownessModelException, NoSuchLayerException
- Specified by:
shootRay
in interfaceSeismicPhase
- Throws:
SlownessModelException
NoSuchLayerException
-
calcRayParamForTakeoffAngle
public double calcRayParamForTakeoffAngle(double takeoffDegree) throws NoArrivalException
- Specified by:
calcRayParamForTakeoffAngle
in interfaceSeismicPhase
- Throws:
NoArrivalException
-
velocityAtSource
public double velocityAtSource()
- Specified by:
velocityAtSource
in interfaceSeismicPhase
-
velocityAtReceiver
public double velocityAtReceiver()
- Specified by:
velocityAtReceiver
in interfaceSeismicPhase
-
densityAtReceiver
public double densityAtReceiver()
- Specified by:
densityAtReceiver
in interfaceSeismicPhase
-
calcTakeoffAngle
public double calcTakeoffAngle(double arrivalRayParam)
- Specified by:
calcTakeoffAngle
in interfaceSeismicPhase
-
calcIncidentAngle
public double calcIncidentAngle(double arrivalRayParam)
- Specified by:
calcIncidentAngle
in interfaceSeismicPhase
-
sourceSegmentIsPWave
public boolean sourceSegmentIsPWave()
Description copied from interface:SeismicPhase
True if the initial leg, leaving the source, wavetype is a P wave, false if an S wave.- Specified by:
sourceSegmentIsPWave
in interfaceSeismicPhase
-
getInitialPhaseSegment
public SeismicPhaseSegment getInitialPhaseSegment()
- Specified by:
getInitialPhaseSegment
in interfaceSeismicPhase
-
getFinalPhaseSegment
public SeismicPhaseSegment getFinalPhaseSegment()
- Specified by:
getFinalPhaseSegment
in interfaceSeismicPhase
-
finalSegmentIsPWave
public boolean finalSegmentIsPWave()
Description copied from interface:SeismicPhase
True if the final, incident, wavetype is a P wave, false if an S wave.- Specified by:
finalSegmentIsPWave
in interfaceSeismicPhase
-
calcPierceTimeDist
public java.util.List<TimeDist> calcPierceTimeDist(Arrival currArrival)
- Specified by:
calcPierceTimeDist
in interfaceSeismicPhase
-
getNumRays
public int getNumRays()
- Specified by:
getNumRays
in interfaceSeismicPhase
-
isAllPWave
public boolean isAllPWave()
True is all segments of this path are only P waves.- Specified by:
isAllPWave
in interfaceSeismicPhase
- Returns:
-
isAllSWave
public boolean isAllSWave()
True is all segments of this path are only S waves.- Specified by:
isAllSWave
in interfaceSeismicPhase
- Returns:
-
calcReflTranPSV
public double calcReflTranPSV(Arrival arrival) throws VelocityModelException, SlownessModelException
- Specified by:
calcReflTranPSV
in interfaceSeismicPhase
- Throws:
VelocityModelException
SlownessModelException
-
calcReflTranSH
public double calcReflTranSH(Arrival arrival) throws VelocityModelException, SlownessModelException
- Specified by:
calcReflTranSH
in interfaceSeismicPhase
- Throws:
VelocityModelException
SlownessModelException
-
calcSegmentPaths
public java.util.List<ArrivalPathSegment> calcSegmentPaths(Arrival currArrival)
- Specified by:
calcSegmentPaths
in interfaceSeismicPhase
-
calcSegmentPaths
public java.util.List<ArrivalPathSegment> calcSegmentPaths(Arrival currArrival, TimeDist prevEnd, int prevIdx)
Calc path with a starting time-distance possibly not zero. Used when this simple phase is the outbound phase of a scattered phase and so the path needs to start at the scatterer distance.- Parameters:
currArrival
-prevEnd
-- Returns:
-
removeDuplicatePathPoints
public static java.util.List<TimeDist> removeDuplicatePathPoints(java.util.List<TimeDist> inPath)
-
describe
public java.lang.String describe()
- Specified by:
describe
in interfaceSeismicPhase
-
describeJson
public java.lang.String describeJson()
- Specified by:
describeJson
in interfaceSeismicPhase
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceSeismicPhase
- Overrides:
toString
in classjava.lang.Object
-
dump
public void dump()
- Specified by:
dump
in interfaceSeismicPhase
-
-