Package edu.sc.seis.TauP
Class LegPuller
- java.lang.Object
-
- edu.sc.seis.TauP.LegPuller
-
public class LegPuller extends java.lang.Object
Converts a seismic phase name like PKiKP into a list of tokens P K i K P
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
bodyWave
static java.lang.String
customDiscon
static java.lang.String
discon
static double
DISCON_DEPTH_TOLERANCE
static java.lang.String
headDiffRE
static java.lang.String
interactPointsRE
static java.lang.String
interactPrefix
static java.lang.String
namedHeadDiffRE
static java.lang.String
number
static java.util.regex.Pattern
phaseRegEx
static java.lang.String
scatterWave
static java.lang.String
surfaceWave
static java.lang.String
travelLeg
static java.lang.String
travelSuffix
static java.lang.String
upDiffRE
-
Constructor Summary
Constructors Constructor Description LegPuller()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
closestDisconBranchToDepth(TauModel tMod, java.lang.String depthString)
Finds the closest discontinuity to the given depth that can have reflections and phase transformations.static int
closestDisconBranchToDepth(TauModel tMod, java.lang.String depthString, double tolerance)
static java.lang.String
createPuristName(TauModel tMod, java.util.List<java.lang.String> legs)
static java.lang.String
extractBoundaryId(java.lang.String name, int offset, boolean includeHeadDiff)
static int
extractPhaseBoundaryInteraction(java.lang.String name, int offset, int phaseCharLength, java.util.List<java.lang.String> legs)
static boolean
isBoundary(java.lang.String leg)
Tests if the leg is a model boundary, like m, c, i or a number as a depth like 410static java.lang.Double
legAsDepthBoundary(TauModel tMod, java.lang.String leg)
Converts leg name to depth, if is a number (depth) or m, c, i.protected static java.util.ArrayList<java.lang.String>
legPuller(java.lang.String name)
Tokenizes a phase name into legs, ie PcS becomes 'P'+'c'+'S' while p^410P would become 'p'+'^410'+'P'.static java.lang.String
phaseValidate(java.util.ArrayList<java.lang.String> legs)
Performs consistency checks on the previously tokenized phase name stored in legs.static boolean
regExCheck(java.lang.String name)
check against regex for coarse validation.
-
-
-
Field Detail
-
number
public static final java.lang.String number
- See Also:
- Constant Field Values
-
customDiscon
public static final java.lang.String customDiscon
- See Also:
- Constant Field Values
-
discon
public static final java.lang.String discon
- See Also:
- Constant Field Values
-
travelSuffix
public static final java.lang.String travelSuffix
- See Also:
- Constant Field Values
-
headDiffRE
public static final java.lang.String headDiffRE
- See Also:
- Constant Field Values
-
namedHeadDiffRE
public static final java.lang.String namedHeadDiffRE
- See Also:
- Constant Field Values
-
upDiffRE
public static final java.lang.String upDiffRE
- See Also:
- Constant Field Values
-
travelLeg
public static final java.lang.String travelLeg
- See Also:
- Constant Field Values
-
interactPrefix
public static final java.lang.String interactPrefix
- See Also:
- Constant Field Values
-
interactPointsRE
public static final java.lang.String interactPointsRE
- See Also:
- Constant Field Values
-
surfaceWave
public static final java.lang.String surfaceWave
- See Also:
- Constant Field Values
-
bodyWave
public static final java.lang.String bodyWave
- See Also:
- Constant Field Values
-
scatterWave
public static final java.lang.String scatterWave
- See Also:
- Constant Field Values
-
phaseRegEx
public static final java.util.regex.Pattern phaseRegEx
-
DISCON_DEPTH_TOLERANCE
public static final double DISCON_DEPTH_TOLERANCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
regExCheck
public static boolean regExCheck(java.lang.String name)
check against regex for coarse validation. currently disabled as regex has issues and is really big- Parameters:
name
-- Returns:
-
legPuller
protected static java.util.ArrayList<java.lang.String> legPuller(java.lang.String name) throws PhaseParseException
Tokenizes a phase name into legs, ie PcS becomes 'P'+'c'+'S' while p^410P would become 'p'+'^410'+'P'. Once a phase name has been broken into tokens we can begin to construct the sequence of branches to which it corresponds. Only minor error checking is done at this point, for instance pIP generates an exception but ^410 doesn't. It also appends "END" as the last leg.- Throws:
PhaseParseException
- if the phase name cannot be tokenized.
-
extractPhaseBoundaryInteraction
public static int extractPhaseBoundaryInteraction(java.lang.String name, int offset, int phaseCharLength, java.util.List<java.lang.String> legs) throws PhaseParseException
- Throws:
PhaseParseException
-
extractBoundaryId
public static java.lang.String extractBoundaryId(java.lang.String name, int offset, boolean includeHeadDiff) throws PhaseParseException
- Throws:
PhaseParseException
-
isBoundary
public static boolean isBoundary(java.lang.String leg)
Tests if the leg is a model boundary, like m, c, i or a number as a depth like 410- Parameters:
leg
- leg name- Returns:
- true if a boundary
-
legAsDepthBoundary
public static java.lang.Double legAsDepthBoundary(TauModel tMod, java.lang.String leg)
Converts leg name to depth, if is a number (depth) or m, c, i. Null otherwise.
-
closestDisconBranchToDepth
public static int closestDisconBranchToDepth(TauModel tMod, java.lang.String depthString)
Finds the closest discontinuity to the given depth that can have reflections and phase transformations. May return 1 past total number of branchs if depth is center of earth or -1 if no layer is within 10 km of depth as a number.- Returns:
- the branch number with the closest top depth.
-
closestDisconBranchToDepth
public static int closestDisconBranchToDepth(TauModel tMod, java.lang.String depthString, double tolerance)
-
createPuristName
public static java.lang.String createPuristName(TauModel tMod, java.util.List<java.lang.String> legs)
-
phaseValidate
public static java.lang.String phaseValidate(java.util.ArrayList<java.lang.String> legs)
Performs consistency checks on the previously tokenized phase name stored in legs. Returns null if all is ok, a message if there is a problem.
-
-