Class LegPuller

java.lang.Object
edu.sc.seis.TauP.LegPuller

public class LegPuller extends Object
Converts a seismic phase name like PKiKP into a list of tokens P K i K P
  • Field Details

  • Constructor Details

    • LegPuller

      public LegPuller()
  • Method Details

    • regExCheck

      public static boolean regExCheck(String name)
      check against regex for coarse validation. currently disabled as regex has issues and is really big
      Parameters:
      name -
      Returns:
    • legPuller

      protected static ArrayList<String> legPuller(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(String name, int offset, int phaseCharLength, List<String> legs) throws PhaseParseException
      Throws:
      PhaseParseException
    • extractBoundaryId

      public static String extractBoundaryId(String name, int offset, boolean includeHeadDiff) throws PhaseParseException
      Throws:
      PhaseParseException
    • isBoundary

      public static boolean isBoundary(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 Double legAsDepthBoundary(TauModel tMod, 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, 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, String depthString, double tolerance)
    • createPuristName

      public static String createPuristName(TauModel tMod, List<String> legs)
    • phaseValidate

      public static String phaseValidate(ArrayList<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.