A simple GUI for viewing waveforms.
Project description
Wave Viewer
A simple GUI for viewing waveforms. It plots the waveform with vispy in a separate process. The GUI is built with PySide6.
The WaveViewer
class is the main interface for the wave_viewer package. It
provides methods for adding and removing lines from the plot, clearing the plot,
and closing the GUI.
Installation
pip install wave-viewer
Usage
Below is a simple example of how to use the WaveViewer
class. Avoid calling
clear
if you only want to update the plot. It is more efficient to update the
plot with add_line
.
from wave_viewer import WaveViewer
import numpy as np
# This if statement is required for multiprocessing on Windows
if __name__ == "__main__":
# Create the viewer
viewer = WaveViewer()
# Add a line to the plot
x = np.arange(100000) / 2e9
y = np.exp(1j * 2 * np.pi * 1e6 * x)
ys = [y.real, y.imag]
viewer.add_line("line1", x, ys, offset=0)
# Add another line to the plot
viewer.add_line("line2", x, ys, offset=2)
# Auto scale the plot
viewer.autoscale()
# Remove the first line
viewer.remove_line("line1")
# Replace the second line
y = np.exp(1j * 2 * np.pi * 2e6 * x)
ys = [y.real, y.imag]
viewer.add_line("line2", x, ys, offset=2)
# Clear the plot
viewer.clear()
# Close the GUI
viewer.close()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wave_viewer-0.2.2.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file wave_viewer-0.2.2.tar.gz
.
File metadata
- Download URL: wave_viewer-0.2.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.10 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e18405682a4ec389f1bc85dcddba5d6918f157d5175956905703667b9d490b9d |
|
MD5 | 82dfc81f8f2b872b477185ee4678865b |
|
BLAKE2b-256 | 4686accbc8963545acaa8e7c1e21bd2825f88d61a7cd564d0ce5fb3788b94340 |
File details
Details for the file wave_viewer-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: wave_viewer-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.10 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a6fe1e8f576e04452acc7cdc645c2b9909b8795c4b0d6019d4d93fe90f522f |
|
MD5 | a15e0d3b5bca0476a42f33b44a43f27d |
|
BLAKE2b-256 | a1b0de54379dbf74f662cde042184eeac493423035947eb871d257cf6cb1bbf3 |