edu.sc.seis.TauP
Class SeismicPhase

java.lang.Object
  extended byedu.sc.seis.TauP.SeismicPhase
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class SeismicPhase
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Stores and transforms seismic phase names to and from their corresponding sequence of branches.

Version:
1.1.3 Wed Jul 18 15:00:35 GMT 2001
Author:
H. Philip Crotwell
See Also:
Serialized Form

Field Summary
protected  java.util.Vector arrivals
          Vector holding all arrivals for this phase at the given distance.
protected  java.util.Vector branchSeq
          Array of branch numbers for the given phase.
protected  int currBranch
          temporary branch number so we know where to start add to the branch sequence.
 boolean DEBUG
          Enables debugging output.
protected  double[] dist
          Array of distances corresponding to the ray parameters stored in rayParams.
protected  java.util.Vector downGoing
          true if the current leg of the phase is down going.
protected  int endAction
          temporary end action so we know what we did at the end of the last section of the branch sequence.
protected  java.util.Vector legAction
          records the end action for the current leg.
protected  java.util.Vector legs
          Vector containing Strings for each leg.
protected  double maxDiffraction
          The maximum degrees that a Pdiff or Sdiff can diffract along the CMB.
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  double maxRefraction
          The maximum degrees that a Pn or Sn can refract along the moho.
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 static int REFLECTBOT
          Used by addToBranch when the path reflects off the bottom of the end of a segment, ie v.
protected static int REFLECTTOP
          Used by addToBranch when the path reflects off the top of the end of a segment, ie ^.
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.
protected static int TRANSDOWN
          Used by addToBranch when the path transmits down through the end of a segment.
protected static int TRANSUP
          Used by addToBranch when the path transmits up through the end of a segment.
protected static int TURN
          Used by addToBranch when the path turns within a segment.
 boolean verbose
          Enables verbose output.
protected  java.util.Vector waveType
          Vector of wave types corresponding to each leg of the phase.
 
Constructor Summary
SeismicPhase(java.lang.String name, TauModel tMod)
           
 
Method Summary
protected  void addToBranch(TauModel tMod, int startBranch, int endBranch, boolean isPWave, int endAction)
           
 void calcPath(TauModel tMod)
          calculates the path this phase takes through the earth model.
 void calcPierce(TauModel tMod)
          Calculates the "pierce points" for the arrivals stored in arrivals.
 void calcTime(double deg)
          calculates arrival times for this phase.
 java.lang.Object clone()
          Returns an independent clone of the SeismicPhase.
 int closestBranchToDepth(TauModel tMod, java.lang.String depthString)
          Finds the closest discontinuity to the given depth that can have refletions and phase transformations.
protected  void createPuristName(TauModel tMod)
           
 void dump()
           
 Arrival[] getArrivals()
          Returns arrival time array.
 double[] getDist()
           
 java.lang.String[] getLegs()
           
 double getMaxDiffraction()
           
 double getMaxDistance()
           
 double getMaxRayParam()
           
 int getMaxRayParamIndex()
           
 double getMinDistance()
           
 double getMinRayParam()
           
 int getMinRayParamIndex()
           
 java.lang.String getName()
           
 java.lang.String getPuristName()
           
 double[] getRayParams()
           
 double[] getTau()
           
 TauModel getTauModel()
           
 double[] getTime()
           
 boolean hasArrivals()
           
 void init()
           
protected  void legPuller()
          Tokenizes a phase name into legs, ie PcS becomes 'P'+'c'+'S' while p^410P would become 'p'+'^410'+'P'.
static void main(java.lang.String[] args)
           
protected  void parseName(TauModel tMod)
          Constructs a branch sequence from the given phase name and tau model.
protected  void phaseConversion(TauModel tMod, int fromBranch, int endAction, boolean isPtoS)
          changes maxRayParam and minRayParam whenever there is a phase conversion.
 boolean phaseValidate()
          Performs consistency checks on the previously tokenized phase name stored in legs.
 void setDEBUG(boolean DEBUG)
           
 void setMaxDiffraction(double maxDiffraction)
           
 void setTauModel(TauModel tMod)
           
protected  void sumBranches(TauModel tMod)
          Sums the appropriate branches for this phase.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.


TURN

protected static final int TURN
Used by addToBranch when the path turns within a segment. We assume that no ray will turn downward so turning implies turning from downward to upward, ie U.

See Also:
Constant Field Values

REFLECTTOP

protected static final int REFLECTTOP
Used by addToBranch when the path reflects off the top of the end of a segment, ie ^.

See Also:
Constant Field Values

REFLECTBOT

protected static final int REFLECTBOT
Used by addToBranch when the path reflects off the bottom of the end of a segment, ie v.

See Also:
Constant Field Values

TRANSUP

protected static final int TRANSUP
Used by addToBranch when the path transmits up through the end of a segment.

See Also:
Constant Field Values

TRANSDOWN

protected static final int TRANSDOWN
Used by addToBranch when the path transmits down through the end of a segment.

See Also:
Constant Field Values

maxRefraction

protected double maxRefraction
The maximum degrees that a Pn or Sn can refract along the moho. Note this is not the total distance, only the segment along the moho. The default is 20 degrees.


