Rigol 800 control library (unofficial)
Project description
Rigol DHOxxx oscilloscope Python library (unofficial)
Based completely on https://github.com/tspspi/pymso5000/tree/master by tspspi
A simple Python library and utility to control and query data from Rigol DHOxxx oscilloscopes (not supporting all features of the oscilloscope, work in progress). This library implements the Oscilloscope class from the pylabdevs package which exposes the public interface.
Installing
There is a PyPi package that can be installed using
pip install pydho800
Simple example to fetch waveforms:
from pydho800.pydho800 import PYDHO800
with DHO800(address = "10.0.0.123") as dho:
print(f"Identify: {dho.identify()}")
dho.set_channel_enable(0, True)
dho.set_channel_enable(1, True)
data = dho.query_waveform((0, 1))
print(data)
import matplotlib.pyplot as plt
plt.plot(data['x'], data['y0'], label = "Ch1")
plt.plot(data['x'], data['y1'], label = "Ch2")
plt.show()
Note that numpy usage is optional for this implementation.
One can enable numpy support using useNumpy = True in the
constructor.
Querying additional statistics
This module allows - via the pylabdevs base class to query
additional statistics:
meanCalculates the mean values and standard deviations- A single value for each channels mean at
["means"]["yN_avg"]and a single value for each standard deviation at["means"]["yN_std"]whereNis the channel number
- A single value for each channels mean at
fftruns Fourier transform on all queried traces- The result is stored in
["fft"]["yN"](complex values) and in["fft"]["yN_real"]for the real valued Fourier transform. AgainNis the channel number
- The result is stored in
ifftruns inverse Fourier transform on all queried traces- Works as
fftbut runs the inverse Fourier transform and stores its result inifftinstead offft
- Works as
correlatecalculates the correlation between all queried waveform pairs.- The result of the correlations are stored in
["correlation"]["yNyM"]for the correlation between channelsMandN
- The result of the correlations are stored in
autocorrelateperforms calculation of the autocorrelation of each queried channel.- The result of the autocorrelation is stored in
["autocorrelation"]["yN"]for channelN
- The result of the autocorrelation is stored in
To request calculation of statistics pass the string for the
desired statistic or a list of statistics to the stats
parameter of query_waveform:
with DHO800(address = "10.0.0.123") as dho:
data = dho.query_waveform((1,2), stats = [ 'mean', 'fft' ])
Supported methods
More documentation in progress ...
identify()- Connection management (when not using
withcontext management):connect()disconnect()
set_channel_enable(channel, enabled)is_channel_enabled(channel)set_sweep_mode(mode)get_sweep_mode()set_trigger_mode(mode)get_trigger_mode()force_trigger()set_timebase_mode(mode)get_timebase_mode()set_run_mode(mode)get_run_mode()set_timebase_scale(secondsPerDivision)get_timebase_scale()set_channel_coupling(channel, couplingMode)get_channel_coupling(channel)set_channel_probe_ratio(channel, ratio)get_channel_probe_ratio(channel)set_channel_scale(channel, scale)get_channel_scale(channel)query_waveform(channel, stats = None)off()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydho800-0.0.5.tar.gz.
File metadata
- Download URL: pydho800-0.0.5.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f626cd4f04366fb64c363df804850b8d0768a3daf0630feea5968ebf8912093a
|
|
| MD5 |
5b2f817efe8f341bdbca870cd1d8d9ec
|
|
| BLAKE2b-256 |
fc715cd819ebc68636f6457f46959d1c03f448be408aabd7f61680632022d076
|
File details
Details for the file pydho800-0.0.5-py3-none-any.whl.
File metadata
- Download URL: pydho800-0.0.5-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d0ff5f1ba9c36f8994228cb0521cd7e8bb5eb849f461cd317178faa86393ee0
|
|
| MD5 |
2d21d9598fd2141ff5ff5497d02b0a3f
|
|
| BLAKE2b-256 |
51a082c8daf9aed38e8db7ef4bca88863f8895eaf71e73b28c56a77e306c6b01
|