{"id":19106078,"url":"https://github.com/lobis/lecroy-scope","last_synced_at":"2025-10-13T22:09:03.074Z","repository":{"id":65519301,"uuid":"561876911","full_name":"lobis/lecroy-scope","owner":"lobis","description":"lecroyscope is an unofficial Python package 🐍📦 to interface with Teledyne LeCroy oscilloscopes and read binary trace files (.trc)","archived":false,"fork":false,"pushed_at":"2024-01-29T18:08:01.000Z","size":248,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T17:51:14.325Z","etag":null,"topics":["instrumentation","lecroy","numpy","oscilloscope","parser","python","trc","vxi11"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lobis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-04T17:36:48.000Z","updated_at":"2025-03-28T17:05:48.000Z","dependencies_parsed_at":"2023-11-13T19:30:25.423Z","dependency_job_id":"b3363b62-c821-4252-a4de-b739c6b4c390","html_url":"https://github.com/lobis/lecroy-scope","commit_stats":{"total_commits":85,"total_committers":2,"mean_commits":42.5,"dds":0.02352941176470591,"last_synced_commit":"8acad69a4f28313408e8ce632102495446f79694"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobis%2Flecroy-scope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobis%2Flecroy-scope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobis%2Flecroy-scope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobis%2Flecroy-scope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lobis","download_url":"https://codeload.github.com/lobis/lecroy-scope/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249543297,"owners_count":21288703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["instrumentation","lecroy","numpy","oscilloscope","parser","python","trc","vxi11"],"created_at":"2024-11-09T04:01:48.113Z","updated_at":"2025-10-13T22:08:58.023Z","avatar_url":"https://github.com/lobis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lecroyscope\n\n[![PyPI version](https://badge.fury.io/py/lecroyscope.svg)](https://badge.fury.io/py/lecroyscope)\n[![Build and Test](https://github.com/lobis/lecroy-scope/actions/workflows/build-test.yml/badge.svg)](https://github.com/lobis/lecroy-scope/actions/workflows/build-test.yml)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lecroyscope)\n\n## 🤔 What is this?\n\nThis is an unofficial Python package to interface with Teledyne LeCroy oscilloscopes and read binary trace\nfiles (`*.trc`).\n\nThe parsing of `trc` files is based on\nthe [lecroy-reader](https://github.com/neago/lecroy-reader/blob/49c42a85c449013c1c48d154ae70192f172e32ba)\nproject.\n\n## ⚠️ Disclaimer\n\nThe features of this package are based on my needs at the time of writing.\nI have done very limited testing, using a single oscilloscope and a few trace files.\n\nIf you use this package, it is very possible you find a bug or some oversight.\nYou are encouraged to make a [pull request](https://github.com/lobis/lecroy-scope/pulls) or to create\nan [issue](https://github.com/lobis/lecroy-scope/issues) to report a bug, to request additional features or to suggest\nimprovements.\n\n## ⚙️ Installation\n\nInstallation via `pip` is supported.\nTo install the latest [published version](https://github.com/lobis/lecroy-scope/releases), run:\n\n```bash\npip install lecroyscope\n```\n\nTo install the package from source, including test dependencies, clone the repository and run:\n\n```bash\npip install .[test]\n```\n\n## 👨‍💻 Usage\n\n### 📖 Reading binary trace files (`*.trc`)\n\n```python\nfrom lecroyscope import Trace\n\ntrace = Trace(\"path/to/trace.trc\")\n```\n\nTrace file header information can be accessed via the `header` attribute:\n\n```python\nheader = trace.header\n\n# properties can be accessed directly\nprint(\"Instrument name: \", header.instrument_name)\n\n# or as python dict\nprint(\"Instrument name: \", header[\"instrument_name\"])\n\n# header can also be converted into a python dict\nheader_dict = dict(header)\nprint(\"Header keys: \", list(header_dict.keys()))\n```\n\nThe trace data can be accessed via the `time`(`x`) and `voltage`(`y`) attributes:\n\n```python\n# time values\ntime = trace.time  # trace.x is an alias for trace.time\n\n# channel voltage values\nvoltage = trace.voltage  # trace.y is an alias for trace.voltage\n```\n\n### 📟 Acquisition with LeCroy oscilloscope\n\n```python\nimport lecroyscope\n\nscope = lecroyscope.Scope(\"192.168.1.10\")  # IP address of the scope\n\n# print some info\nprint(f\"Scope ID: {scope.id}\")\n\n# change to \"Sequence\" mode with 200 segments\nscope.sample_mode = \"Sequence\"\nscope.num_segments = 200\nprint(f\"Sample mode: '{scope.sample_mode}' with {scope.num_segments} segments\")\n\n# acquire data with a single trigger, timout (fail) after 60 seconds\nscope.acquire(timeout=60)\n\n# Read channel 2 and 3 traces\n# The data in the scope won't change until next acquisition\ntrace_channel2: lecroyscope.Trace = scope.read(2)\ntrace_channel3: lecroyscope.Trace = scope.read(3)\n\n# Alternatively, it is recommended to use the TraceGroup class for reading multiple channels from the same trigger\ntrace_group: lecroyscope.TraceGroup = scope.read(2, 3)\ntrace_channel2 = trace_group[2]\ntrace_channel3 = trace_group[3]\ntime = trace_group.time  # time values are the same for all traces\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobis%2Flecroy-scope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flobis%2Flecroy-scope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobis%2Flecroy-scope/lists"}