maxDiffraction

protected double maxDiffraction
The maximum degrees that a Pdiff or Sdiff can diffract along the CMB. Note this is not the total distance, only the segment along the CMB. The default is 60 degrees.


sourceDepth

protected double sourceDepth
The source depth within the TauModel that was used to generate this phase.


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.


arrivals

protected java.util.Vector arrivals
Vector holding all arrivals for this phase at the given distance. They are stored as Arrival objects.

See Also:
Arrival, calcTime(double), calcPierce(TauModel), calcPath(TauModel)

branchSeq

protected java.util.Vector branchSeq
Array of branch numbers for the given phase. Note that this depends upon both the earth model and the source depth.


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.Vector legs
Vector containing Strings for each leg.


currBranch

protected transient int currBranch
temporary branch number so we know where to start add to the branch sequence. Used in addToBranch() and parseName().


endAction

protected transient int endAction
temporary end action so we know what we did at the end of the last section of the branch sequence. Used in addToBranch() and parseName().


legAction

protected java.util.Vector 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.Vector 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.Vector waveType
Vector of wave types corresponding to each leg of the phase.

See Also:
legs

PWAVE

public static final boolean PWAVE
See Also:
Constant Field Values

SWAVE

public static final boolean SWAVE
See Also:
Constant Field Values
Constructor Detail

SeismicPhase

public SeismicPhase(java.lang.String name,
                    TauModel tMod)
Parameters:
tMod - Tau model to be used to construct the phase.
Method Detail

hasArrivals

public boolean hasArrivals()

getArrivals

public Arrival[] getArrivals()
Returns arrival time array.


setTauModel

public void setTauModel(TauModel tMod)
                 throws TauModelException
Throws:
TauModelException

getTauModel

public TauModel getTauModel()

setDEBUG

public void setDEBUG(boolean DEBUG)

getMinDistance

public double getMinDistance()

getMaxDistance

public double getMaxDistance()

getMaxRayParam

public double getMaxRayParam()

getMinRayParam

public double getMinRayParam()

getMaxRayParamIndex

public int getMaxRayParamIndex()

getMinRayParamIndex

public int getMinRayParamIndex()

getMaxDiffraction

public double getMaxDiffraction()

setMaxDiffraction

public void setMaxDiffraction(double maxDiffraction)

getName

public java.lang.String getName()

getPuristName

public java.lang.String getPuristName()

getLegs

public java.lang.String[] getLegs()

getRayParams

public double[] getRayParams()

getDist

public double[] getDist()

getTime

public double[] getTime()

getTau

public double[] getTau()

init

public void init()
          throws TauModelException
Throws:
TauModelException

calcTime

public void calcTime(double deg)
calculates arrival times for this phase.


phaseConversion

protected void phaseConversion(TauModel tMod,
                               int fromBranch,
                               int endAction,
                               boolean isPtoS)
                        throws TauModelException
changes maxRayParam and minRayParam whenever there is a phase conversion. For instance, SKP needs to change the maxRayParam because there are SKS ray parameters that cannot propagate from the cmb into the mantle as a p wave.

Throws:
TauModelException

addToBranch

protected void addToBranch(TauModel tMod,
                           int startBranch,
                           int endBranch,
                           boolean isPWave,
                           int endAction)
                    throws TauModelException
Throws:
TauModelException

closestBranchToDepth

public int closestBranchToDepth(TauModel tMod,
                                java.lang.String depthString)
Finds the closest discontinuity to the given depth that can have refletions and phase transformations.


parseName

protected void parseName(TauModel tMod)
                  throws TauModelException
Constructs a branch sequence from the given phase name and tau model.

Throws:
TauModelException

legPuller

protected void legPuller()
                  throws TauModelException
Tokenizes a phase name into legs, ie PcS becomes 'P'+'c'+'S' while p^410P would become 'p'+'^410'+'P'. Once a phase name has been broken into tokens we can begin to construct the sequence of branches to which it corresponds. Only minor error checking is done at this point, for instance PIP generates an exception but ^410 doesn't. It also appends "END" as the last leg.

Throws:
TauModelException - if the phase name cannot be tokenized.

createPuristName

protected void createPuristName(TauModel tMod)

sumBranches

protected void sumBranches(TauModel tMod)
                    throws TauModelException
Sums the appropriate branches for this phase.

Throws:
TauModelException - if the topDepth of the high slowness zone is not contained within the TauModel. This should never happen and would indicate an invalid TauModel.

calcPierce

public void calcPierce(TauModel tMod)
                throws TauModelException
Calculates the "pierce points" for the arrivals stored in arrivals. The pierce points are stored within each arrival object.

Throws:
TauModelException

calcPath

public void calcPath(TauModel tMod)
calculates the path this phase takes through the earth model.


phaseValidate

public boolean phaseValidate()
Performs consistency checks on the previously tokenized phase name stored in legs.


toString

public java.lang.String toString()

dump

public void dump()

clone

public java.lang.Object clone()
Returns an independent clone of the SeismicPhase.


main

public static void main(java.lang.String[] args)


Copyright © 1999-2005 Seismology at the University of South Carolina. All Rights Reserved.