pyatoa.visuals.improve_wave

Functions to create a figure showing progressive waveform improvement over the course of a seismic inversion.

Show the changes in synthetic waveforms with progressive model updates. Each individual model gets its on row in the plot.

Module Contents

Classes

ImproveWave

A class to plot waveform improvement for a given ASDFDataSet

Attributes

pairs

event_id

class pyatoa.visuals.improve_wave.ImproveWave[source]

A class to plot waveform improvement for a given ASDFDataSet

ds = pyasdf.ASDFDataSet("dataset.h5")
wi = WaveformImprovement(ds)
wi.gather("NZ.BFZ", 10, 30)
wi.plot()
wi.plot("NZ.KNZ", 8, 30)
get_models()[source]

Figure out which step goes to which iteration to get model numbers

gather(sta, min_period, max_period, rotate_to_rtz=False, fix_windows=False, pyflex_preset=False)[source]

Parse dataset for given station, gather observed and synthetic data, preprocess data and return as stream objects.

Parameters:
  • sta (str) – station to gather data for

  • min_period (float) – minimum filter period in seconds

  • max_period (float) – maximum filter period in seconds

  • rotate_to_rtz (bool) – rotate components from NEZ to RTZ Config. if False, instrument response will be removed from obs.

  • fix_windows (bool) – dont recalculate windows when gathering

  • pyflex_preset (str) – overwrite the pyflex preset provided in the Config object

gather_simple(event, sta, min_period, max_period, path_dict=None, component=None)[source]

Manually set the model values based on inspection of the Inspector Don’t return windows or anything, keep it simple

setup_plot(nrows, ncols, **kwargs)[source]

Dynamically set up plots according to number_of given Returns a list of lists of axes objects e.g. axes[i][j] gives the ith column and the jth row

Parameters:
  • nrows (int) – number of rows in the gridspec

  • ncols (int) – number of columns in the gridspec

Rtype axes:

matplotlib axes

Return axes:

axis objects

plot(sta=None, event_id=None, min_period=None, max_period=None, plot_windows=False, trace_length=None, show=True, save=False, **kwargs)[source]

Plot waveforms iterative based on model updates

Parameters:
  • sta (str) – station to gather data for, if None, skips gathering assuming data has already been gathered

  • min_period (float) – minimum filter period for waveforms

  • max_period (float) – maximum filter period for waveforms

  • plot_windows (bool) – plot misfit windows above waveforms

  • trace_length (list of floats) – [trace_start, trace_end] will be used to set the x limit on the waveform data. If none, no xlim will be set

  • show (bool) – Show the plot or do not

  • save (str) – if given, save the figure to this path

gather_simple(models, event_id, sta, component, min_period, max_period)[source]

Gather waveforms from manually input model values, usually determined by using the Inspector class

Parameters:
  • models (dict of tuples) – model values as keys, (iter/step, tag) as tuple value. Tags allow multiple datasets to be used, e.g. if an inversion spans over multiple legs and more than one dataset is used to store waveform data

  • event_id (str) – name of the event, used to access the ASDFDataSet

;type sta: str :param sta: station id to gather data for :type min_period: float :param min_period: period to filter data at :type max_period: float :param max_period: period to filter data at

pyatoa.visuals.improve_wave.pairs = [('2013p617227', 'NZ.TOZ', 'Z')][source]
pyatoa.visuals.improve_wave.event_id = '2013p507880'[source]