DispersionSuite

DispersionSuite class definition.

class DispersionSuite(dispersionset)

Bases: swprepost.suite.Suite

Container for instantiated DispersionSet objects.

Variables:sets (list) – Container for instantiated DispersionSet objects.
__init__(dispersionset)

Initialize a DispersionSuite, from a DispersionSet.

Parameters:dispersionset (DispersionSet) – Initialized DispersionSet object.
Returns:DispersionSuite – Instantiated DispersionSuite object.
Raises:TypeError – If dispersionset is not of type DispersionSet.
append(dispersionset, sort=True)

Append DispersionSet object to DispersionSuite.

Parameters:Refer to (meth: __init__ <DispersionSuite.__init__>.)
Returns:None – Updates the attribute sets.
Raises:TypeError – If dispersionset is not of type DispersionSet.
static check_input(curveset, set_type)

Check inputs comply with the required format.

Specifically: 1. curveset is of type set_type.

classmethod from_geopsy(fname, nsets='all', nrayleigh='all', nlove='all', sort=False)

Instantiate from a text file following the Geopsy format.

Parameters:
  • fname (str) – Name of file, may be a relative or full path.
  • nsets (int, optional) – Number of sets to extract, default is “all” so all available sets will be extracted.
  • nrayleigh, nlove (int, optional) – Number of Rayleigh and Love modes respectively, default is “all” so all available modes will be extracted.
  • sort (bool, optional) – Indicates whether the imported data should be sorted from lowest to highest misfit, default is False indicating no sorting is performed.
Returns:

DispersionSuite – Instantiated DispersionSuite object.

classmethod from_list(dc_sets, sort=True)

Instantiate from a list of DispersionSet objects.

Parameters:
  • dc_sets (list) – List of DispersionSet objects.
  • sort (bool, optional) – Indicates whether the imported data should be sorted from lowest to highest misfit, default is False indicating no sorting is performed.
Returns:

DipsersionSuite – Instantiated DispersionSuite object.

sets
write_to_txt(fname, nbest='all', nrayleigh='all', nlove='all')

Write to text file, following the Geopsy format.

Parameters:
  • fname (str) – Name of file, may be a relative or the full path.
  • nbest ({int, ‘all’}, optional) – Number of best models to write to file, default is ‘all’ indicating all models will be written.
  • nrayleigh, nlove ({int, ‘all’}, optional) – Number of modes to write to file, default is ‘all’ indicating all available modes will be written.
Returns:

None – Writes file to disk.