Skip to main content

dt5800: Python binding of the DT5800 SDK

Control the CAEN DT5800 / DT5800D Digital Detector Emulator (Nuclear Instruments, front panel "DPPE") from Python: energy (fixed, spectrum, isotopes, sequences), pulse shape (fast exponential, digital RC, custom shapes, multi-shape), time base, pile-up and dead time, noise, interference, baseline drift, reset preamplifier, correlation of the two channels with the delay line, digital I/O, run control, waveform generator, Peltier, statistics and the signal monitor. The package calls the native DT5800 library (dt5800.dll / libdt5800.so) through ctypes. A built-in simulator (sim://) lets you develop and test without hardware.

Installation

pip install dt5800

The wheels for Windows x64 and Linux x86-64 / aarch64 (glibc 2.34+) include the native library. Python 3.8 or later. There are no mandatory dependencies: pip install dt5800[numpy] gets numpy arrays from the read functions with as_numpy=True. Every function also takes numpy arrays as input.

USB driver

The instrument is reached over USB 2 through its FTDI FT2232H and FTDI's D2XX driver:

  • Windows: FTDI's CDM driver, installed by the DT5800 SDK setup (DT5800-SDK-Setup-<version>.exe) or downloaded from FTDI (any recent version works). It provides ftd2xx.dll, which the library loads at run time.
  • Linux: the wheel includes FTDI's D2XX library (libftd2xx.so, next to libdt5800.so). The udev rule must still be installed. It gives every user access to the instrument and detaches the kernel's ftdi_sio driver from the DT5800 only. The rule is installed by the dt5800-sdk package (apt install dt5800-sdk / dnf install dt5800-sdk). It is also in the SDK sources: copy sdk/cpp/udev/60-dt5800.rules to /etc/udev/rules.d/, then run sudo udevadm control --reload-rules and plug the instrument in again.

dt5800.d2xx_info() tells which D2XX library was loaded, or why none could be. dt5800.supported_buses() lists Bus.USB only when it loads. Other FTDI devices on the same PC (USB-serial adapters, other instruments) are never opened: the library lists and opens only the devices whose USB description is a DT5800's.

Another build of the library

With the source distribution, or to use another build, point DT5800_LIBRARY at the library (full path of dt5800.dll / libdt5800.so). Otherwise the library is looked up in the package (dt5800/_native/), then by the system loader.

Quick start

import dt5800

print(dt5800.version())
for d in dt5800.enumerate(dt5800.Bus.USB):
    print(d.serial, d.address, d.description)

with dt5800.Device("sim://") as dev:            # or "usb://", "usb://<FTDI serial>"
    print(dev.info.model_name, dev.info.serial)
    ch = dev.channel(0)
    ch.set_energy_fixed(16000)                  # LSB, 0..32767
    ch.set_shape_exponential(dt5800.ShapeMode.AUTO, rise_ns=50, decay_ns=10000)
    ch.set_timebase(dt5800.TimebaseMode.POISSON, 10000)
    ch.enable()
    print(ch.stats())

Spectra come from files of the DT5800 software (load_values, process_spectrum), from the Spectrum Editor (spectrum_from_peaks), or from the isotope database (isotope_lines("Co-60"), spectrum_from_lines). Program them with Channel.program_spectrum.

Errors raise subclasses of dt5800.Dt5800Error (OutOfRangeError, InvalidParameterError, NoDataError, NotFoundError, DeviceTimeoutError, InvalidHardwareError, ...). Each one carries .status and .message (the text of dt5800_last_error).

Examples

The examples/ folder has a runnable script for each feature. Each takes the address as its first argument (default sim://):

Script What
01_list_and_info.py instruments, identity, activation, climate, calibration
02_pulser.py fixed amplitude at a constant rate, statistics
03_spectrum.py a spectrum from peaks or from a file, Poisson rate, loop-back histogram
04_monitor.py signal monitor, statistics, loop-back histogram
05_awg.py function generator and arbitrary waveform
06_firmware_info.py .NIU firmware package, FPGA update (simulator, or --update)
07_isotopes.py Co-60 + Cs-137 from the isotope database
08_noise_and_baseline.py noise, interference, baseline drift, reset preamplifier
09_correlation.py delayed copy, partial correlation, Peltier
pip install -r examples/requirements.txt
python examples/02_pulser.py usb://

Firmware

info = dt5800.firmware_file_info("DT5800D_2_4.NIU")
dt5800.fpga_update("usb://FT5800AB", "DT5800D_2_4.NIU",
                   progress=lambda stage, f: print(stage, f"{f:.0%}"))
# then power cycle the instrument

Documentation

User guide and API reference: https://public-repo.pages.nuclearinstruments.eu/dt5800/dt5800-sdk/

Source: https://gitlab.nuclearinstruments.eu/public-repo/dt5800/dt5800-sdk. MIT License.

Metadata

Release files for dt5800 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dt5800 1.0.3
File Size Uploaded Provenance Actions
dt5800-1.0.3.tar.gz 49.1 kB Without provenance Details for dt5800-1.0.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dt5800 1.0.3
File Interpreter ABI Platform Actions
dt5800-1.0.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for dt5800-1.0.3-py3-none-win_amd64.whl
dt5800-1.0.3-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for dt5800-1.0.3-py3-none-manylinux_2_34_x86_64.whl
dt5800-1.0.3-py3-none-manylinux_2_34_aarch64.whl Python 3 none Linux glibc 2.34+ ARM64 Details for dt5800-1.0.3-py3-none-manylinux_2_34_aarch64.whl

Total release size: 4.1 MB

Release files / dt5800-1.0.3.tar.gz

Download URL dt5800-1.0.3.tar.gz
Size 49.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5a1023a8e838a964130789f55d2350d760256c29f9b6b694792d3b3091a235fe
BLAKE2b-256 checksum
How to use checksums
bca359d315ca240519dd5df2835dc864a928253e24a95c8dd66f974a510808e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dt5800-1.0.3-py3-none-win_amd64.whl

Download URL dt5800-1.0.3-py3-none-win_amd64.whl
Size 1.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
53121b58495a99ee060e5e4dd3194b6d9e971b83e1a4f6c8d0ff7476e5bc2fcb
BLAKE2b-256 checksum
How to use checksums
1774a283e2dec7a938db9f3789fab6a0e96ebc8bd18e57547aa3ce68a8b991ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dt5800-1.0.3-py3-none-manylinux_2_34_x86_64.whl

Download URL dt5800-1.0.3-py3-none-manylinux_2_34_x86_64.whl
Size 1.6 MB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b9166fa89f1209beda0a59d132fcd676143d07c553675d50b3e053424b3f00f7
BLAKE2b-256 checksum
How to use checksums
a9348bf38f6279f54b1b588df7d20155d6bbd57e8e3406038f6c2745427ea8ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dt5800-1.0.3-py3-none-manylinux_2_34_aarch64.whl

Download URL dt5800-1.0.3-py3-none-manylinux_2_34_aarch64.whl
Size 1.4 MB
Tags Linux glibc 2.34+ ARM64 Python 3
SHA-256 checksum
How to use checksums
50cf0dd50c5784230591c04321916408292c078a48112e4618910d550a2f3b18
BLAKE2b-256 checksum
How to use checksums
d59d7ff1bc665de65245b98fe7850bef7fa063ed4c32cf878fc907cbd0d4c4dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for dt5800 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page