.. _gallery:

=======
Gallery
=======

**Click on any image to see full size image and source code**

.. raw:: html

    <div class="row">

.. gallery-plot:: tutorial/code_snippets/reading_seismograms.py
    :target: tutorial/code_snippets/reading_seismograms.html
    :alt: Reading Seismograms

.. gallery-plot:: tutorial/code_snippets/waveform_plotting_tutorial_1.py
    :target: tutorial/code_snippets/waveform_plotting_tutorial.html
    :alt: Basic Plotting

.. gallery-plot:: tutorial/code_snippets/waveform_plotting_tutorial_2.py
    :target: tutorial/code_snippets/waveform_plotting_tutorial.html#customized-plots
    :alt: Customized Plots

.. gallery-plot:: tutorial/code_snippets/waveform_plotting_tutorial_3.py
    :target: tutorial/code_snippets/waveform_plotting_tutorial.html#plotting-multiple-channels
    :alt: Plotting multiple Channels

.. gallery-plot:: tutorial/code_snippets/waveform_plotting_tutorial_4.py
    :target: tutorial/code_snippets/waveform_plotting_tutorial.html#creating-a-one-day-plot
    :alt: Creating a One-Day Plot

.. gallery-plot:: tutorial/code_snippets/waveform_plotting_tutorial_6.py
    :target: tutorial/code_snippets/waveform_plotting_tutorial.html#plotting-a-record-section
    :alt: Plotting a Record Section

.. gallery-plot:: tutorial/code_snippets/filtering_seismograms.py
    :target: tutorial/code_snippets/filtering_seismograms.html
    :alt: Filtering Seismograms

.. gallery-plot:: tutorial/code_snippets/downsampling_seismograms.py
    :target: tutorial/code_snippets/downsampling_seismograms.html
    :alt: Downsampling Seismograms

.. gallery-plot:: tutorial/code_snippets/seismogram_envelopes.py
    :target: tutorial/code_snippets/seismogram_envelopes.html
    :alt: Seismogram Envelopes

.. gallery-plot:: tutorial/code_snippets/seismometer_correction_simulation_1.py
    :target: tutorial/code_snippets/seismometer_correction_simulation.html
    :alt: Seismometer Correction/Simulation

.. gallery-plot:: tutorial/code_snippets/seismometer_correction_simulation_5.py
    :target: tutorial/code_snippets/seismometer_correction_simulation.html
    :alt: Seismometer Correction/Simulation

.. gallery-plot:: tutorial/code_snippets/plotting_spectrograms.py
    :target: tutorial/code_snippets/plotting_spectrograms.html
    :alt: Plotting Spectrograms

.. gallery-plot:: tutorial/code_snippets/trigger_tutorial_classic_sta_lta.py
    :target: tutorial/code_snippets/trigger_tutorial.html#trigger-examples
    :alt: Classic Sta Lta

.. gallery-plot:: tutorial/code_snippets/trigger_tutorial_z_detect.py
    :target: tutorial/code_snippets/trigger_tutorial.html#trigger-examples
    :alt: Z-Detect

.. gallery-plot:: tutorial/code_snippets/trigger_tutorial_recursive_sta_lta.py
    :target: tutorial/code_snippets/trigger_tutorial.html#trigger-examples
    :alt: Recursive Sta Lta

.. gallery-plot:: tutorial/code_snippets/frequency_response.py
    :target: tutorial/code_snippets/frequency_response.html
    :alt: Poles and Zeros, Frequency Response

.. gallery-plot:: tutorial/code_snippets/beachball_plot.py
    :target: tutorial/code_snippets/beachball_plot.html
    :alt: Beachball Plot

.. gallery-plot:: tutorial/code_snippets/basemap_plot_with_beachballs.py
    :target: tutorial/code_snippets/basemap_plot_with_beachballs.html
    :alt: Basemap Plot with Beachballs

.. gallery-plot:: tutorial/code_snippets/basemap_plot_with_beachballs2.py
    :target: tutorial/code_snippets/basemap_plot_with_beachballs.html
    :alt: Second Basemap Plot with Beachballs

.. gallery-plot:: tutorial/code_snippets/basemap_with_beachball_read_events.py
    :target: tutorial/code_snippets/basemap_plot_with_beachballs.html
    :alt: Basemap Plot with Beachball read_events

.. gallery-plot:: tutorial/code_snippets/merging_seismograms.py
    :target: tutorial/code_snippets/merging_seismograms.html
    :alt: Merging Seismograms

.. gallery-plot:: tutorial/code_snippets/beamforming_fk_analysis_1.py
    :target: tutorial/code_snippets/beamforming_fk_analysis.html
    :alt: Beamforming - FK Analysis

.. gallery-plot:: tutorial/code_snippets/beamforming_fk_analysis_2.py
    :target: tutorial/code_snippets/beamforming_fk_analysis.html
    :alt: Beamforming - FK Analysis

