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.2

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.2
File Size Uploaded Provenance Actions
dt4800-1.0.2.tar.gz 56.1 kB Without provenance Details for dt4800-1.0.2.tar.gz

Built distributions (wheels)

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

Total release size: 5.8 MB

Release files / dt4800-1.0.2.tar.gz

Download URL dt4800-1.0.2.tar.gz
Size 56.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dbd1c824fb188e6ef6fe000970b06819c98cbe6d1650f286aed2aa8399003c46
BLAKE2b-256 checksum
How to use checksums
2ebe7898c1e49a8351399d90c65d7b6f2a8a5ddb14ce34a29636385358725942
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.2-py3-none-win_amd64.whl

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

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

Download URL dt4800-1.0.2-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
0d41e3d66170a47924a1680346ee2f45072353f7f164a4f7e3a51dada74c9f97
BLAKE2b-256 checksum
How to use checksums
2c22852d8bffee981135fb30970332e3e917462e5bada34dd77aa19f1e56a9fe
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.2-py3-none-manylinux_2_34_aarch64.whl

Download URL dt4800-1.0.2-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
56ac1ba5ac13517e5360968dbd56bf6dd6908623a134972aee05bdc768c4a8cc
BLAKE2b-256 checksum
How to use checksums
0d907c2e4cdb3dcb334453676477498315e61eba8100e415f46f5b336345794a
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.2

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