Skip to main content

Parse LeCroy Binary Files.

Project description

lecroyparser

leCroyParser.py parses binary files as written by LeCroy scopes.

leCroyParser.py is derived from the matlab program ReadLeCroyBinaryWaveform.m, available at https://www.mathworks.com/matlabcentral/fileexchange/26375-readlecroybinarywaveform-m, Original version (c)2001 Hochschule fr Technik+Architektur Luzern Fachstelle Elektronik 6048 Horw, Switzerland Slightly modified by Alan Blankman, LeCroy Corporation, 2006

Further elements for the code were taken from pylecroy, written by Steve Bian

A useful resource for modifications is the LeCroy Remote Control Manual available at http://cdn.teledynelecroy.com/files/manuals/dda-rcm-e10.pdf

Lecroyparser has been tested with Python 2.7 and Python 3.6, 3.8

Installation

lecroyparser is available at pip. It may be installed with

pip install lecroyparser

or with

easy_install lecroyparser

Usage

To import a single trace, instantiate a ScopeData object by passing it a path, i.e.

import lecroyparser path = "/home/benno/Dropbox/RESEARCH/bullet/experiments/scopeTraces/201804/C1180421_typicalShot00000.trc" data = lecroyparser.ScopeData(path)

The x and y data are stored as numpy arrays in data.x and data.y

Alternatively, to parse several channels set the optional keyword argument parseAll to True, i.e.

data = lecroyparser.ScopeData(path, parseAll = True)

This will parse all files in the specified folder with a matching filename. I.e., if the provided path is as above, then the files

.. code-block:: console

C2180421_typicalShot00000.trc C3180421_typicalShot00000.trc C4180421_typicalShot00000.trc

will pe parsed as well.

Next to reading files, it is possible to read a binary buffer/string directly. For this, supply the data argument instead of file:

import lecroyparser path = "/home/benno/Dropbox/RESEARCH/bullet/experiments/scopeTraces/201804/C1180421_typicalShot00000.trc" contents = open(path, 'rb').read() data = lecroyparser.ScopeData(data=contents)

This is especially useful when reading data directly from oscilloscope using python-vx11 or similar software.

Additionally, it is possible to limit the number of samples in the output array, by overwriting the sparse keyword:

data = lecroyparser.ScopeData(path, parseAll = True, sparse = 1000)

will limit the samples in the x and y dimensions to 1000.

Information about the file can be obtained by calling print(data)

.. code-block:: console

>>> print(data)

Le Croy Scope Data
Path: /Users/... 
Endianness: <
Instrument: LECROYHDO4104
Instrunemt Number: 19359
Template Name: LECROY\_2\_3
Channel: Channel 4
Vertical Coupling: DC1M
Bandwidth Limit: on
Record Type: single\_sweep
Processing: No Processing &gt;&gt;&gt; TimeBase: 200 ms/div
TriggerTime: 2018-04-21 11:50:45.76

License

MIT License

Copyright (c) 2018-2021 Benno Meier, Jeroen van Oorschot

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

lecroyparser-1.4.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

lecroyparser-1.4.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file lecroyparser-1.4.2.tar.gz.

File metadata

  • Download URL: lecroyparser-1.4.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lecroyparser-1.4.2.tar.gz
Algorithm Hash digest
SHA256 122313fabd29a326537aac93993535574a2252ea59be990a7038fd8b9c8185d6
MD5 64045ab4632c6f2b5a7dadb8075249fd
BLAKE2b-256 976830e89bd4b407e46550d395682d74d771c7dd5d9ee3ec9622c95b33e260da

See more details on using hashes here.

File details

Details for the file lecroyparser-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: lecroyparser-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lecroyparser-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37b0b9f9434122f7691af8400f4294d7735b5a9f8468b88cb5e1c4e2cbac2709
MD5 6d6411319103cf509bb055aa28279f0f
BLAKE2b-256 fd42645990a374945d000e7ce4f19a56c981d250e18253a10bfa4becfb79fbea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page