.. gallery-plot:: tutorial/code_snippets/hierarchical_clustering.py
    :target: tutorial/code_snippets/hierarchical_clustering.html
    :alt: Hierarchical Clustering

.. gallery-plot:: tutorial/code_snippets/probabilistic_power_spectral_density.py
    :target: tutorial/code_snippets/probabilistic_power_spectral_density.html
    :alt: Visualizing Probabilistic Power Spectral Densities

.. gallery-plot:: tutorial/code_snippets/probabilistic_power_spectral_density3.py
    :target: tutorial/code_snippets/probabilistic_power_spectral_density.html
    :alt: Visualizing Probabilistic Power Spectral Densities

.. gallery-plot:: tutorial/code_snippets/probabilistic_power_spectral_density4.py
    :target: tutorial/code_snippets/probabilistic_power_spectral_density.html
    :alt: Visualizing Probabilistic Power Spectral Densities

.. gallery-plot:: tutorial/code_snippets/probabilistic_power_spectral_density5.py
    :target: tutorial/code_snippets/probabilistic_power_spectral_density.html
    :alt: Visualizing Probabilistic Power Spectral Densities

.. gallery-plot:: tutorial/code_snippets/array_response_function.py
    :target: tutorial/code_snippets/array_response_function.html
    :alt: Array Response Function

.. gallery-plot:: tutorial/code_snippets/continuous_wavelet_transform_obspy.py
    :target: tutorial/code_snippets/continuous_wavelet_transform.html
    :alt: Continuous Wavelet Transform (ObsPy)

.. gallery-plot:: tutorial/code_snippets/continuous_wavelet_transform_mlpy.py
    :target: tutorial/code_snippets/continuous_wavelet_transform.html
    :alt: Continuous Wavelet Transform (MLPY)

.. gallery-plot:: tutorial/code_snippets/time_frequency_misfit_ex1.py
    :target: tutorial/code_snippets/time_frequency_misfit.html#plot-the-time-frequency-representation
    :alt: Plot the Time Frequency Representation

.. gallery-plot:: tutorial/code_snippets/time_frequency_misfit_ex2.py
    :target: tutorial/code_snippets/time_frequency_misfit.html#plot-the-time-frequency-misfits
    :alt: Time Frequency Misfit

.. gallery-plot:: tutorial/code_snippets/plot_travel_times.py
    :target: tutorial/code_snippets/travel_time.html#travel-time-plot
    :alt: Travel Time Plot

.. gallery-plot:: tutorial/code_snippets/travel_time_cartesian_raypath.py
    :target: tutorial/code_snippets/travel_time.html#cartesian-ray-paths
    :alt: Cartesian Ray Paths

.. gallery-plot:: tutorial/code_snippets/travel_time_spherical_raypath.py
    :target: tutorial/code_snippets/travel_time.html#spherical-ray-paths
    :alt: Spherical Ray Paths

.. gallery-plot:: tutorial/code_snippets/plot_ray_paths.py
    :target: tutorial/code_snippets/travel_time.html#ray-path-plot
    :alt: Ray Path Plot

.. gallery-plot:: tutorial/code_snippets/travel_time_body_waves.py
    :target: tutorial/code_snippets/travel_time.html#travel-time-body-waves
    :alt: Body Wave Ray Paths

.. gallery-plot:: tutorial/code_snippets/xcorr_pick_correction.py
    :target: tutorial/code_snippets/xcorr_pick_correction.html
    :alt: Cross-Correlation Pick Correction

.. gallery-plot::
    :target: tutorial/code_snippets/xcorr_detector.html
    :alt: Cross-Correlation Detector

    from obspy import read, Trace, UTCDateTime as UTC
    from obspy.signal.cross_correlation import correlation_detector

    stream = read('https://examples.obspy.org/NKC_PLN_ROHR.HHZ.2018.130.mseed')
    stream.filter('highpass', freq=1, zerophase=True)
    otimes = [UTC('2018-05-10 14:24:50'), UTC('2018-05-10 19:42:08')]
    templates = []
    for otime in otimes:
        template = stream.select(station='NKC').slice(otime + 2, otime + 7)
        template += stream.select(station='ROHR').slice(otime + 2, otime + 7)
        template += stream.select(station='PLN').slice(otime + 6, otime + 12)
        templates.append(template)
    height = 0.5  # similarity threshold
    distance = 10  # distance between detections in seconds
    template_names = ['1st template', '2nd template']
    detections, sims = correlation_detector(stream, templates, height, distance, plot=stream, template_names=template_names)

.. gallery-plot::
    :target: packages/autogen/obspy.core.inventory.inventory.Inventory.plot.html
    :alt: Basemap preview plot of Inventory class

    from obspy import read_inventory
    inv = read_inventory()
    inv.plot(projection="local", color_per_network={'GR': 'blue', 'BW': 'green'})

