An unofficial Python package 🐍📦 to interface with Teledyne LeCroy oscilloscopes and read binary trace files (.trc)
Project description
lecroyscope
🤔 What is this?
This is an unofficial Python package to interface with Teledyne LeCroy oscilloscopes and read binary trace
files (*.trc
).
Currently only reading trace files is supported.
This package is based on the lecroy-reader project.
⚠️ Disclaimer
The features of this package are based on my needs at the time of writing. I have done very limited testing, using a single oscilloscope and a few trace files.
If you use this package, it is very possible you find a bug or some oversight. You are encouraged to make a pull request or to create an issue to report a bug, to request additional features or to suggest improvements.
⚙️ Installation
Installation via pip
is supported.
To install the latest published version, run:
pip install lecroyscope
To install the package from source, including test dependencies, clone the repository and run:
pip install .[test]
👨💻 Usage
Reading binary trace files (*.trc
)
from lecroyscope import Trace
trace = Trace("path/to/trace.trc")
Trace file header information can be accessed via the header
attribute:
header = trace.header
# properties can be accessed directly
print("Instrument name: ", header.instrument_name)
# or as python dict
print("Instrument name: ", header["instrument_name"])
# header can also be converted into a python dict
header_dict = dict(header)
print("Header keys: ", list(header_dict.keys()))
The trace data can be accessed via the time
(x
) and voltage
(y
) attributes:
# time values
time = trace.time # trace.x is an alias for trace.time
# channel voltage values
voltage = trace.voltage # trace.y is an alias for trace.voltage
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
Hashes for lecroyscope-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b91cca7c10d407f47409847ae9ec761f542e7fc73d3aa2e099e6e591c36b0b |
|
MD5 | e5599633ae681bf0012c4db8d80732f4 |
|
BLAKE2b-256 | 2278cf35368dd9c5d847d00c237d88369b624dec6f0a6040e30c2411f1ff1159 |