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/dt4800-sdk/

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

Metadata

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

Built distributions (wheels)

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

Total release size: 5.8 MB

Release files / dt4800-1.0.3.tar.gz

Download URL dt4800-1.0.3.tar.gz
Size 56.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d35f34d77390a853d339a413720c06d9b3a927d3e17e5ecd9b7fa6e4634a495f
BLAKE2b-256 checksum
How to use checksums
5130784fcc957cd2f8279a5e50edef966fcee036e6049ceb22264d3a47b577f9
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.3-py3-none-win_amd64.whl

Download URL dt4800-1.0.3-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
9eb8527365105c6fa8cc9117de5b0e276d8be636953a77698155974dc6369fb9
BLAKE2b-256 checksum
How to use checksums
2b082780b8b53cfb232fdf398e92c7b416d560adb9734fb268341ceca80a734b
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.3-py3-none-win32.whl

Download URL dt4800-1.0.3-py3-none-win32.whl
Size 1.2 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
be5b12e5c55695a95d65931de41c263b9404300981e61a32772a72f1f3fb81ea
BLAKE2b-256 checksum
How to use checksums
72b7f91198e680320e13e125819a5ba49fdb0605245d4a4af43a4164b32496fb
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.3-py3-none-manylinux_2_34_x86_64.whl

Download URL dt4800-1.0.3-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
e16e0bd1b0b67b1a70ed6fbf38cf89e33b42b72ae63e1fc60b59af1ee68d88fc
BLAKE2b-256 checksum
How to use checksums
b28c1f915eee963ad85d8f5b4f7427bac7fdb854798ed191ba976ad5fdc2b064
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.3-py3-none-manylinux_2_34_aarch64.whl

Download URL dt4800-1.0.3-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
00ddf794e3487c9efbf44f7edf3c64141fd35524ac979833928d5d01a91363e5
BLAKE2b-256 checksum
How to use checksums
a600244ff1076b37705902b96a1421ac1e449e28dafd6b7e59486d92eb8421a5
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.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