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

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

Built distributions (wheels)

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

Total release size: 5.8 MB

Release files / dt4800-1.0.0.tar.gz

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

Download URL dt4800-1.0.0-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6f8fb67428384fd195498077b3d8ffec4de6594eaff990efbf893c1ed3086993
BLAKE2b-256 checksum
How to use checksums
efa8de7c63be6bfeed20dc7f483eafd69c9fbe84cd08632075b71a530112c439
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.0-py3-none-win32.whl

Download URL dt4800-1.0.0-py3-none-win32.whl
Size 1.2 MB
Tags Python 3 Windows x86-32
SHA-256 checksum
How to use checksums
8862112121a87d99d5bd45b373ea781b75c0c8744040c6ceea0f6943db284ec3
BLAKE2b-256 checksum
How to use checksums
b82e7303b5b41dfc56c98cb28a117d41bc0438c4dc345184eaaaf34d431cfaa1
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.0-py3-none-manylinux_2_34_x86_64.whl

Download URL dt4800-1.0.0-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
e71eab45aab0a025fa615e7793b911b885c4bf529c5c0539ffcec12350dbab01
BLAKE2b-256 checksum
How to use checksums
c6f60bfe07fa012faa077c9af487ea8e75df83800a1df3cf74380d8ee6d834bf
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.0-py3-none-manylinux_2_34_aarch64.whl

Download URL dt4800-1.0.0-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
553c8dba492047419b914793add3690b0b6d44d3d1721dd737e8e1bb2206a01a
BLAKE2b-256 checksum
How to use checksums
75171426b0af6fa743b64962f4a1ac2fac6b28af11f6661da8631c8f90d4038a
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.0

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