.. gallery-plot::
    :target: packages/autogen/obspy.core.inventory.network.Network.plot.html
    :alt: Basemap preview plot of Network class

    from obspy import read_inventory
    net = read_inventory()[0]
    net.plot(projection="ortho")

.. gallery-plot::
    :target: packages/autogen/obspy.core.event.catalog.Catalog.plot.html
    :alt: Basemap preview plot of Catalog class

    from obspy import read_events
    cat = read_events()
    cat.plot()

.. gallery-plot::
    :target: packages/autogen/obspy.core.inventory.inventory.Inventory.plot_response.html
    :alt: Bode plot of Inventory class

    from obspy import read_inventory
    inv = read_inventory()
    inv.plot_response(0.001, station="RJOB")

.. gallery-plot::
    :target: packages/autogen/obspy.core.inventory.inventory.Inventory.plot_response.html
    :alt: Bode plot of Inventory indicating different epochs

    from obspy import read_inventory
    inv = read_inventory()
    inv = inv.select(station='RJOB', channel='EHZ')
    inv.plot_response(0.001, label_epoch_dates=True)

.. gallery-plot::
    :target: packages/autogen/obspy.core.inventory.response.Response.plot.html
    :alt: Bode plot of Response class

    from obspy import read_inventory
    resp = read_inventory()[0][0][0].response
    resp.plot(0.001, output="VEL")

.. gallery-plot::
    :target: packages/autogen/obspy.signal.interpolation.plot_lanczos_windows.html
    :alt: Plot the Lanczos windows.

    import matplotlib.pyplot as plt

    plt.figure(figsize=(10, 12))
    from obspy.signal.interpolation import plot_lanczos_windows
    plot_lanczos_windows(a=20)

.. gallery-plot::
    :target: packages/autogen/obspy.core.inventory.inventory.Inventory.plot.html
    :alt: Basemap plot of station and event data together

    from obspy import read_inventory, read_events
    inv = read_inventory()
    cat = read_events()
    fig = inv.plot(show=False)
    cat.plot(fig=fig)

.. gallery-plot::
    :target: packages/autogen/obspy.signal.detrend.polynomial.html
    :alt: Polynomial detrending

    import obspy
    from obspy.signal.detrend import polynomial

    tr = obspy.read()[0].filter("highpass", freq=2)
    tr.data += 6000 + 4 * tr.times() ** 2 - 0.1 * tr.times() ** 3 - \
        0.00001 * tr.times() ** 5

    polynomial(tr.data, order=3, plot=True)

.. gallery-plot::
    :target: packages/autogen/obspy.core.event.event.Event.plot.html
    :alt: Event plot

    from obspy import read_events
    event = read_events("/path/to/CMTSOLUTION")[0]
    event.plot()

.. gallery-plot::
    :target: packages/autogen/obspy.core.event.event.Event.plot.html
    :alt: Event plot

    from obspy import read_events
    event = read_events("/path/to/CMTSOLUTION")[0]
    event.plot(kind=[['global'], ['p_sphere', 'p_quiver']])

.. image:: /_static/sds_report.png
    :target: packages/autogen/obspy.scripts.sds_html_report.html
    :alt: SDS html report
    :scale: 50%

Colormap comparison
===================

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import _colormap_plot_overview
    _colormap_plot_overview()

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import viridis, viridis_r, viridis_white, viridis_white_r
    from obspy.imaging.cm import _colormap_plot_cwt
    _colormap_plot_cwt([viridis, viridis_r, viridis_white, viridis_white_r])

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import viridis, viridis_r, viridis_white, viridis_white_r
    from obspy.imaging.cm import _colormap_plot_array_response
    _colormap_plot_array_response([viridis, viridis_r, viridis_white, viridis_white_r])

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import viridis, viridis_r, viridis_white, viridis_white_r
    from obspy.imaging.cm import _colormap_plot_similarity
    _colormap_plot_similarity([viridis, viridis_r, viridis_white, viridis_white_r])

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import viridis, viridis_r, viridis_white, viridis_white_r
    from obspy.imaging.cm import _colormap_plot_beamforming_time
    _colormap_plot_beamforming_time([viridis, viridis_r, viridis_white, viridis_white_r])

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import viridis, viridis_r, viridis_white, viridis_white_r
    from obspy.imaging.cm import _colormap_plot_beamforming_polar
    _colormap_plot_beamforming_polar([viridis, viridis_r, viridis_white, viridis_white_r])

.. gallery-plot::
    :target: packages/autogen/obspy.imaging.cm.html
    :alt: Colormap comparisons

    from obspy.imaging.cm import viridis, viridis_r, viridis_white, viridis_white_r, pqlx
    from obspy.imaging.cm import _colormap_plot_ppsd
    _colormap_plot_ppsd([viridis, viridis_r, viridis_white, viridis_white_r, pqlx])

.. raw:: html

    </div>
