Package edu.sc.seis.TauP
Class TauP_AbstractPhaseTool
- java.lang.Object
-
- edu.sc.seis.TauP.TauP_Tool
-
- edu.sc.seis.TauP.TauP_AbstractPhaseTool
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Integer>
- Direct Known Subclasses:
TauP_AbstractRayTool
,TauP_Curve
,TauP_PhaseDescribe
,TauP_SetMSeed3
,TauP_SetSac
,TauP_Table
,TauP_Wavefront
public abstract class TauP_AbstractPhaseTool extends TauP_Tool
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_PHASES
protected java.util.List<PhaseName>
phaseNames
names of phases to be used, ie PKIKP.-
Fields inherited from class edu.sc.seis.TauP.TauP_Tool
abstractOutputTypeArgs, cmdLineArgs, toolProps
-
-
Constructor Summary
Constructors Constructor Description TauP_AbstractPhaseTool(AbstractOutputTypeArgs outputTypeArgs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
appendPhaseName(PhaseName phaseName)
void
appendPhaseName(java.lang.String phaseName)
static org.json.JSONObject
baseResultAsJSONObject(java.lang.String modelName, double depth, double receiverDepth, java.lang.String[] phases)
void
clearPhaseNames()
void
clearPhases()
static java.util.List<java.lang.String>
extractPhaseNames(java.lang.String phaseNames)
Parse comma separated list of phase names, expanding convience phase names like ttp into real phase names.int
getNumPhases()
java.util.List<PhaseName>
getPhaseNameList()
java.lang.String[]
getPhaseNames()
Deprecated.java.lang.String
getPhaseNameString()
Deprecated.java.lang.String
getPhaseUsage()
double
getRadiusOfEarth()
double
getReceiverDepth()
Scatterer
getScatterer()
double
getScattererDepth()
java.util.List<SeismicPhase>
getSeismicPhases()
double
getSourceDepth()
Deprecated.TauModel
getTauModelDepthCorrected()
Gets depth corrected TauModel.java.lang.String
getTauModelName()
void
init()
static double
linearInterp(double xa, double ya, double xb, double yb, double x)
solves the equation (yb-ya)/(xb-xa) = (y-ya)/(x-xa) for y given x.java.util.List<PhaseName>
parsePhaseList(java.lang.String phaseList)
parses a comma separated list of phase names and adds them to the phaseNames vector.protected java.util.List<java.lang.String>
readPhaseFile(java.lang.String filename)
Reads in list of phase names from a text file.protected void
recalcPhases()
recalculates the given phases using a possibly new or changed tau model.void
setModelName(java.lang.String modelName)
void
setPhaseNameList(java.util.List<PhaseName> phaseNames)
void
setPhaseNames(PhaseName[] phaseNames)
Deprecated.void
setPhaseNames(java.util.List<java.lang.String> phaseNames)
void
setReceiverDepth(double receiverDepth)
void
setScatterer(Scatterer scatterer)
void
setSourceDepth(double depth)
void
setTauModel(TauModel tMod)
static java.lang.String[]
splitPhaseNameList(java.lang.String phaseList)
-
Methods inherited from class edu.sc.seis.TauP.TauP_Tool
call, configDefaults, destroy, endGmtAndCleanUp, getModDepthUsage, getOutFileBase, getOutFileExtension, getOutputFormat, getStdUsageHead, getStdUsageTail, isDEBUG, isVerbose, setDEBUG, setOutFileBase, setOutFileExtension, setOutputFormat, setToolPropsFilename, setVerbose, start, toolNameFromClass, validateArguments
-
-
-
-
Field Detail
-
DEFAULT_PHASES
public static final java.lang.String DEFAULT_PHASES
- See Also:
- Constant Field Values
-
phaseNames
protected java.util.List<PhaseName> phaseNames
names of phases to be used, ie PKIKP.
-
-
Constructor Detail
-
TauP_AbstractPhaseTool
public TauP_AbstractPhaseTool(AbstractOutputTypeArgs outputTypeArgs)
-
-
Method Detail
-
getRadiusOfEarth
public double getRadiusOfEarth()
-
getPhaseNameList
public java.util.List<PhaseName> getPhaseNameList() throws PhaseParseException
- Throws:
PhaseParseException
-
setPhaseNameList
public void setPhaseNameList(java.util.List<PhaseName> phaseNames)
-
extractPhaseNames
public static java.util.List<java.lang.String> extractPhaseNames(java.lang.String phaseNames)
Parse comma separated list of phase names, expanding convience phase names like ttp into real phase names.- Parameters:
phaseNames
- string to parse- Returns:
- parsed list of phase names
-
splitPhaseNameList
public static java.lang.String[] splitPhaseNameList(java.lang.String phaseList)
-
linearInterp
public static double linearInterp(double xa, double ya, double xb, double yb, double x)
solves the equation (yb-ya)/(xb-xa) = (y-ya)/(x-xa) for y given x. Useful for finding the pixel for a value given the dimension of the area and the range of values it is supposed to cover. Note, this does not check for xa == xb, in which case a divide by zero would occur.
-
baseResultAsJSONObject
public static org.json.JSONObject baseResultAsJSONObject(java.lang.String modelName, double depth, double receiverDepth, java.lang.String[] phases)
-
init
public void init() throws TauPException
- Specified by:
init
in classTauP_Tool
- Throws:
TauPException
-
getPhaseNames
@Deprecated public java.lang.String[] getPhaseNames()
Deprecated.
-
getPhaseNameString
@Deprecated public java.lang.String getPhaseNameString()
Deprecated.
-
setPhaseNames
public void setPhaseNames(java.util.List<java.lang.String> phaseNames) throws PhaseParseException
- Throws:
PhaseParseException
-
setPhaseNames
@Deprecated public void setPhaseNames(PhaseName[] phaseNames)
Deprecated.
-
appendPhaseName
public void appendPhaseName(java.lang.String phaseName) throws PhaseParseException
- Throws:
PhaseParseException
-
appendPhaseName
public void appendPhaseName(PhaseName phaseName) throws PhaseParseException
- Throws:
PhaseParseException
-
getNumPhases
public int getNumPhases()
-
clearPhaseNames
public void clearPhaseNames()
-
getSourceDepth
@Deprecated public double getSourceDepth()
Deprecated.
-
setSourceDepth
public void setSourceDepth(double depth)
-
getReceiverDepth
public double getReceiverDepth()
-
setReceiverDepth
public void setReceiverDepth(double receiverDepth)
-
getScattererDepth
public double getScattererDepth()
-
getScatterer
public Scatterer getScatterer()
-
setScatterer
public void setScatterer(Scatterer scatterer)
-
getTauModelName
public java.lang.String getTauModelName()
-
getTauModelDepthCorrected
public TauModel getTauModelDepthCorrected() throws TauModelException
Gets depth corrected TauModel.- Throws:
TauModelException
-
setModelName
public void setModelName(java.lang.String modelName)
-
setTauModel
public void setTauModel(TauModel tMod)
-
clearPhases
public void clearPhases()
-
getSeismicPhases
public java.util.List<SeismicPhase> getSeismicPhases() throws TauModelException
- Throws:
TauModelException
-
readPhaseFile
protected java.util.List<java.lang.String> 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.- Returns:
- Throws:
java.io.IOException
-
parsePhaseList
public java.util.List<PhaseName> 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 T6.- Returns:
-
recalcPhases
protected void recalcPhases() throws TauModelException
recalculates 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.- Throws:
TauModelException
-
getPhaseUsage
public java.lang.String getPhaseUsage()
-
-