pyatoa.visuals.comp_wave

A stripped down (arguably better) version of the Waveform Improvement class, used to simply compare two synthetic waveforms from a given PyASDF DataSet.

Module Contents

Classes

CompWave

A class to plot waveform improvement between two models for a given dataset

Functions

main([event_id, station, component, xmin, xmax, cfg])

Main call script to choose event and station based on what's available

main_plot_specific()

Attributes

a

class pyatoa.visuals.comp_wave.CompWave(dsfid, station, min_period, max_period, dsfid_final=None)[source]

A class to plot waveform improvement between two models for a given dataset

_gather_model_from_dataset(dsfid, model=None, init_or_final=None, save_windows=False)[source]

Gather data from an ASDFDataSet based on the given model (iter/step)

Parameters:
  • dsfid (str) – file identifier for the dataset

  • model (str) – iteration/step, e.g. ‘i01/s00’

  • init_or_final (str) – for choosing default values if model is None * ‘init’: choose the first iteration/step for the initial model * ‘final’: choose final iteration/step for final model

Returns:

gather(m_init=None, m_final=None, save_windows=False)[source]

Gather data from the correct dataset. If no m_init or m_final given, will gather the first and last models

Parameters:
  • m_init (str) – initial iteration/step, e.g. ‘i01/s00’

  • m_final (str) – final iteration/step

calculate_vrl(init_or_final)[source]

Caclulate the logarithmic variance reduction to look at how waveforms imrpove from m_init to m_final. Following Eq. 8 of Tape et al. (2010).

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

_xlim_from_envelope(data, dt)[source]

Get rough bounds for the xlimits by looking at waveform envelopes :return:

plot(component_list=None, show=True, save=False, **kwargs)[source]

Plot waveforms iterative based on model updates

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

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

plot_with_map(corners=None, dpi=100, figsize=None, show=True, save=False, **kwargs)[source]

Similar to Manager plotter, plot the waveform comparisons next to a source receiver map. Wraps the internal plotting functionality with a gridspec

pyatoa.visuals.comp_wave.main(event_id=None, station=None, component=None, xmin=None, xmax=None, cfg='plot')[source]

Main call script to choose event and station based on what’s available

pyatoa.visuals.comp_wave.main_plot_specific()[source]
pyatoa.visuals.comp_wave.a[source]