Package edu.sc.seis.TauP.cmdline
Class TauP_Time
- java.lang.Object
-
- edu.sc.seis.TauP.cmdline.TauP_Tool
-
- edu.sc.seis.TauP.cmdline.TauP_AbstractPhaseTool
-
- edu.sc.seis.TauP.cmdline.TauP_AbstractRayTool
-
- edu.sc.seis.TauP.cmdline.TauP_Time
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Integer>
- Direct Known Subclasses:
TauP_Pierce
public class TauP_Time extends TauP_AbstractRayTool
Calculate travel times for different branches using linear interpolation between known slowness samples.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
onlyFirst
protected boolean
onlyPrintRayP
protected boolean
onlyPrintTime
protected java.util.List<SeismicPhase>
relativePhaseList
protected java.util.List<java.lang.String>
relativePhaseName
boolean
withAmplitude
-
Fields inherited from class edu.sc.seis.TauP.cmdline.TauP_AbstractRayTool
distanceArgs
-
Fields inherited from class edu.sc.seis.TauP.cmdline.TauP_AbstractPhaseTool
DEFAULT_PHASES, phaseNames
-
Fields inherited from class edu.sc.seis.TauP.cmdline.TauP_Tool
ABREV_SYNOPSIS, abstractOutputTypeArgs, cmdLineArgs, OPTIONS_HEADING, toolProps
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Arrival>
calcAll(java.util.List<SeismicPhase> phaseList, java.util.List<RayCalculateable> rayCalcList)
java.util.List<SeismicPhase>
calcSeismicPhases(double sourceDepth, java.util.List<java.lang.Double> receiverDepths)
recalculates the given phases using a possibly new or changed tau model.void
destroy()
java.lang.String
getOutFileExtension()
java.lang.String
getOutputFormat()
void
init()
preforms intialization of the tool.boolean
isWithAmplitude()
static void
main(java.lang.String[] args)
Allows TauP_Time to run as an application.static void
printArrivalsAsText(java.io.PrintWriter out, java.util.List<Arrival> arrivalList, java.lang.String modelName, java.util.List<java.lang.Double> sourceDepthList, java.util.List<java.lang.Double> receiverDepthList, Scatterer scatterer, boolean onlyFirst, boolean onlyPrintTime, boolean onlyPrintRayP, boolean withAmplitude, double Mw, java.util.List<java.lang.String> relativePhaseName)
void
printResult(java.io.PrintWriter out, java.util.List<Arrival> arrivalList)
void
printResultJSON(java.io.PrintWriter out, java.util.List<Arrival> arrivalList)
void
printResultText(java.io.PrintWriter out, java.util.List<Arrival> arrivalList)
static org.json.JSONObject
resultAsJSONObject(java.lang.String modelName, java.util.List<java.lang.Double> depth, java.util.List<java.lang.Double> receiverDepth, java.util.List<PhaseName> phases, java.util.List<Arrival> arrivals)
void
start()
-
Methods inherited from class edu.sc.seis.TauP.cmdline.TauP_AbstractRayTool
getDistanceArgs, getReceiverDepths, getSourceDepths, validateArguments, writeJSON, writeJSON
-
Methods inherited from class edu.sc.seis.TauP.cmdline.TauP_AbstractPhaseTool
appendPhaseName, appendPhaseName, baseResultAsJSONObject, calcSeismicPhases, clearPhaseNames, clearPhases, extractPhaseNames, getNumPhases, getPhaseNamesAsString, getRadiusOfEarth, getScatterer, getScattererDepth, getSeismicPhases, getTauModelDepthCorrected, getTauModelName, parsePhaseList, parsePhaseNameList, readPhaseFile, setModelName, setPhaseNameList, setPhaseNames, setReceiverDepth, setScatterer, setSingleReceiverDepth, setSingleSourceDepth, setTauModel, splitPhaseNameList
-
Methods inherited from class edu.sc.seis.TauP.cmdline.TauP_Tool
call, configDefaults, endGmtAndCleanUp, getCmdLineArgs, isDEBUG, isVerbose, setDEBUG, setOutFileBase, setOutFileExtension, setOutputFormat, setToolPropsFilename, setVerbose, toolNameFromClass
-
-
-
-
Field Detail
-
onlyPrintRayP
protected boolean onlyPrintRayP
-
onlyPrintTime
protected boolean onlyPrintTime
-
onlyFirst
protected boolean onlyFirst
-
withAmplitude
public boolean withAmplitude
-
relativePhaseName
protected java.util.List<java.lang.String> relativePhaseName
-
relativePhaseList
protected java.util.List<SeismicPhase> relativePhaseList
-
-
Constructor Detail
-
TauP_Time
public TauP_Time()
-
TauP_Time
public TauP_Time(TauModel tMod)
-
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
-
isWithAmplitude
public boolean isWithAmplitude()
-
getOutputFormat
public java.lang.String getOutputFormat()
- Specified by:
getOutputFormat
in classTauP_Tool
-
getOutFileExtension
public java.lang.String getOutFileExtension()
- Overrides:
getOutFileExtension
in classTauP_Tool
-
calcAll
public java.util.List<Arrival> calcAll(java.util.List<SeismicPhase> phaseList, java.util.List<RayCalculateable> rayCalcList) throws TauPException
- Specified by:
calcAll
in classTauP_AbstractRayTool
- Throws:
TauPException
-
calcSeismicPhases
public java.util.List<SeismicPhase> calcSeismicPhases(double sourceDepth, java.util.List<java.lang.Double> receiverDepths) throws TauModelException
recalculates the given phases using a possibly new or changed tau model. Also calculates the relativePhase list.- Overrides:
calcSeismicPhases
in classTauP_AbstractPhaseTool
- Throws:
TauModelException
-
printResult
public void printResult(java.io.PrintWriter out, java.util.List<Arrival> arrivalList) throws java.io.IOException, TauPException
- Specified by:
printResult
in classTauP_AbstractRayTool
- Throws:
java.io.IOException
TauPException
-
printResultText
public void printResultText(java.io.PrintWriter out, java.util.List<Arrival> arrivalList)
-
printArrivalsAsText
public static void printArrivalsAsText(java.io.PrintWriter out, java.util.List<Arrival> arrivalList, java.lang.String modelName, java.util.List<java.lang.Double> sourceDepthList, java.util.List<java.lang.Double> receiverDepthList, Scatterer scatterer, boolean onlyFirst, boolean onlyPrintTime, boolean onlyPrintRayP, boolean withAmplitude, double Mw, java.util.List<java.lang.String> relativePhaseName)
-
printResultJSON
public void printResultJSON(java.io.PrintWriter out, java.util.List<Arrival> arrivalList) throws TauModelException, TauPException
- Throws:
TauModelException
TauPException
-
resultAsJSONObject
public static org.json.JSONObject resultAsJSONObject(java.lang.String modelName, java.util.List<java.lang.Double> depth, java.util.List<java.lang.Double> receiverDepth, java.util.List<PhaseName> phases, java.util.List<Arrival> arrivals)
-
init
public void init() throws TauPException
preforms intialization of the tool. Properties are queried for the default model to load, source depth to use, phases to use, etc.- Overrides:
init
in classTauP_AbstractPhaseTool
- Throws:
TauPException
-
start
public void start() throws java.io.IOException, TauPException
- Specified by:
start
in classTauP_Tool
- Throws:
java.io.IOException
TauPException
-
destroy
public void destroy() throws TauPException
- Specified by:
destroy
in classTauP_Tool
- Throws:
TauPException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
Allows TauP_Time to run as an application. Creates an instance of TauP_Time. ToolRun.main should be used instead.- Throws:
java.io.IOException
-
-