Skip to main content

dt4800 — Python binding of the DT4800 SDK

Control the CAEN DT4800 Micro Digital Detector Emulator (Nuclear Instruments) from Python: time base (constant, Poisson, external), amplitude (fixed or from a spectrum), pulse shape, noise, output stage, trigger output, monitoring (In / Out / LIVE % / Counts, realtime signal and spectrum), .nis settings files, the Spectrum Importer and Editor, the isotope library and Radionuclide Composer, activation and the FPGA firmware update. The package calls the native DT4800 library (dt4800.dll / libdt4800.so / libdt4800.dylib) through ctypes; a built-in simulator (sim://) lets you develop and test without hardware.

Installation

pip install dt4800

The wheels for Windows (x64, x86) and Linux (x86_64 and aarch64, glibc 2.34+) include the native library. Python 3.8 or later; no mandatory dependency (pip install dt4800[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 DT4800_LIBRARY at it (full path of dt4800.dll / libdt4800.so / libdt4800.dylib); otherwise the library is looked up in the package, then by the system loader.

USB drivers

The DT4800 is an FTDI USB device, driven through FTDI's D2XX library:

  • Windows: install the CAEN FTDI driver from the DT4800 SDK installer (or the DT4800 Control Software); it provides ftd2xx.dll.
  • Linux: the wheels carry FTDI's libftd2xx.so inside the package; the instrument must be accessible to your user: install the udev rule (the .deb / .rpm packages of the SDK install it), then unplug and plug the instrument again.

dt4800.usb_driver() tells which D2XX library is used (or why none can be loaded). The simulator needs no driver.

Quick start

import dt4800

print(dt4800.version())

with dt4800.open("sim://") as dev:            # the simulator, no hardware
    print(dev.info.model_name, dev.info.serial)
    ch = dev.channel(0)
    ch.set_shape(rise_us=0.05, tau_us=50)      # Control Software units
    ch.set_timebase(dt4800.TimebaseMode.POISSON, rate_hz=10000)
    ch.set_fixed_energy(20000)                 # register value (2 x panel LSB)
    ch.set_output(gain=1.0, offset=0)
    ch.enable()                                # OUTPUT on
    st = ch.stats()
    print(st.count_rate, st.live, "%.1f %%" % st.live_percent, st.event_counter)

On USB:

for d in dt4800.enumerate(dt4800.Bus.USB):
    print(d.serial, d.address, "busy" if d.busy else "")

with dt4800.open("usb://") as dev:             # or "usb://<serial>"
    ch = dev.channel(0)
    ch.apply(dt4800.load_settings("panel.nis"))   # a Control Software settings file

A spectrum and the Radionuclide Composer:

lines = [l.source() for n in ("Co-60", "Cs-137")
         for l in dt4800.nuclide_lines(n, dt4800.LineType.GAMMA) if l.intensity > 1]
lo, hi = dt4800.compose_range(lines)
spectrum = dt4800.peaks_to_spectrum(dt4800.compose_peaks(lines, lo, hi))
ch.set_spectrum(spectrum)

Errors raise dt4800.Dt4800Error subclasses (OutOfRangeError, InvalidParameterError, NotFoundError, FileError, DeviceTimeoutError, ...) carrying .status, .message (the description of the library) and .function. The examples/ folder has runnable scripts for every feature (python examples/01_info.py sim://).

GUI example

examples/gui/dt4800_panel.py is a PyQt6 control panel reproducing the main window of the DT4800 Control Software (with the plot window: input spectrum, realtime spectrum, realtime signal); it runs on the simulator too:

pip install -r examples/requirements.txt
python examples/gui/dt4800_panel.py sim://

Documentation

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

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

Metadata

Release files for dt4800 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 dt4800 1.0.1
File Size Uploaded Provenance Actions
dt4800-1.0.1.tar.gz 56.2 kB Without provenance Details for dt4800-1.0.1.tar.gz

Built distributions (wheels)

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

Total release size: 5.8 MB

Release files / dt4800-1.0.1.tar.gz

Download URL dt4800-1.0.1.tar.gz
Size 56.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3f08bf94f3a7767c885bf8b2d27c8f31ffbdac689d612dfb1bdeec691f087785
BLAKE2b-256 checksum
How to use checksums
09e0fcef73538592ebec438af29703964801afb015c3cb1c23591a557e65f3be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dt4800-1.0.1-py3-none-win_amd64.whl

Download URL dt4800-1.0.1-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b586b81a00e7b7423c54ba3a21ca1b3c7ef41c75dd7f0e1487e8702aac30cb26
BLAKE2b-256 checksum
How to use checksums
edcdbc3502e02a163d782f6690febf53bb4758218f47a0c1c8870e03d8dd457c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dt4800-1.0.1-py3-none-win32.whl

Download URL dt4800-1.0.1-py3-none-win32.whl
Size 1.2 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
c179ba4a6de448b2b61fd8735dadeaaf3ef742197d858bcb89704b2a4269f716
BLAKE2b-256 checksum
How to use checksums
5ace15ab99cf031b310aa0445add0179218dd7dd67b6679284c29229cf6f5040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / dt4800-1.0.1-py3-none-manylinux_2_34_x86_64.whl

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

Release files / dt4800-1.0.1-py3-none-manylinux_2_34_aarch64.whl

Download URL dt4800-1.0.1-py3-none-manylinux_2_34_aarch64.whl
Size 1.6 MB
Tags Linux glibc 2.34+ ARM64 Python 3
SHA-256 checksum
How to use checksums
17982d73f43b158c151ab2674201241b3d1e8a18d76542546556f7196959fc26
BLAKE2b-256 checksum
How to use checksums
69231df0ba0757a7f8379c6220445960af788628ecd7edc21a8defdeb6dc947a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for dt4800 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