Class 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
    • 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 410
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LegPuller

        public LegPuller()
    • 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.