# globals

This file defines something akin to setting some “global” variables. These numbers come from SLBMGlobals.h and CPPGlobals.h. They will be accessible a la rstt.Sn and rstt.PWAVE. There are also a couple helper functions to convert between string and integer phases and attributes.

Attributes

globals.version = '3.2.1'

globals.DEG_PER_RAD = 180 / pi

globals.RAD_PER_DEG = pi / 180

globals.PWAVE = 0

globals.SWAVE = 1

globals.WATER = 0

globals.SEDIMENT1 = 1

globals.SEDIMENT2 = 2

globals.SEDIMENT3 = 3

globals.UPPER_CRUST = 4

globals.MIDDLE_CRUST_N = 5

globals.MIDDLE_CRUST_G = 6

globals.LOWER_CRUST = 7

globals.MANTLE = 8

globals.NLAYERS = 9

globals.Pn = 0

globals.Sn = 1

globals.Pg = 2

globals.Lg = 3

globals.TT = 0

globals.SH = 1

globals.AZ = 2

Functions

attributes(x)

  Convert RSTT attribute strings to their respective numbers, and vice-versa.

  Examples

      >>> rstt.attributes('AZ')
      2

      >>> rstt.attributes(0)
      'TT'

  Parameters:

    x (str or int) – Either the phase number or string (case-insensitive)

  Returns:

    Returns an int or str, opposite the argument type

  Return type:

    int or str

phases(x)

  Convert RSTT phase strings to their respective numbers, and vice-versa.

  Examples

      >>> rstt.phases('Sn')
      1

      >>> rstt.phases(1)
      'Sn'

  Parameters:

    x (str or int) – Either the phase number or string (case-insensitive)

  Returns:

    Returns an int or str, opposite the argument type

  Return type:

    int or str