Package edu.sc.seis.TauP
Class TauP_SetSac
- java.lang.Object
-
- edu.sc.seis.TauP.TauP_Tool
-
- edu.sc.seis.TauP.TauP_AbstractPhaseTool
-
- edu.sc.seis.TauP.TauP_SetSac
-
- All Implemented Interfaces:
java.util.concurrent.Callable<java.lang.Integer>
public class TauP_SetSac extends TauP_AbstractPhaseTool
Calculate times for phases and set sac headers based on gcarc or dist or station lat and lon and event lat and lon. Note that triplicated phases will cause problems, as there is only one spot to put a time. An improved method would allow a phase to have several t#'s associated with it, so that all arrivals could be marked. Currently however, only the first arrival for a phase name is used. Warning: I assume the evdp header has depth in meters unless the -evdpkm flag is set, in which case I assume kilometers. This may be a problem for users that improperly use kilometers for the depth units. Due to much abuse of the sac depth header units I output a warning message if the depth appears to be in kilometers, ie it is less than 1000. This can be safely ignored if the event really is less than 1000 meters deep.
-
-
Field Summary
Fields Modifier and Type Field Description static int
A_HEADER
protected boolean
evdpkm
protected java.util.List<java.lang.String>
sacFileNames
static int
SKIP_HEADER
-
Fields inherited from class edu.sc.seis.TauP.TauP_AbstractPhaseTool
DEFAULT_PHASES, phaseNames
-
Fields inherited from class edu.sc.seis.TauP.TauP_Tool
abstractOutputTypeArgs, cmdLineArgs, toolProps
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TauP_SetSac()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
boolean
getEvdpkm()
java.lang.String
getOutputFormat()
java.lang.String
getStdUsage()
java.lang.String
getUsageTail()
void
init()
static void
main(java.lang.String[] args)
Allows TauP_SetSac to run as an application.void
processSacFile(java.io.File f)
void
processSacTimeSeries(edu.sc.seis.seisFile.sac.SacTimeSeries sacFile, java.lang.String filenameForError)
void
setEvdpkm(boolean evdpkm)
void
setSacFileNames(java.lang.String[] sacFileNames)
static void
setSacTHeader(edu.sc.seis.seisFile.sac.SacTimeSeries sacFile, int headerNum, Arrival arrival)
protected void
setSacVarNums()
void
start()
void
validateArguments()
-
Methods inherited from class edu.sc.seis.TauP.TauP_AbstractPhaseTool
appendPhaseName, appendPhaseName, baseResultAsJSONObject, clearPhaseNames, clearPhases, extractPhaseNames, getNumPhases, getPhaseNameList, getPhaseNames, getPhaseNameString, getPhaseUsage, getRadiusOfEarth, getReceiverDepth, getScatterer, getScattererDepth, getSeismicPhases, getSourceDepth, getTauModelDepthCorrected, getTauModelName, linearInterp, parsePhaseList, readPhaseFile, recalcPhases, setModelName, setPhaseNameList, setPhaseNames, setPhaseNames, setReceiverDepth, setScatterer, setSourceDepth, setTauModel, splitPhaseNameList
-
Methods inherited from class edu.sc.seis.TauP.TauP_Tool
call, configDefaults, endGmtAndCleanUp, getModDepthUsage, getOutFileBase, getOutFileExtension, getStdUsageHead, getStdUsageTail, isDEBUG, isVerbose, setDEBUG, setOutFileBase, setOutFileExtension, setOutputFormat, setToolPropsFilename, setVerbose, toolNameFromClass
-
-
-
-
Field Detail
-
sacFileNames
protected java.util.List<java.lang.String> sacFileNames
-
evdpkm
protected boolean evdpkm
-
A_HEADER
public static final int A_HEADER
- See Also:
- Constant Field Values
-
SKIP_HEADER
public static final int SKIP_HEADER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getEvdpkm
public boolean getEvdpkm()
-
setEvdpkm
public void setEvdpkm(boolean evdpkm)
-
setSacFileNames
public void setSacFileNames(java.lang.String[] sacFileNames)
-
setSacVarNums
protected void setSacVarNums() throws PhaseParseException, java.io.IOException
- Throws:
PhaseParseException
java.io.IOException
-
getOutputFormat
public java.lang.String getOutputFormat()
- Specified by:
getOutputFormat
in classTauP_Tool
-
init
public void init() throws TauPException
- 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
-
validateArguments
public void validateArguments() throws TauPException
- Specified by:
validateArguments
in classTauP_Tool
- Throws:
TauPException
-
processSacFile
public void processSacFile(java.io.File f) throws java.io.IOException, TauPException
- Throws:
java.io.IOException
TauPException
-
processSacTimeSeries
public void processSacTimeSeries(edu.sc.seis.seisFile.sac.SacTimeSeries sacFile, java.lang.String filenameForError) throws SetSacException, TauModelException, SlownessModelException, NoSuchLayerException
-
setSacTHeader
public static void setSacTHeader(edu.sc.seis.seisFile.sac.SacTimeSeries sacFile, int headerNum, Arrival arrival)
-
getStdUsage
public java.lang.String getStdUsage()
-
getUsageTail
public java.lang.String getUsageTail()
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
Allows TauP_SetSac to run as an application. Creates an instance of TauP_SetSac. ToolRun.main should be used instead.- Throws:
java.io.IOException
-
-