Repository navigation
Add PrettyPlot (pplot) waveform plotting tool - #189
Merged
Merged
Conversation
Port the standalone `prettyplot.py` script (bch0w/spectral, plotools) into PySEP as `pysep.pplot`, so it is maintained in a stable, installable package. PrettyPlot makes quick, clean figures of individual waveforms: instrument response removal (with a fast interpolated-response option), detrend/taper/filter/integrate/differentiate, overlain, stacked, record section and grid layouts, spectrograms on a shared time axis, merging of gappy or multi-day files, time marks, TauP and group-velocity arrivals, and a second time series on a twin y-axis. Package integration - New command line entry point `pplot` (pyproject.toml) via `main()`; the `PrettyPlot.main()` method is renamed `PrettyPlot.run()` - Export `PrettyPlot` from `pysep/__init__.py` - Import `read_sem` from `pysep.utils.io` directly. The old `from pysep import read_sem` inside try/except ImportError would have silently set `read_sem = None` through a circular import once PrettyPlot is exported from the package, breaking SPECFEM reading - Replace all print() calls with PySEP's shared `logger` (info for progress, warning for warnings, critical before exiting) - Align Python keyword defaults with the CLI defaults (tp_cmap 'rainbow_r', ylabel 'Amplitude', fig_len 8) so both give the same figure - Remove unused imports and an unused marker definition, wrap lines to 80 columns, fix the `--dpi` help text and docstrings that broke the Sphinx/autoapi build Bugfix - `merge_fill` with a number (e.g. `--merge_fill 0`) crashed on integer (raw count) data because ObsPy cannot write a float fill value into an int array; data are now cast to float before a numeric-fill merge Tests - New pysep/tests/test_pplot.py (18 tests) using existing test data: gap merging, response removal (fast path checked against ObsPy), every wf_type, grid y-limits, colormaps, time marks/TauP/group velocities, added trace, SPECFEM ASCII reading and the CLI entry point Docs - New docs page docs/pplot.md, ported from the PrettyPlot README: installation via PySEP, `pplot` commands, `pysep.pplot` imports, MyST image/download syntax so Sphinx copies the assets - Example figures and their make_figures.sh script in docs/pplot_files/ - Add PrettyPlot to docs/index.rst (tool list and toctree) and the top-level README; enable `myst_heading_anchors` in docs/conf.py so in-page Markdown links resolve - CHANGELOG entry; version bumped to 0.8.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Docs are built here: https://pysep.readthedocs.io/en/latest/pplot.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port the standalone
prettyplot.pyscript (https://github.com/bch0w/spectral/blob/master/plotools/prettyplot.py) into PySEP aspysep.pplot. PrettyPlot makes quick, clean figures of individual waveforms: instrument response removal (with a fast interpolated-response option), detrend/taper/filter/integrate/differentiate, overlain, stacked, record section and grid layouts, spectrograms on a shared time axis, merging of gappy or multi-day files, time marks, TauP and group-velocity arrivals, and a second time series on a twin y-axis.Package integration
pplot(pyproject.toml) viamain(); thePrettyPlot.main()method is renamedPrettyPlot.run()Tests
Docs