regex

Regular expression definitions.

get_all(wavetype='rayleigh', time='(\\d+\\.?\\d*)')

Compile regular expression to identify peaks from a .max file.

Parameters:
  • wavetype ({‘rayleigh’, ‘love’, ‘vertical’, ‘radial’, ‘transverse’}, optional) – Define a specific wavetype to extract, default is ‘rayleigh’.

  • time (str, optional) – Define a specific time of interest, default is “(d+.?d*)”), a generic regular expression which will match all time.

Returns:

Compiled Regular Expression – To identify peaks from a .max file.

get_nmaxima()
get_peak_from_max(time='\\d+\\.?\\d*', frequency='-?\\d+.?\\d*[eE]?[+-]?\\d*', wavetype='rayleigh')

Compile regular expression to extract peaks from a .max file.

Parameters:
  • wavetype ({‘rayleigh’, ‘love’, ‘vertical’, ‘radial’, ‘transverse’}, optional) – Define a specific wavetype to extract, default is ‘rayleigh’.

  • time (str, optional) – Define a specific time of interest, default is “(d+.?d*)”), a generic regular expression which will match all time.

Returns:

Compiled Regular Expression – To extract peaks from a .max file.

get_spac_ratio(time='(-?\\d+.?\\d*[eE]?[+-]?\\d*)', component='(0)', ring='(\\d+)')

TODO (jpv): Finish docstring.

Parameters:
  • component ({“0”, “1”, “2”}, optional) – Component vertical=”0”, radial=”1”, and transverse=”2” to be read, default is “0”.

  • ring (str) – Desired ring, default is “d+” so all rings will be exported.

Returns:

Compiled regular expression – To read lines from SPAC-style .max file.

get_spac_ring()

Find all rings in MSPAC .log file. TODO (jpv): Finish docstring.