rtm.plotting module

rtm.plotting.plot_record_section(st, origin_time, source_location, plot_celerity=None, label_waveforms=True)[source]

Plot a record section based upon user-provided source location and origin time. Optionally plot celerity for reference, with two plotting options.

Parameters:
  • st (Stream) – Any Stream object with tr.stats.latitude, tr.stats.longitude attached

  • origin_time (UTCDateTime) – Origin time for record section

  • source_location (tuple) – Tuple of (lat, lon) specifying source location

  • plot_celerity – Can be either ‘range’ or a single celerity or a list of celerities. If ‘range’, plots a continuous swatch of celerities from 260-380 m/s. Otherwise, plots specific celerities. If None, does not plot any celerities (default: None)

  • label_waveforms (bool) – Toggle labeling waveforms with network and station codes (default: True)

Returns:

Output figure

Return type:

Figure

rtm.plotting.plot_st(st, filt, equal_scale=False, remove_response=False, label_waveforms=True)[source]

Plot Stream waveforms in a publication-quality figure. Multiple plotting options, including filtering.

Parameters:
  • st (Stream) – Any Stream object

  • filt (list) – A two-element list of lower and upper corner frequencies for filtering. Specify None if no filtering is desired.

  • equal_scale (bool) – Set equal scale for all waveforms (default: False)

  • remove_response (bool) – Remove response by applying sensitivity

  • label_waveforms (bool) – Toggle labeling waveforms with network and station codes (default: True)

Returns:

Output figure

Return type:

Figure

rtm.plotting.plot_stack_peak(S, spatial_stack_max=False, plot_max=False, ax=None)[source]

Plot the stack function time series. Two options are supported: (1) the global maximum at each time step (default) or (2) the stack function (at the spatial stack max) over time.

Parameters:
  • SDataArray containing the stack function \(S\)

  • spatial_stack_max (bool) – If True, plots the stack function (at the spatial stack max) over time. If False, plots the global spatial stack maximum at each time step (default: False)

  • plot_max (bool) – Plot maximum value with red circle (default: False)

  • ax (Axes) – Pre-existing axes to plot into

Returns:

Output figure

Return type:

Figure

rtm.plotting.plot_time_slice(S, processed_st, time_slice=None, label_stations=True, hires=False, dem=None, plot_peak=True, xy_grid=None, cont_int=5, annot_int=50)[source]

Plot a time slice through \(S\) to produce a map-view plot. If time is not specified, then the slice corresponds to the maximum of \(S\) in the time direction. Can also plot the peak of the stack function over time.

Parameters:
  • S (DataArray) – The stack function \(S\)

  • processed_st (Stream) – Pre-processed Stream; output of process_waveforms() (This is needed because Trace metadata from this Stream are used to plot stations on the map)

  • time_slice (UTCDateTime) – Time of desired time slice. The nearest time in \(S\) to this specified time will be plotted. If None, the time corresponding to \(\max(S)\) is used (default: None)

  • label_stations (bool) – Toggle labeling stations with network and station codes (default: True)

  • hires (bool) – If True, use higher-resolution coastlines, which looks better but can be slow (default: False)

  • dem (DataArray) – Overlay time slice on a user-supplied DEM from produce_dem (default: None)

  • plot_peak (bool or str) – If True, plots the global stack maximum at each time step as a subplot. If ‘spatial_stack_max’, plots the stack function (at the spatial stack max) over time instead. If False, does not make stack peak plot (default: True)

  • xy_grid (int, float, or None) – If not None, transforms UTM coordinates such that the grid center is at (0, 0) — the plot extent is then given by (-xy_grid, xy_grid) [meters] for easting and northing. Only valid for projected grids

  • cont_int (int) – Contour interval [m] for plots with DEM data

  • annot_int (int) – Annotated contour interval [m] for plots with DEM data (these contours are thicker and labeled)

Returns:

Output figure

Return type:

Figure