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/

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

Metadata

Release files for dt5800 1.0.1

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.1
File Size Uploaded Provenance Actions
dt5800-1.0.1.tar.gz 49.1 kB Without provenance Details for dt5800-1.0.1.tar.gz

Built distributions (wheels)

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

Total release size: 4.1 MB

Release files / dt5800-1.0.1.tar.gz

Download URL dt5800-1.0.1.tar.gz
Size 49.1 kB
Tags Source
SHA-256 checksum
How to use checksums
38490be5a7ebd5003d0cb40d549ac8a0ba5944763ec11ed21255f744654f4175
BLAKE2b-256 checksum
How to use checksums
17282e145d4bc73e75f074dbdcbb59f60632350ee59620ef578d1eadc12a890a
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.1-py3-none-win_amd64.whl

Download URL dt5800-1.0.1-py3-none-win_amd64.whl
Size 1.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
7372359a80acb605f38de959983c80e9006109212a954d601d4ba679fa5255f8
BLAKE2b-256 checksum
How to use checksums
89d7d41743492c99ee04a8c884b5fb41c05cf8d18ee72c968f585052b06a859e
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.1-py3-none-manylinux_2_34_x86_64.whl

Download URL dt5800-1.0.1-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
9c35cb4ae2f133c91efc74b9774293634f57e85164cab2b44a65c1d724c38485
BLAKE2b-256 checksum
How to use checksums
c6c0e6e2d550274d8ff208a8916cc8a770ad1fa9bc76bb458e04d4e231e77826
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.1-py3-none-manylinux_2_34_aarch64.whl

Download URL dt5800-1.0.1-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
a728e7f3bf34cead213ae31455d20b1acd0c3be2d653d026b46496feb289e43c
BLAKE2b-256 checksum
How to use checksums
21b5dbf477d660c5fe9eb7c3b2e125b074db3c271f4fb4a3091397394bb57603
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.1

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