RigolWFM
=========
by Scott Prahl
A utility to process Rigol oscilloscope ``.wfm`` files
------------------------------------------------------
.. image:: https://img.shields.io/pypi/v/RigolWFM?color=73C449
:target: https://pypi.org/project/RigolWFM/
:alt: pypi
.. image:: https://img.shields.io/github/v/tag/scottprahl/RigolWFM?label=github&color=73C449
:target: https://github.com/scottprahl/RigolWFM
:alt: github
.. image:: https://img.shields.io/conda/vn/conda-forge/RigolWFM?label=conda&color=73C449
:target: https://github.com/conda-forge/RigolWFM-feedstock
:alt: conda
.. image:: https://img.shields.io/badge/kaitai-struct-green.svg
:target: https://ide.kaitai.io
:alt: kaitai-struct
.. image:: https://zenodo.org/badge/244228290.svg
:target: https://zenodo.org/badge/latestdoi/244228290
:alt: doi
|
.. image:: https://img.shields.io/github/license/scottprahl/RigolWFM?color=73C449
:target: https://github.com/scottprahl/RigolWFM/blob/master/LICENSE.txt
:alt: License
.. image:: https://github.com/scottprahl/RigolWFM/actions/workflows/test.yaml/badge.svg
:target: https://github.com/scottprahl/RigolWFM/actions/workflows/test.yaml
:alt: Testing
.. image:: https://readthedocs.org/projects/RigolWFM/badge
:target: https://RigolWFM.readthedocs.io
:alt: Docs
.. image:: https://img.shields.io/pypi/dm/RigolWFM?color=73C449
:target: https://pypi.org/project/RigolWFM/
:alt: Downloads
__________
This project is intended to be a comprehensive resource for interpreting waveform ``.wmf`` files created by any Rigol oscilloscope. Open source (and Rigol's own applications) that parse/convert Rigol's binary ``.wfm`` files are sadly balkanized: each program tends to support a single oscilloscope group and the available efforts are spread across a range of languages.
This project leverages a domain specific language (kaitai struct) to represent the binary files. Once a binary file has been described in this text format, parsers can be generated for a wide range of languages (C++/STL, C#, Go, Java, JavaScript, Lua, Perl, PHP, Python, and Ruby).
Documentation can be found at <https://RigolWFM.readthedocs.io>
Installation
---------------
You can install locally using pip::
pip install --user RigolWFM
or ``conda``::
conda install -c conda-forge RigolWFM
or use immediately by clicking the Google Colaboratory button below
.. image:: https://colab.research.google.com/assets/colab-badge.svg
:target: https://colab.research.google.com/github/scottprahl/RigolWFM/blob/master
:alt: Colab
or `analyze your files using the kaitai struct IDE <https://ide.kaitai.io>`_ (you will need to manually upload the appropriate `.ksy` file and your `.wfm` to the IDE). This allows one to interactively reverse engineer binary file formats directly in your browser. This is super helpful for those Rigol ``.wfm`` formats that are undocumented or not parsing correctly.
Usage
-----
Once ``RigolWFM`` is installed, you can plot the signals from binary Rigol ``.wfm`` files by::
import matplotlib.pyplot as plt
import RigolWFM.wfm as rigol
filename = 'example.wfm'
scope = 'DS1000E'
w = rigol.Wfm.from_file(filename, scope)
w.plot()
plt.show()
Alternatively, ``wfmconvert`` can be used from the command line. For example, the following should convert all the DS1000E files in the current directory to the ``.csv`` format::
prompt> wfmconvert E csv *.wfm
If you just wanted to convert channel 1 from a single file to ``.csv`` then::
prompt> wfmconvert --channel 1 E csv DS1102E.wfm
If you wanted to a signal `.wav` file using the second channel waveform (for use with LTspice) then::
prompt> wfmconvert --channel 2 E wav *.wfm
If you want to create a ``.wav`` file with channels one and four as signals (and autoscale for use with Audacity or Sigrok Pulseview)::
prompt> wfmconvert --autoscale --channel 14 E wav *.wfm
Status
------
There is a bit of work remaining (testing, validation, repackaging) but there are binary file descriptions for ``.wfm`` files created by the following scopes:
* DS1000B tested
* DS1000C tested (two files only)
* DS1000D tested (one file only)
* DS1000E tested
* DS1000Z tested, but with wonky voltage offsets
* DS2000 tested
* DS4000 tested
* DS6000 untested
Resources
---------
This has been a bit of an adventure. In the process of nailing down the basic formats, I have gleaned information from a wide range of projects started by others.
* Shein's Pascal program <https://sourceforge.net/projects/wfmreader>
* Wagenaars's Matlab script <https://www.mathworks.com/matlabcentral/fileexchange/18999-read-binary-rigol-waveforms>
* Steele's C program <http://nsweb.tn.tudelft.nl/~gsteele/rigol2dat>
* Blaicher's python code <https://github.com/mabl/pyRigolWFM>
* Szkutnik's python code <https://github.com/michal-szkutnik/pyRigolWfm1000Z>
* Cat-Ion's python code <https://github.com/Cat-Ion/rigol-ds4000-wfm>
* Ć olc's python code <https://www.tablix.org/~avian/blog/archives/2019/08/quick_and_ugly_wfm_data_export_for_rigol_ds2072a/>
* Contributions from <http://www.hakasoft.com.au/wfm_viewer>
* A LabView program I got from Rigol support
* Rigol's documentation of the 1000E, 1000Z, 2000, and 6000 file formats.
Source code repository
-------------------------------------------
<https://github.com/scottprahl/RigolWFM>
License
-------
BSD 3-clause -- see the file ``LICENSE`` for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/scottprahl/RigolWFM.git",
"name": "RigolWFM",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "Rigol,wfm,DS1000B,DS1074B,DS1104B,DS1204B,DS1000C,DS1000CD,DS1000M,DS1000MD,DS1042C,DS1102CA,DS1202CA,DS1302CA,DS1062CA,DS1000D,DS1102D,DS1052D,DS1102D,DS1000E,DS1052E,DS1102E,DS1000Z,DS1054Z,MSO1054Z,DS1074Z,DS1074Z-S,MSO1074Z,DS1104Z,DS1104Z-S,MSO1104Z,DS1202Z,DS2000,DS2072A,DS2102A,MSO2102A,MSO2102A-S,DS2202A,MSO2202A,MSO2202A-S,DS2302A,MSO2302A,MSO2302A-S,DS4000,DS4012,MSO4012,DS4014,MSO4014,DS4022,MSO4022,DS4024,MSO4024,DS4032,MSO4032,DS4034,MSO4034,DS4052,MSO4052,DS4054,MSO4054,DS6000,DS6062,DS6064,DS6102,DS6104",
"author": "Scott Prahl",
"author_email": "scott.prahl@oit.edu",
"download_url": "https://files.pythonhosted.org/packages/52/35/7b6652049952658659f415e40cb65ae2c56f64c057bc3aef451a7b63adb9/RigolWFM-1.0.0.tar.gz",
"platform": null,
"description": "RigolWFM\n=========\n\nby Scott Prahl\n\nA utility to process Rigol oscilloscope ``.wfm`` files\n------------------------------------------------------\n\n.. image:: https://img.shields.io/pypi/v/RigolWFM?color=73C449\n :target: https://pypi.org/project/RigolWFM/\n :alt: pypi\n\n.. image:: https://img.shields.io/github/v/tag/scottprahl/RigolWFM?label=github&color=73C449\n :target: https://github.com/scottprahl/RigolWFM\n :alt: github\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/RigolWFM?label=conda&color=73C449\n :target: https://github.com/conda-forge/RigolWFM-feedstock\n :alt: conda\n\n.. image:: https://img.shields.io/badge/kaitai-struct-green.svg\n :target: https://ide.kaitai.io\n :alt: kaitai-struct\n\n.. image:: https://zenodo.org/badge/244228290.svg\n :target: https://zenodo.org/badge/latestdoi/244228290\n :alt: doi\n\n|\n\n.. image:: https://img.shields.io/github/license/scottprahl/RigolWFM?color=73C449\n :target: https://github.com/scottprahl/RigolWFM/blob/master/LICENSE.txt\n :alt: License\n\n.. image:: https://github.com/scottprahl/RigolWFM/actions/workflows/test.yaml/badge.svg\n :target: https://github.com/scottprahl/RigolWFM/actions/workflows/test.yaml\n :alt: Testing\n\n.. image:: https://readthedocs.org/projects/RigolWFM/badge\n :target: https://RigolWFM.readthedocs.io\n :alt: Docs\n\n.. image:: https://img.shields.io/pypi/dm/RigolWFM?color=73C449\n :target: https://pypi.org/project/RigolWFM/\n :alt: Downloads\n\n__________\n\nThis project is intended to be a comprehensive resource for interpreting waveform ``.wmf`` files created by any Rigol oscilloscope. Open source (and Rigol's own applications) that parse/convert Rigol's binary ``.wfm`` files are sadly balkanized: each program tends to support a single oscilloscope group and the available efforts are spread across a range of languages.\n\nThis project leverages a domain specific language (kaitai struct) to represent the binary files. Once a binary file has been described in this text format, parsers can be generated for a wide range of languages (C++/STL, C#, Go, Java, JavaScript, Lua, Perl, PHP, Python, and Ruby). \n\nDocumentation can be found at <https://RigolWFM.readthedocs.io>\n\nInstallation\n---------------\n\nYou can install locally using pip::\n \n pip install --user RigolWFM\n\nor ``conda``::\n\n conda install -c conda-forge RigolWFM\n\nor use immediately by clicking the Google Colaboratory button below\n\n.. image:: https://colab.research.google.com/assets/colab-badge.svg\n :target: https://colab.research.google.com/github/scottprahl/RigolWFM/blob/master\n :alt: Colab\n\nor `analyze your files using the kaitai struct IDE <https://ide.kaitai.io>`_ (you will need to manually upload the appropriate `.ksy` file and your `.wfm` to the IDE). This allows one to interactively reverse engineer binary file formats directly in your browser. This is super helpful for those Rigol ``.wfm`` formats that are undocumented or not parsing correctly.\n\n\nUsage\n-----\n\nOnce ``RigolWFM`` is installed, you can plot the signals from binary Rigol ``.wfm`` files by::\n\n import matplotlib.pyplot as plt\n import RigolWFM.wfm as rigol\n\n filename = 'example.wfm'\n scope = 'DS1000E'\n\n w = rigol.Wfm.from_file(filename, scope)\n w.plot()\n plt.show()\n\n\nAlternatively, ``wfmconvert`` can be used from the command line. For example, the following should convert all the DS1000E files in the current directory to the ``.csv`` format::\n\n prompt> wfmconvert E csv *.wfm\n\nIf you just wanted to convert channel 1 from a single file to ``.csv`` then::\n\n prompt> wfmconvert --channel 1 E csv DS1102E.wfm\n\nIf you wanted to a signal `.wav` file using the second channel waveform (for use with LTspice) then:: \n\n prompt> wfmconvert --channel 2 E wav *.wfm\n\nIf you want to create a ``.wav`` file with channels one and four as signals (and autoscale for use with Audacity or Sigrok Pulseview)::\n\n prompt> wfmconvert --autoscale --channel 14 E wav *.wfm\n\nStatus\n------\n\nThere is a bit of work remaining (testing, validation, repackaging) but there are binary file descriptions for ``.wfm`` files created by the following scopes:\n\n* DS1000B tested \n* DS1000C tested (two files only)\n* DS1000D tested (one file only)\n* DS1000E tested\n* DS1000Z tested, but with wonky voltage offsets\n* DS2000 tested\n* DS4000 tested\n* DS6000 untested\n\nResources\n---------\n\nThis has been a bit of an adventure. In the process of nailing down the basic formats, I have gleaned information from a wide range of projects started by others.\n\n\n* Shein's Pascal program <https://sourceforge.net/projects/wfmreader>\n* Wagenaars's Matlab script <https://www.mathworks.com/matlabcentral/fileexchange/18999-read-binary-rigol-waveforms>\n* Steele's C program <http://nsweb.tn.tudelft.nl/~gsteele/rigol2dat>\n* Blaicher's python code <https://github.com/mabl/pyRigolWFM>\n* Szkutnik's python code <https://github.com/michal-szkutnik/pyRigolWfm1000Z>\n* Cat-Ion's python code <https://github.com/Cat-Ion/rigol-ds4000-wfm>\n* \u0160olc's python code <https://www.tablix.org/~avian/blog/archives/2019/08/quick_and_ugly_wfm_data_export_for_rigol_ds2072a/>\n* Contributions from <http://www.hakasoft.com.au/wfm_viewer>\n* A LabView program I got from Rigol support\n* Rigol's documentation of the 1000E, 1000Z, 2000, and 6000 file formats.\n\n\nSource code repository\n-------------------------------------------\n\n <https://github.com/scottprahl/RigolWFM>\n\nLicense\n-------\n BSD 3-clause -- see the file ``LICENSE`` for details.\n",
"bugtrack_url": null,
"license": "BSD 3-clause",
"summary": "Read and parse Rigol Oscilloscope WFM files",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/scottprahl/RigolWFM.git"
},
"split_keywords": [
"rigol",
"wfm",
"ds1000b",
"ds1074b",
"ds1104b",
"ds1204b",
"ds1000c",
"ds1000cd",
"ds1000m",
"ds1000md",
"ds1042c",
"ds1102ca",
"ds1202ca",
"ds1302ca",
"ds1062ca",
"ds1000d",
"ds1102d",
"ds1052d",
"ds1102d",
"ds1000e",
"ds1052e",
"ds1102e",
"ds1000z",
"ds1054z",
"mso1054z",
"ds1074z",
"ds1074z-s",
"mso1074z",
"ds1104z",
"ds1104z-s",
"mso1104z",
"ds1202z",
"ds2000",
"ds2072a",
"ds2102a",
"mso2102a",
"mso2102a-s",
"ds2202a",
"mso2202a",
"mso2202a-s",
"ds2302a",
"mso2302a",
"mso2302a-s",
"ds4000",
"ds4012",
"mso4012",
"ds4014",
"mso4014",
"ds4022",
"mso4022",
"ds4024",
"mso4024",
"ds4032",
"mso4032",
"ds4034",
"mso4034",
"ds4052",
"mso4052",
"ds4054",
"mso4054",
"ds6000",
"ds6062",
"ds6064",
"ds6102",
"ds6104"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "120a23dcef1336c2c930dc11f2bfffedae1bdbe9658da2825fe46136d6876682",
"md5": "60594b3f0c6f6f38b88ba03ae2e80024",
"sha256": "098addee3de49b70bafd8d461ca414a3c2441b88f1cd983d5ceb5fb276ff46fb"
},
"downloads": -1,
"filename": "RigolWFM-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "60594b3f0c6f6f38b88ba03ae2e80024",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 33333,
"upload_time": "2023-10-06T22:39:57",
"upload_time_iso_8601": "2023-10-06T22:39:57.456768Z",
"url": "https://files.pythonhosted.org/packages/12/0a/23dcef1336c2c930dc11f2bfffedae1bdbe9658da2825fe46136d6876682/RigolWFM-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "52357b6652049952658659f415e40cb65ae2c56f64c057bc3aef451a7b63adb9",
"md5": "00b553b90a6f68dd0ba41a54880e22c8",
"sha256": "fb61ab23d73ff414b39bfea9b077d94f28d032315df8a73070b18227b00a2894"
},
"downloads": -1,
"filename": "RigolWFM-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "00b553b90a6f68dd0ba41a54880e22c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 28185,
"upload_time": "2023-10-06T22:39:58",
"upload_time_iso_8601": "2023-10-06T22:39:58.534331Z",
"url": "https://files.pythonhosted.org/packages/52/35/7b6652049952658659f415e40cb65ae2c56f64c057bc3aef451a7b63adb9/RigolWFM-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-06 22:39:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "scottprahl",
"github_project": "RigolWFM",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "rigolwfm"
}