edu.sc.seis.TauP
Class TauBranch

java.lang.Object
  extended by edu.sc.seis.TauP.TauBranch
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

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

provides storage and methods for distance, time and tau increments for a branch. A branch is a group of layers bounded by discontinuities or reversals in slowness gradient.

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

Field Summary
 boolean DEBUG
          Turns on debugging output.
protected  double[] dist
          Holds distance (radians) evaluated at the ith ray parameter for this branch.
protected  boolean isPWave
          The type of wave for this branch, P or S.
protected  double[] tau
          Holds tau evaluated at the ith ray parameter for this branch.
protected  double[] time
          Holds time (seconds) evaluated at the ith ray parameter for this branch.
 
Constructor Summary
TauBranch(double topDepth, double botDepth, boolean isPWave)
           
 
Method Summary
 TimeDist calcTimeDist(SlownessModel sMod, int topLayerNum, int botLayerNum, double p)
          calculates the time and distance increments for the given ray parameter.
 java.lang.Object clone()
          Returns a clone of this TauBranch object.
 void createBranch(SlownessModel sMod, double minPSoFar, double[] rayParams)
          Calculates tau for this branch, between slowness layers topLayerNum and botLayerNum, inclusive.
protected  TauBranch difference(TauBranch topBranch, int indexP, int indexS, SlownessModel sMod, double minPSoFar, double[] rayParams)
          generates a new tau branch by "subtracting" the given tau branch from this tau branch.
 double getBotDepth()
           
 double[] getDist()
           
 double getDist(int i)
           
 double getMaxRayParam()
           
 double getMinRayParam()
           
 double getMinTurnRayParam()
           
 double[] getTau()
           
 double getTau(int i)
           
 double[] getTime()
           
 double getTime(int i)
           
 double getTopDepth()
           
protected  void insert(double rayParam, SlownessModel sMod, int index)
          Inserts the distance, time, and tau increment for the slowness sample given to the branch.
 TimeDist[] path(double rayParam, boolean downgoing, SlownessModel sMod)
           
static TauBranch readFromStream(java.io.DataInputStream dis)
           
 void shiftBranch(int index)
           
 java.lang.String toString()
           
 void writeToStream(java.io.DataOutputStream dos)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public transient boolean DEBUG
Turns on debugging output.


isPWave

protected boolean isPWave
The type of wave for this branch, P or S.


dist

protected double[] dist
Holds distance (radians) evaluated at the ith ray parameter for this branch.


time

protected double[] time
Holds time (seconds) evaluated at the ith ray parameter for this branch.


tau

protected double[] tau
Holds tau evaluated at the ith ray parameter for this branch.

Constructor Detail

TauBranch

public TauBranch(double topDepth,
                 double botDepth,
                 boolean isPWave)
Method Detail

getTopDepth

public double getTopDepth()

getBotDepth

public double getBotDepth()

getMaxRayParam

public double getMaxRayParam()

getMinTurnRayParam

public double getMinTurnRayParam()

getMinRayParam

public double getMinRayParam()

getDist

public double[] getDist()

getDist

public double getDist(int i)

getTime

public double[] getTime()

getTime

public double getTime(int i)

getTau

public double[] getTau()

getTau

public double getTau(int i)

createBranch

public void createBranch(SlownessModel sMod,
                         double minPSoFar,
                         double[] rayParams)
                  throws NoSuchLayerException,
                         SlownessModelException,
                         TauModelException
Calculates tau for this branch, between slowness layers topLayerNum and botLayerNum, inclusive.

Throws:
NoSuchLayerException - if a needed slowness layer cannot be found.
SlownessModelException - if there is a problem with the slowness model
TauModelException - if the slownessmodel and taumodel are not compatible

calcTimeDist

public TimeDist calcTimeDist(SlownessModel sMod,
                             int topLayerNum,
                             int botLayerNum,
                             double p)
                      throws NoSuchLayerException,
                             SlownessModelException
calculates the time and distance increments for the given ray parameter. The topDepth and botDepth must be correct as they determine the bounds on the integration/summing.

Throws:
NoSuchLayerException - if topLayerNum or botLayerNum are not in the slowness model.
SlownessModelException - if the ray with ray parameter p turns within a layer instead of at the bottom.

insert

protected void insert(double rayParam,
                      SlownessModel sMod,
                      int index)
               throws NoSuchLayerException,
                      SlownessModelException,
                      TauModelException
Inserts the distance, time, and tau increment for the slowness sample given to the branch. This is used for making the depth correction to a tau model for a non-surface source.

Throws:
TauModelException - if the tau branch is not compatable with the slowness sampling
NoSuchLayerException
SlownessModelException
See Also:
edu.sc.seis.TauP.TauModel.depthCorrect(double)

difference

protected TauBranch difference(TauBranch topBranch,
                               int indexP,
                               int indexS,
                               SlownessModel sMod,
                               double minPSoFar,
                               double[] rayParams)
                        throws NoSuchLayerException,
                               SlownessModelException,
                               TauModelException
generates a new tau branch by "subtracting" the given tau branch from this tau branch. The given tau branch is assumed to by the upper part of this branch.

Throws:
NoSuchLayerException
SlownessModelException
TauModelException

shiftBranch

public void shiftBranch(int index)

path

public TimeDist[] path(double rayParam,
                       boolean downgoing,
                       SlownessModel sMod)
                throws SlownessModelException
Throws:
SlownessModelException

writeToStream

public void writeToStream(java.io.DataOutputStream dos)
                   throws java.io.IOException
Throws:
java.io.IOException

readFromStream

public static TauBranch readFromStream(java.io.DataInputStream dis)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException,
                                       java.lang.InstantiationException,
                                       java.lang.IllegalAccessException
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

clone

public java.lang.Object clone()
Returns a clone of this TauBranch object. Note that super.clone() handles all normal variables while the arrays need to be cloned separately to generate a new array as opposed to a new reference to the old array.

Overrides:
clone in class java.lang.Object
See Also:
Cloneable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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