dt5810 — Python binding of the DT5810 SDK
Control the CAEN DT5810 / DT5810B Digital Detector Emulator (Nuclear Instruments) from
Python: energy (fixed or spectrum), pulse shape, time base, noise, baseline drift,
correlation, digital I/O, run control, monitoring, AWG / sequences and the analog input
MCA. The package calls the native DT5810 library (dt5810.dll / libdt5810.so) through
ctypes; a built-in simulator (sim://) lets you develop and test without hardware.
Installation
pip install dt5810
The wheels for Windows x64 and Linux x86_64 (glibc 2.34+) include the native library.
Python 3.8 or later; no mandatory dependency (pip install dt5810[numpy] to get numpy
arrays from the read functions with as_numpy=True).
With the source distribution, or to use another build of the library, point
DT5810_LIBRARY at it (full path of dt5810.dll / libdt5810.so); otherwise the library
is looked up in the package, then by the system loader.
Quick start
import dt5810
print(dt5810.version())
for d in dt5810.enumerate(dt5810.Bus.USB):
print(d.serial, d.address)
with dt5810.open("sim://") as dev: # or "usb://", "usb://NI050123"
print(dev.info.model_name, dev.info.serial)
ch = dev.channel(0)
ch.set_fixed_energy(20000) # LSB, 0..32767
ch.set_drc(rise_ns=20, decay_ns=50000)
ch.set_timebase(dt5810.TimebaseMode.POISSON, rate_hz=10000)
ch.enable()
print(ch.stats())
Errors raise dt5810.Dt5810Error subclasses (OutOfRangeError, InvalidParameterError,
NoDataError, NotFoundError, DeviceTimeoutError, ...) carrying .status and
.message. The examples/ folder has runnable scripts for every feature
(python examples/01_info.py usb://).
Instruments on USB and firmware
for d in dt5810.usb_list(): # every instrument, in any state
print(d.usb_serial, d.state.name, d.serial, "USB 3" if d.super_speed == 1 else "USB 2")
dt5810.fx3_load_all() # load the USB firmware where it is missing
dt5810.fpga_update("", "DT5810B.NIU", # FPGA update, instrument in FPGA boot loader
progress=lambda stage, f: print(stage, f"{f:.0%}"))
At power-up the USB controller of the instrument waits for its firmware: the firmware
service of the SDK installer / Linux packages loads it automatically, fx3_load_all() does
it from Python (the firmware is inside the library).
GUI example
examples/gui/dt5810_gui.py is a PyQt6 control panel with live plots (signal, emitted
spectrum, count rate) and the firmware functions; it runs on the simulator too:
pip install -r examples/requirements.txt
python examples/gui/dt5810_gui.py sim://
Documentation
User guide and API reference: https://public-repo.pages.nuclearinstruments.eu/dt5810/dt5810-sdk/
Source: https://gitlab.nuclearinstruments.eu/public-repo/dt5810/dt5810-sdk — MIT License.
Metadata
Release files for dt5810 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dt5810-2.1.0.tar.gz | 51.2 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dt5810-2.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| dt5810-2.1.0-py3-none-manylinux_2_34_x86_64.whl | Python 3 | none | Linux glibc 2.34+ x86-64 | Details |
Total release size: 1.1 MB
Release files / dt5810-2.1.0.tar.gz
| Download URL | dt5810-2.1.0.tar.gz |
|---|---|
| Size | 51.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b81dbeb6eeb1885cb0ca5e370590d3ac2ec83fa345da699239fd53a55ed6cf25
|
|
BLAKE2b-256 checksum How to use checksums |
f1ed130848c5c0cddb74a6751bf36c7465f33f17733800fa8f9012dc439d1ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / dt5810-2.1.0-py3-none-win_amd64.whl
| Download URL | dt5810-2.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 361.5 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b1b1605a18d9e5143574968ab496e201f0306b86d0f801d682b41788749de96f
|
|
BLAKE2b-256 checksum How to use checksums |
58d00f7817d725dae5806558e507ca39e224f02c19f43e585cc5dea8d1f4689d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / dt5810-2.1.0-py3-none-manylinux_2_34_x86_64.whl
| Download URL | dt5810-2.1.0-py3-none-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 726.1 kB |
| Tags | Linux glibc 2.34+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
0bb684d40154d6a92d1740e24657afee4fc7270d1b1ec2627eda76c36a882c26
|
|
BLAKE2b-256 checksum How to use checksums |
b3d984ebbbd5cb255cad4f88ef5bde29502c09bacace04395a921ce13132429e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|