3.5. quakemigrate.plot

The quakemigrate.plot module provides methods for the generation of figures in QuakeMigrate, including:

  • Event summaries

  • Phase pick summaries

  • Triggered event summaries

  • Amplitude / local magnitude summaries

copyright

2020–2023, QuakeMigrate developers.

license

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

3.5.1. quakemigrate.plot.event

Module containing methods to generate event summaries and videos.

copyright

2020–2023, QuakeMigrate developers.

license

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

quakemigrate.plot.event.event_summary(run, event, marginalised_coa_map, lut, xy_files=None)[source]

Plots an event summary illustrating the locate results: slices through the marginalised coalescence map with the best location estimate (peak of interpolated spline fitted to 3-D coalescence map) and uncertainty ellipse from gaussian fit to gaussian-smoothed 3-D coalescence map. Plus a waveform gather of the pre-processed waveform data used to calculate the onset functions (sorted by distance from the event), and a plot of the maximum value of the 4-D coalescence function through time.

Parameters
  • run (Run object) – Light class encapsulating i/o path information for a given run.

  • event (Event object) – Light class encapsulating waveforms, coalescence information, picks and location information for a given event.

  • marginalised_coa_map (numpy.ndarray of numpy.double) – Marginalised 3-D coalescence map, shape(nx, ny, nz).

  • lut (LUT object) – Contains the traveltime lookup tables for seismic phases, computed for some pre-defined velocity model.

  • xy_files (str, optional) –

    Path to comma-separated value file (.csv) containing a series of coordinate files to plot. Columns: [“File”, “Color”, “Linewidth”, “Linestyle”], where “File” is the absolute path to the file containing the coordinates to be plotted. E.g: “/home/user/volcano_outlines.csv,black,0.5,-“. Each .csv coordinate file should contain coordinates only, with columns: [“Longitude”, “Latitude”]. E.g.: “-17.5,64.8”. Lines pre-pended with # will be treated as a comment - this can be used to include references. See the Volcanotectonic_Iceland example XY_files for a template.

    Note

    Do not include a header line in either file.

3.5.2. quakemigrate.plot.phase_picks

Module to produce a summary plot for the phase picking.

copyright

2020–2023, QuakeMigrate developers.

license

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

quakemigrate.plot.phase_picks.pick_summary(event, station, waveforms, picks, onsets, ttimes, windows)[source]

Plot a figure showing the pre-processed traces for each data component and the onset functions calculated from them for each phase. The search window to make a phase pick is displayed, along with the dynamic pick threshold, the phase pick time and its uncertainty (if made) and the Gaussian fit to the onset function.

Parameters
  • event (Event object) – Light class encapsulating waveforms, coalescence information, picks and location information for a given event.

  • station (str) – Station code.

  • waveforms (obspy.Stream object) – Filtered seismic data used to calculate the onset functions.

  • picks (pandas.DataFrame object) – Phase pick times with columns [“Name”, “Phase”, “ModelledTime”, “PickTime”, “PickError”, “SNR”] Each row contains the phase pick from one station/phase.

  • onsets (dict of {str: numpy.ndarray}) – Keys are phases. Onset functions for each seismic phase.

  • ttimes (list of float) – Modelled traveltimes from the event hypocentre to the station for each phase to be plotted.

  • windows (dict of list, [int, int, int]) – Keys are phase. Indices specifying the window within which the pick was made [start, modelled_arrival, end].

Returns

fig – Figure showing phase picking information.

Return type

matplotlib.Figure object

3.5.3. quakemigrate.plot.trigger

Module to plot the triggered events on a decimated grid.

copyright

2020–2023, QuakeMigrate developers.

license

GNU General Public License, Version 3 (https://www.gnu.org/licenses/gpl-3.0.html)

quakemigrate.plot.trigger.trigger_summary(events, starttime, endtime, run, marginal_window, min_event_interval, detection_threshold, normalise_coalescence, lut, data, region, discarded_events, interactive, xy_files=None, plot_all_stns=True)[source]

Plots the data from a .scanmseed file with annotations illustrating the trigger results: event triggers and marginal windows on the coalescence traces, and map and cross section view of the gridded triggered earthquake locations.

Parameters
  • events (pandas.DataFrame) – Triggered events information, columns: [“EventID”, “CoaTime”, “TRIG_COA”, “COA_X”, “COA_Y”, “COA_Z”, “MinTime”, “MaxTime”, “COA”, “COA_NORM”].

  • starttime (obspy.UTCDateTime) – Start time of trigger run.

  • endtime (obspy.UTCDateTime) – End time of trigger run.

  • run (Run object) – Light class encapsulating i/o path information for a given run.

  • marginal_window (float) – Time window over which to marginalise the 4D coalescence function.

  • min_event_interval (float) – Minimum time interval between triggered events.

  • detection_threshold (array-like) – Coalescence value above which to trigger events.

  • normalise_coalescence (bool) – If True, use coalescence normalised by the average coalescence value in the 3-D grid at each timestep.

  • lut (LUT object) – Contains the traveltime lookup tables for the selected seismic phases, computed for some pre-defined velocity model.

  • data (pandas.DataFrame) – Data output by detect() – continuous scan, columns: [“COA”, “COA_N”, “X”, “Y”, “Z”]

  • region (list) – Geographical region within which to trigger earthquakes; events located outside this region will be discarded.

  • discarded_events (pandas.DataFrame) – Discarded triggered events information, columns: [“EventID”, “CoaTime”, “TRIG_COA”, “COA_X”, “COA_Y”, “COA_Z”, “MinTime”, “MaxTime”, “COA”, “COA_NORM”].

  • interactive (bool) – Toggles whether to produce an interactive plot.

  • xy_files (str, optional) –

    Path to comma-separated value file (.csv) containing a series of coordinate files to plot. Columns: [“File”, “Color”, “Linewidth”, “Linestyle”], where “File” is the absolute path to the file containing the coordinates to be plotted. E.g: “/home/user/volcano_outlines.csv,black,0.5,-“. Each .csv coordinate file should contain coordinates only, with columns: [“Longitude”, “Latitude”]. E.g.: “-17.5,64.8”. Lines pre-pended with # will be treated as a comment - this can be used to include references. See the Volcanotectonic_Iceland example XY_files for a template.

    Note

    Do not include a header line in either file.

  • plot_all_stns (bool, optional) – If true, plot all stations used for detect. Otherwise, only plot stations which for which some data was available during the trigger time window. NOTE: if no station availability data is found, all stations in the LUT will be plotted. (Default, True)