edu.sc.seis.TauP
Class TauP_Time

java.lang.Object
  extended by edu.sc.seis.TauP.TauP_Time
Direct Known Subclasses:
TauP_Curve, TauP_Pierce, TauP_SetSac, TauP_Table, TauP_WKBJ

public class TauP_Time
extends java.lang.Object

Calculate travel times for different branches using linear interpolation between known slowness samples.

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

Field Summary
protected  java.util.Vector arrivals
           
protected  double azimuth
           
protected  double backAzimuth
           
 boolean DEBUG
          Turns on debugging output.
protected  double degrees
           
protected  double depth
           
protected  java.io.DataOutputStream dos
           
protected  double eventLat
           
protected  double eventLon
           
protected  boolean GUI
           
protected  java.lang.String modelName
           
protected  boolean onlyPrintRayP
           
protected  boolean onlyPrintTime
           
protected  java.lang.String outFile
           
protected  Outputs outForms
           
protected  java.util.Vector phaseNames
          names of phases to be used, ie PKIKP.
protected  java.util.Vector phases
          vector to hold the SeismicPhases for the phases named in phaseNames.
protected  double stationLat
           
protected  double stationLon
           
protected  TauModel tMod
          Tau model calculated previously.
protected  TauModel tModDepth
          TauModel derived from tMod by correcting it for a non-surface source.
protected  java.util.Properties toolProps
           
 boolean verbose
          Turns on verbose output.
 
Constructor Summary
TauP_Time()
           
TauP_Time(java.lang.String modelName)
          creates a TauP_Time object with the tau model specified by modelName already loaded.
TauP_Time(TauModel tMod)
           
 
Method Summary
 void appendPhaseName(PhaseName phaseName)
           
 void appendPhaseName(java.lang.String phaseName)
           
 void calcTime(double degrees)
           
 void calculate(double degrees)
           
 void clearArrivals()
           
 void clearPhaseNames()
           
 void depthCorrect(double depth)
          corrects the TauModel for the given source depth.
 void destroy()
           
 Arrival getArrival(int i)
           
 Arrival[] getArrivals()
           
 double[] getDisconDepths()
           
 int getNumArrivals()
           
 int getNumPhases()
           
 java.lang.String[] getPhaseNames()
           
static java.util.List getPhaseNames(java.lang.String phaseName)
           
 java.lang.String getPhaseNameString()
           
 double getSourceDepth()
           
 TauModel getTauModel()
           
 java.lang.String getTauModelName()
           
 void init()
          preforms intialization of the tool.
 void loadTauModel(java.lang.String modelName)
           
static void main(java.lang.String[] args)
          Allows TauP_Time to run as an application.
protected  java.lang.String[] parseCmdLineArgs(java.lang.String[] args)
           
 double[] parseDegreeList(java.lang.String degList)
          Parses a comma separated list of distances and returns them in an array.
 void parsePhaseList(java.lang.String phaseList)
          parses a comma separated list of phase names and adds them to the phaseNames vector.
 void printHelp()
           
 void printResult(java.io.DataOutputStream dos)
           
 void printResult(java.io.Writer out)
           
 void printStdUsage()
          Prints the command line arguments common to all TauP tools.
 void printStdUsageHead()
           
 void printStdUsageTail()
           
 void printUsage()
           
protected  void readPhaseFile(java.lang.String filename)
          Reads in list of phase names from a text file.
protected  void readTauModel()
          Reads the velocity model, slowness model, and tau model from a file saved using Java's Serializable interface.
 void recalcPhases()
          reclaulates the given phases using a possibly new or changed tau model.
 void setPhaseNames(PhaseName[] phaseNames)
           
 void setPhaseNames(java.lang.String[] phaseNames)
           
 void setSourceDepth(double depth)
           
 void setTauModel(TauModel tMod)
           
 void sortArrivals()
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public boolean DEBUG
Turns on debugging output.


verbose

public boolean verbose
Turns on verbose output.


modelName

protected java.lang.String modelName

tMod

protected TauModel tMod
Tau model calculated previously.

See Also:
TauModel

tModDepth

protected transient TauModel tModDepth
TauModel derived from tMod by correcting it for a non-surface source.


phases

protected java.util.Vector phases
vector to hold the SeismicPhases for the phases named in phaseNames.


phaseNames

protected java.util.Vector phaseNames
names of phases to be used, ie PKIKP.


depth

protected double depth

degrees

protected double degrees

azimuth

protected double azimuth

backAzimuth

protected double backAzimuth

stationLat

protected double stationLat

stationLon

protected double stationLon

eventLat

protected double eventLat

eventLon

protected double eventLon

arrivals

protected java.util.Vector arrivals

GUI

protected boolean GUI

onlyPrintRayP

protected boolean onlyPrintRayP

onlyPrintTime

protected boolean onlyPrintTime

outFile

protected java.lang.String outFile

dos

protected java.io.DataOutputStream dos

toolProps

protected java.util.Properties toolProps

outForms

protected Outputs outForms
Constructor Detail

TauP_Time

public TauP_Time()

TauP_Time

public TauP_Time(TauModel tMod)
          throws TauModelException
Throws:
TauModelException

TauP_Time

public TauP_Time(java.lang.String modelName)
          throws TauModelException
creates a TauP_Time object with the tau model specified by modelName already loaded.

