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
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 protected java.util.List<java.lang.Integer>branchSeqArray of branch numbers for the given phase.booleanDEBUGEnables debugging output.protected double[]distArray of distances corresponding to the ray parameters stored in rayParams.protected java.util.List<java.lang.Boolean>downGoingtrue if the current leg of the phase is down going.protected java.util.List<java.lang.Integer>headOrDiffractSeqArray of branchSeq positions where a head or diffracted segment occurs.protected java.util.List<PhaseInteraction>legActionrecords the end action for the current leg.protected java.util.ArrayList<java.lang.String>legsArrayList containing Strings for each leg.protected doublemaxDistanceThe maximum distance that this phase can be theoretically observed.protected doublemaxRayParamMaximum ray parameter that exists for this phase.protected intmaxRayParamIndexIndex within TauModel.rayParams that corresponds to maxRayParam.protected intmaxRecursionprotected doubleminDistanceThe minimum distance that this phase can be theoretically observed.protected doubleminRayParamMinimum ray parameter that exists for this phase.protected intminRayParamIndexIndex within TauModel.rayParams that corresponds to minRayParam.protected java.lang.StringnameThe phase name, ie PKiKP.protected java.lang.StringpuristNamename with depths corrected to be actuall discontinuities in the model.static booleanPWAVEprotected double[]rayParamsArray of possible ray parameters for this phase.protected doublereceiverDepthThe receiver depth within the TauModel that was used to generate this phase.protected doublerefineDistToleranceRadianprotected java.util.List<SeismicPhaseSegment>segmentListDescription of segments of the phase.protected doublesourceDepthThe source depth within the TauModel that was used to generate this phase.static booleanSWAVEprotected double[]timeArray of times corresponding to the ray parameters stored in rayParams.protected TauModeltModTauModel to generate phase for.booleanverboseEnables verbose output.protected java.util.List<java.lang.Boolean>waveTypeArrayList of wave types corresponding to each leg of the phase.
-
Constructor Summary
Constructors Constructor Description SimpleSeismicPhase(java.lang.String name, TauModel tMod)Deprecated.use SeismicPhaseFactory.create()SimpleSeismicPhase(java.lang.String name, TauModel tMod, double receiverDepth)Deprecated.use SeismicPhaseFactory.create()SimpleSeismicPhase(java.lang.String name, TauModel tMod, double receiverDepth, boolean debug)Deprecated.use SeismicPhaseFactory.create()SimpleSeismicPhase(java.lang.String name, TauModel tMod, double receiverDepth, java.util.ArrayList<java.lang.String> legs, java.lang.String puristName, double[] rayParams, double[] time, double[] dist, double minRayParam, double maxRayParam, int minRayParamIndex, int maxRayParamIndex, double minDistance, double maxDistance, java.util.List<java.lang.Integer> branchSeq, java.util.List<java.lang.Integer> headOrDiffractSeq, java.util.List<SeismicPhaseSegment> segmentList, java.util.List<PhaseInteraction> legAction, java.util.List<java.lang.Boolean> downGoing, java.util.List<java.lang.Boolean> waveType, boolean debug)SimpleSeismicPhase(java.lang.String name, java.lang.String modelName, double depth)Deprecated.use SeismicPhaseFactory.create()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.List<TimeDist>adjustPath(java.util.List<TimeDist> inPath, Arrival arrival)Adjust path so the end point lines up.doublecalcIncidentAngle(double arrivalRayParam)java.util.List<Arrival>calcPath(double deg)Deprecated.Use the getPath() method on each Arrival from calcTime()ArrivalcalcPath(Arrival currArrival)Deprecated.use the getPath() method on the arrival.java.util.List<TimeDist>calcPathTimeDist(Arrival currArrival)java.util.List<Arrival>calcPierce(double deg)Deprecated.Use the getPierce() method on each Arrival from calcTime()ArrivalcalcPierce(Arrival currArrival)Deprecated.Use the getPierce() method on each Arrival from calcTime()java.util.List<TimeDist>calcPierceTimeDist(Arrival currArrival)doublecalcRayParamForTakeoffAngle(double takeoffDegree)doublecalcReflTran(Arrival arrival)java.util.List<java.util.List<TimeDist>>calcSegmentPaths(Arrival currArrival)doublecalcTakeoffAngle(double arrivalRayParam)java.util.List<Arrival>calcTime(double deg)calculates arrival times for this phase, sorted by time.java.util.List<Arrival>calcTimeExactDistance(double searchDist)Calculates arrivals for this phase, but only for the exact distance in radians.java.util.List<Arrival>calcTimeExactDistanceDeg(double deg)ArrivalcreateArrivalAtIndex(int rayNum)Creates an Arrival for a sampled ray parameter from the model.doubledensityAtReceiver()java.lang.Stringdescribe()java.lang.StringdescribeJson()voiddump()double[]getDist()doublegetDist(int i)boolean[]getDownGoing()Direction of the leg between pierce point i and i+1, true is downgoing, false if upgoingArrivalgetEarliestArrival(double degrees)int[]getLegAction()Leg type i layer interaction, one of TURN, REFLECTTOP, REFLECTBOT, TRANSUP, TRANSDOWNjava.util.List<java.lang.String>getLegs()doublegetMaxDistance()doublegetMaxDistanceDeg()doublegetMaxRayParam()intgetMaxRayParamIndex()doublegetMinDistance()doublegetMinDistanceDeg()doublegetMinRayParam()intgetMinRayParamIndex()java.lang.StringgetName()java.util.List<SeismicPhaseSegment>getPhaseSegments()java.lang.StringgetPuristName()double[]getRayParams()doublegetRayParams(int i)doublegetReceiverDepth()doublegetSourceDepth()double[]getTau()doublegetTau(int i)TauModelgetTauModel()double[]getTime()doublegetTime(int i)boolean[]getWaveType()Wave type of the leg between pierce point i and i+1, true is P, false if SbooleanhasArrivals()static voidmain(java.lang.String[] args)booleanphasesExistsInModel()ArrivalrefineArrival(int rayNum, double distRadian, double distTolRadian, int maxRecursion)ArrivalrefineArrival(Arrival leftEstimate, Arrival rightEstimate, double searchDist, double distTolRadian, int maxRecursion)static java.util.List<TimeDist>removeDuplicatePathPoints(java.util.List<TimeDist> inPath)ArrivalshootRay(double rayParam)java.lang.StringtoString()doublevelocityAtReceiver()doublevelocityAtSource()
-
-
-
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.
-
branchSeq
protected java.util.List<java.lang.Integer> branchSeq
Array of branch numbers for the given phase. Note that this depends upon both the earth model and the source depth.
-
headOrDiffractSeq
protected java.util.List<java.lang.Integer> headOrDiffractSeq
Array of branchSeq positions where a head or diffracted segment occurs.
-
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.
-
legs
protected java.util.ArrayList<java.lang.String> legs
ArrayList containing Strings for each leg.
-
segmentList
protected java.util.List<SeismicPhaseSegment> segmentList
Description of segments of the phase.
-
legAction
protected java.util.List<PhaseInteraction> legAction
records the end action for the current leg. Will be one of SeismicPhase.TURN, SeismicPhase.TRANSDOWN, SeismicPhase.TRANSUP, SeismicPhase.REFLECTBOT, or SeismicPhase.REFLECTTOP. This allows a check to make sure the path is correct. Used in addToBranch() and parseName().
-
downGoing
protected java.util.List<java.lang.Boolean> downGoing
true if the current leg of the phase is down going. This allows a check to make sure the path is correct. Used in addToBranch() and parseName().
-
waveType
protected java.util.List<java.lang.Boolean> waveType
ArrayList of wave types corresponding to each leg of the phase.
-
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
@Deprecated public SimpleSeismicPhase(java.lang.String name, java.lang.String modelName, double depth) throws TauModelExceptionDeprecated.use SeismicPhaseFactory.create()- Parameters:
name-modelName-depth-- Throws:
TauModelException
-
SimpleSeismicPhase
@Deprecated public SimpleSeismicPhase(java.lang.String name, TauModel tMod) throws TauModelExceptionDeprecated.use SeismicPhaseFactory.create()- Parameters:
name- String containing a name of the phase.tMod- Tau model to be used to construct the phase. This should be corrected for the source depth.- Throws:
TauModelException
-
SimpleSeismicPhase
@Deprecated public SimpleSeismicPhase(java.lang.String name, TauModel tMod, double receiverDepth) throws TauModelExceptionDeprecated.use SeismicPhaseFactory.create()- Parameters:
name-tMod-receiverDepth-- Throws:
TauModelException
-
SimpleSeismicPhase
@Deprecated public SimpleSeismicPhase(java.lang.String name, TauModel tMod, double receiverDepth, boolean debug) throws TauModelExceptionDeprecated.use SeismicPhaseFactory.create()- Parameters:
name-tMod-receiverDepth-debug-- Throws:
TauModelException
-
SimpleSeismicPhase
public SimpleSeismicPhase(java.lang.String name, TauModel tMod, double receiverDepth, java.util.ArrayList<java.lang.String> legs, java.lang.String puristName, double[] rayParams, double[] time, double[] dist, double minRayParam, double maxRayParam, int minRayParamIndex, int maxRayParamIndex, double minDistance, double maxDistance, java.util.List<java.lang.Integer> branchSeq, java.util.List<java.lang.Integer> headOrDiffractSeq, java.util.List<SeismicPhaseSegment> segmentList, java.util.List<PhaseInteraction> legAction, java.util.List<java.lang.Boolean> downGoing, java.util.List<java.lang.Boolean> waveType, boolean debug) throws TauModelException- Throws:
TauModelException
-
-
Method Detail
-
phasesExistsInModel
public boolean phasesExistsInModel()
- Specified by:
phasesExistsInModelin interfaceSeismicPhase
-
getEarliestArrival
public Arrival getEarliestArrival(double degrees)
- Specified by:
getEarliestArrivalin interfaceSeismicPhase
-
getTauModel
public TauModel getTauModel()
- Specified by:
getTauModelin interfaceSeismicPhase
-
getMinDistanceDeg
public double getMinDistanceDeg()
- Specified by:
getMinDistanceDegin interfaceSeismicPhase
-
getMinDistance
public double getMinDistance()
- Specified by:
getMinDistancein interfaceSeismicPhase
-
getMaxDistanceDeg
public double getMaxDistanceDeg()
- Specified by:
getMaxDistanceDegin interfaceSeismicPhase
-
getMaxDistance
public double getMaxDistance()
- Specified by:
getMaxDistancein interfaceSeismicPhase
-
getMaxRayParam
public double getMaxRayParam()
- Specified by:
getMaxRayParamin interfaceSeismicPhase
-
getMinRayParam
public double getMinRayParam()
- Specified by:
getMinRayParamin interfaceSeismicPhase
-
getMaxRayParamIndex
public int getMaxRayParamIndex()
- Specified by:
getMaxRayParamIndexin interfaceSeismicPhase
-
getMinRayParamIndex
public int getMinRayParamIndex()
- Specified by:
getMinRayParamIndexin interfaceSeismicPhase
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceSeismicPhase
-
getPuristName
public java.lang.String getPuristName()
- Specified by:
getPuristNamein interfaceSeismicPhase
-
getSourceDepth
public double getSourceDepth()
- Specified by:
getSourceDepthin interfaceSeismicPhase
-
getReceiverDepth
public double getReceiverDepth()
- Specified by:
getReceiverDepthin interfaceSeismicPhase
-
getLegs
public java.util.List<java.lang.String> getLegs()
- Specified by:
getLegsin interfaceSeismicPhase
-
getPhaseSegments
public java.util.List<SeismicPhaseSegment> getPhaseSegments()
- Specified by:
getPhaseSegmentsin interfaceSeismicPhase
-
getRayParams
public double getRayParams(int i)
- Specified by:
getRayParamsin interfaceSeismicPhase
-
getRayParams
public double[] getRayParams()
- Specified by:
getRayParamsin interfaceSeismicPhase
-
getDist
public double getDist(int i)
- Specified by:
getDistin interfaceSeismicPhase
-
getDist
public double[] getDist()
- Specified by:
getDistin interfaceSeismicPhase
-
getTime
public double getTime(int i)
- Specified by:
getTimein interfaceSeismicPhase
-
getTime
public double[] getTime()
- Specified by:
getTimein interfaceSeismicPhase
-
getTau
public double getTau(int i)
- Specified by:
getTauin interfaceSeismicPhase
-
getTau
public double[] getTau()
- Specified by:
getTauin interfaceSeismicPhase
-
getDownGoing
public boolean[] getDownGoing()
Direction of the leg between pierce point i and i+1, true is downgoing, false if upgoing- Specified by:
getDownGoingin interfaceSeismicPhase
-
getWaveType
public boolean[] getWaveType()
Wave type of the leg between pierce point i and i+1, true is P, false if S- Specified by:
getWaveTypein interfaceSeismicPhase
-
getLegAction
public int[] getLegAction()
Leg type i layer interaction, one of TURN, REFLECTTOP, REFLECTBOT, TRANSUP, TRANSDOWN- Specified by:
getLegActionin interfaceSeismicPhase
-
hasArrivals
public boolean hasArrivals()
- Specified by:
hasArrivalsin interfaceSeismicPhase
-
calcTime
public java.util.List<Arrival> calcTime(double deg)
calculates arrival times for this phase, sorted by time.- Specified by:
calcTimein interfaceSeismicPhase
-
calcTimeExactDistanceDeg
public java.util.List<Arrival> calcTimeExactDistanceDeg(double deg)
- Specified by:
calcTimeExactDistanceDegin 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:
createArrivalAtIndexin 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:
shootRayin interfaceSeismicPhase- Throws:
SlownessModelExceptionNoSuchLayerException
-
calcRayParamForTakeoffAngle
public double calcRayParamForTakeoffAngle(double takeoffDegree)
- Specified by:
calcRayParamForTakeoffAnglein interfaceSeismicPhase
-
velocityAtSource
public double velocityAtSource()
- Specified by:
velocityAtSourcein interfaceSeismicPhase
-
velocityAtReceiver
public double velocityAtReceiver()
- Specified by:
velocityAtReceiverin interfaceSeismicPhase
-
densityAtReceiver
public double densityAtReceiver()
- Specified by:
densityAtReceiverin interfaceSeismicPhase
-
calcTakeoffAngle
public double calcTakeoffAngle(double arrivalRayParam)
- Specified by:
calcTakeoffAnglein interfaceSeismicPhase
-
calcIncidentAngle
public double calcIncidentAngle(double arrivalRayParam)
- Specified by:
calcIncidentAnglein interfaceSeismicPhase
-
calcPierce
@Deprecated public java.util.List<Arrival> calcPierce(double deg) throws TauModelException
Deprecated.Use the getPierce() method on each Arrival from calcTime()Calculates the "pierce points" for the arrivals stored in arrivals. The pierce points are stored within each arrival object.- Throws:
TauModelException
-
calcPierce
@Deprecated public Arrival calcPierce(Arrival currArrival)
Deprecated.Use the getPierce() method on each Arrival from calcTime()Calculates the pierce points for a particular arrival. The returned arrival is the same as the input arguement but now has the pierce points filled in.- Parameters:
currArrival-- Returns:
- same arrival with pierce points
-
calcPierceTimeDist
public java.util.List<TimeDist> calcPierceTimeDist(Arrival currArrival)
- Specified by:
calcPierceTimeDistin interfaceSeismicPhase
-
calcPath
@Deprecated public java.util.List<Arrival> calcPath(double deg)
Deprecated.Use the getPath() method on each Arrival from calcTime()calculates the paths this phase takes through the earth model.
-
calcPath
@Deprecated public Arrival calcPath(Arrival currArrival)
Deprecated.use the getPath() method on the arrival.- Parameters:
currArrival-- Returns:
-
calcReflTran
public double calcReflTran(Arrival arrival) throws VelocityModelException, SlownessModelException
- Specified by:
calcReflTranin interfaceSeismicPhase- Throws:
VelocityModelExceptionSlownessModelException
-
calcPathTimeDist
public java.util.List<TimeDist> calcPathTimeDist(Arrival currArrival)
- Specified by:
calcPathTimeDistin interfaceSeismicPhase
-
calcSegmentPaths
public java.util.List<java.util.List<TimeDist>> calcSegmentPaths(Arrival currArrival)
-
removeDuplicatePathPoints
public static java.util.List<TimeDist> removeDuplicatePathPoints(java.util.List<TimeDist> inPath)
-
adjustPath
public static java.util.List<TimeDist> adjustPath(java.util.List<TimeDist> inPath, Arrival arrival)
Adjust path so the end point lines up. Because we are shooting a ray parameter through the model, and that ray parameter came from an interpolation, it can happen for long paths that the output path doesn't quite end at the requested distance. We do a simple scaling of all path distances so it hits the output.- Parameters:
inPath-arrival-- Returns:
-
describe
public java.lang.String describe()
- Specified by:
describein interfaceSeismicPhase
-
describeJson
public java.lang.String describeJson()
- Specified by:
describeJsonin interfaceSeismicPhase
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfaceSeismicPhase- Overrides:
toStringin classjava.lang.Object
-
dump
public void dump()
- Specified by:
dumpin interfaceSeismicPhase
-
main
public static void main(java.lang.String[] args)
-
-