test_pplot

Test the general functionality of the PrettyPlot waveform plotter (pplot).

Note

Most tests only make figures to check that the machinery runs. Merging, response removal and the command line entry point are checked against expected values.

Attributes

Functions

fid_bhz(tmpdir)

Write a single gap-free channel to its own file

fids_bhz(tmpdir)

Write the three gap-free BHZ channels to one file each

_run(fids, tmpdir, **kwargs)

Run PrettyPlot without showing the figure and check the saved figure

test_default_plot(fid_bhz, tmpdir)

Plot raw data on a relative time axis, trimmed with xlim

test_relative_time_units(fid_bhz, tmpdir)

xlim is given in the units of time, here minutes

test_response_removal_and_spectrogram(fid_bhz, tmpdir)

Remove the response, filter and add a spectrogram in local time

test_response_removal_inventory_object(fid_bhz, tmpdir)

inv also accepts an ObsPy Inventory

test_fast_remove_response_matches_obspy()

The interpolated response matches ObsPy's to a small tolerance

test_merge_gappy_file(tmpdir)

merge joins the segments of a gappy channel into one trace

test_merge_stream_fill_values()

merge_stream accepts numbers and rejects unknown fill methods

test_wf_types(fids_bhz, tmpdir, wf_type)

Overlain, stacked and record section plots of several files

test_grid_plot(fids_bhz, tmpdir)

Grid plot with per-subplot y-limits

test_grid_with_spectrogram_fails(fid_bhz)

Spectrograms cannot be combined with grid plots

test_colors_colormap(fids_bhz, tmpdir)

A colormap name is sampled into one color per trace

test_tmarks_taup_group_vels(fid_bhz, tmpdir)

Time marks, TauP arrivals and group velocities on relative time

test_add_trace(fid_bhz, tmpdir)

Overlay a second time series on a twin y-axis

test_read_specfem_synthetic(tmpdir)

SPECFEM two-column ASCII is read with PySEP's read_sem

test_command_line(fid_bhz, tmpdir, monkeypatch)

The pplot entry point turns the negative flags into keywords

Module Contents

test_pplot.TEST_DATA[source]
test_pplot.MSEED[source]
test_pplot.INV[source]
test_pplot.SYN[source]
test_pplot.fid_bhz(tmpdir)[source]

Write a single gap-free channel to its own file

Parameters:

tmpdir (py.path.local) – pytest temporary directory

Return type:

str

Returns:

path to the MiniSEED file holding AK.BESE..BHZ

test_pplot.fids_bhz(tmpdir)[source]

Write the three gap-free BHZ channels to one file each

Parameters:

tmpdir (py.path.local) – pytest temporary directory

Return type:

list of str

Returns:

paths to the three MiniSEED files

test_pplot._run(fids, tmpdir, **kwargs)[source]

Run PrettyPlot without showing the figure and check the saved figure

Parameters:
  • fids (list of str) – files to plot

  • tmpdir (py.path.local) – pytest temporary directory to save the figure in

Return type:

pysep.pplot.PrettyPlot

Returns:

the PrettyPlot instance after running

test_pplot.test_default_plot(fid_bhz, tmpdir)[source]

Plot raw data on a relative time axis, trimmed with xlim

test_pplot.test_relative_time_units(fid_bhz, tmpdir)[source]

xlim is given in the units of time, here minutes

test_pplot.test_response_removal_and_spectrogram(fid_bhz, tmpdir)[source]

Remove the response, filter and add a spectrogram in local time

test_pplot.test_response_removal_inventory_object(fid_bhz, tmpdir)[source]

inv also accepts an ObsPy Inventory

test_pplot.test_fast_remove_response_matches_obspy()[source]

The interpolated response matches ObsPy’s to a small tolerance

test_pplot.test_merge_gappy_file(tmpdir)[source]

merge joins the segments of a gappy channel into one trace

test_pplot.test_merge_stream_fill_values()[source]

merge_stream accepts numbers and rejects unknown fill methods

test_pplot.test_wf_types(fids_bhz, tmpdir, wf_type)[source]

Overlain, stacked and record section plots of several files

test_pplot.test_grid_plot(fids_bhz, tmpdir)[source]

Grid plot with per-subplot y-limits

test_pplot.test_grid_with_spectrogram_fails(fid_bhz)[source]

Spectrograms cannot be combined with grid plots

test_pplot.test_colors_colormap(fids_bhz, tmpdir)[source]

A colormap name is sampled into one color per trace

test_pplot.test_tmarks_taup_group_vels(fid_bhz, tmpdir)[source]

Time marks, TauP arrivals and group velocities on relative time

test_pplot.test_add_trace(fid_bhz, tmpdir)[source]

Overlay a second time series on a twin y-axis

test_pplot.test_read_specfem_synthetic(tmpdir)[source]

SPECFEM two-column ASCII is read with PySEP’s read_sem

test_pplot.test_command_line(fid_bhz, tmpdir, monkeypatch)[source]

The pplot entry point turns the negative flags into keywords