Throws:
TauModelException - if the file can't be found or is corrupted in some way.
Method Detail

getPhaseNames

public java.lang.String[] getPhaseNames()

getPhaseNameString

public java.lang.String getPhaseNameString()

setPhaseNames

public void setPhaseNames(java.lang.String[] phaseNames)

setPhaseNames

public void setPhaseNames(PhaseName[] phaseNames)

getPhaseNames

public static java.util.List getPhaseNames(java.lang.String phaseName)

appendPhaseName

public void appendPhaseName(java.lang.String phaseName)

appendPhaseName

public void appendPhaseName(PhaseName phaseName)

getNumPhases

public int getNumPhases()

clearPhaseNames

public void clearPhaseNames()

getSourceDepth

public double getSourceDepth()

setSourceDepth

public void setSourceDepth(double depth)

getTauModelName

public java.lang.String getTauModelName()

getTauModel

public TauModel getTauModel()

setTauModel

public void setTauModel(TauModel tMod)

loadTauModel

public void loadTauModel(java.lang.String modelName)
                  throws java.io.FileNotFoundException,
                         java.io.InvalidClassException,
                         java.io.IOException,
                         java.io.StreamCorruptedException,
                         java.io.OptionalDataException,
                         TauModelException
Throws:
java.io.FileNotFoundException
java.io.InvalidClassException
java.io.IOException
java.io.StreamCorruptedException
java.io.OptionalDataException
TauModelException

getDisconDepths

public double[] getDisconDepths()

clearArrivals

public void clearArrivals()

getNumArrivals

public int getNumArrivals()

getArrival

public Arrival getArrival(int i)

getArrivals

public Arrival[] getArrivals()

readTauModel

protected void readTauModel()
                     throws java.io.FileNotFoundException,
                            java.io.InvalidClassException,
                            java.io.IOException,
                            java.io.StreamCorruptedException,
                            java.io.OptionalDataException,
                            TauModelException
Reads the velocity model, slowness model, and tau model from a file saved using Java's Serializable interface. Performs a depth correction if the current depth is not 0.0

Throws:
java.io.FileNotFoundException
java.io.InvalidClassException
java.io.IOException
java.io.StreamCorruptedException
java.io.OptionalDataException
TauModelException

readPhaseFile

protected void readPhaseFile(java.lang.String filename)
                      throws java.io.IOException
Reads in list of phase names from a text file. So long as each phase name is separated by some whitespace, " " or newline or tab, it should read them fine. Also, comments are allowed, either # or // are comments to the end of the line while c style slash-star make a block a comment.

Throws:
java.io.IOException

parsePhaseList

public void parsePhaseList(java.lang.String phaseList)
parses a comma separated list of phase names and adds them to the phaseNames vector. Each phase can have an optional argument after a dash. This would be used for specifying which sac header to put the time in, or for other unforeseen uses. This may be called multiple times to append more phases. For example: P-0,PcP-1,ScP-4,Sn,SS,S^410S would, assuming no previous phases have been added, put P in T0, PcP in T1, ScP in T5, Sn in T2, SS in T3, and S^410S in T5.


parseDegreeList

public double[] parseDegreeList(java.lang.String degList)
Parses a comma separated list of distances and returns them in an array.


parseCmdLineArgs

protected java.lang.String[] parseCmdLineArgs(java.lang.String[] args)
                                       throws java.io.IOException
Throws:
java.io.IOException

sortArrivals

public void sortArrivals()

calculate

public void calculate(double degrees)
               throws TauModelException
Throws:
TauModelException

calcTime

public void calcTime(double degrees)

depthCorrect

public void depthCorrect(double depth)
                  throws TauModelException
corrects the TauModel for the given source depth. It only performs the correction of the model is not already corrected to that depth.

Throws:
TauModelException

recalcPhases

public void recalcPhases()
reclaulates the given phases using a possibly new or changed tau model. This should not need to be called by outside classes as it is called by depthCorrect, and calculate.


printResult

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

printResult

public void printResult(java.io.Writer out)
                 throws java.io.IOException
Throws:
java.io.IOException

init

public void init()
          throws java.io.IOException
preforms intialization of the tool. Properties are queried for the the default model to load, source depth to use, phases to use, etc. Note that because of the IO inherent in these operations, this method is not appropriate for Applets. Applets should load TauModels themselves and use the setTauModel(TauModel) method.

Throws:
java.io.IOException

printHelp

public void printHelp()

start

public void start()
           throws java.io.IOException,
                  TauModelException,
                  TauPException
Throws:
java.io.IOException
TauModelException
TauPException

destroy

public void destroy()
             throws java.io.IOException
Throws:
java.io.IOException

printStdUsageHead

public void printStdUsageHead()

printStdUsage

public void printStdUsage()
Prints the command line arguments common to all TauP tools.


printStdUsageTail

public void printStdUsageTail()

printUsage

public void printUsage()

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException,
                        java.io.StreamCorruptedException,
                        java.lang.ClassNotFoundException,
                        java.io.OptionalDataException
Allows TauP_Time to run as an application. Creates an instance of TauP_Time. .

Throws:
java.io.FileNotFoundException
java.io.IOException
java.io.StreamCorruptedException
java.lang.ClassNotFoundException
java.io.OptionalDataException


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