Read Becker & Hickl SDT files
Project description
Sdtfile is a Python library to read SDT files produced by Becker & Hickl SPCM software. SDT files contain time correlated single photon counting instrumentation parameters and measurement data. Currently only the “Setup & Data”, “DLL Data”, and “FCS Data” formats are supported.
Becker & Hickl GmbH is a manufacturer of equipment for photon counting.
- Author:
- License:
BSD-3-Clause
- Version:
2026.7.12
- DOI:
Quickstart
Install the sdtfile package and all dependencies from the Python Package Index:
python -m pip install -U sdtfile[all]
See Examples for using the programming interface.
Source code and support are available on GitHub.
Requirements
This revision was tested with the following requirements and dependencies (other versions may work):
CPython 3.12.10, 3.13.14, 3.14.6, 3.15.0b3 64-bit
Numpy 2.5.1
Imagecodecs 2026.6.26 (optional for LZ4 compressed data blocks)
Revisions
2026.7.12
Fix BlockNo attribute names (breaking).
Try power-of-two padded image shapes when block/adc_re > image_y * image_x.
Support LZ4 compressed and larger than 4 GB data blocks (not tested).
Update MeasureInfoExt structure with MeasStopInfoExt and MWL fields.
Use BinaryFile for file I/O.
Add simple CLI to preview data and metadata in SDT files.
2026.6.29
Fix reading SDT files with truncated embedded ZIP files (#8).
2026.6.6
Fix potential file handle leak in SdtFile init.
Add options for memory-mapping and locked reading to BinaryFile.
Add option to memory-map SDT files.
Drop support for Python 3.11 and numpy 2.0 (SPEC0).
Support Python 3.15.
2026.2.8
Derive SdtFile from BinaryFile (breaking).
Rename MEASURE_INFO.MeasHISTInfo to HISTInfo to match C struct (breaking).
Revise shaping of FCS_BLOCK data (breaking).
Fix code review issues.
2026.1.14
Improve code quality.
2025.12.12
Add new SPC modules and MEASURE_INFO_EXT fields.
Drop support for Python 3.10.
2025.5.10
…
Refer to the CHANGES file for older revisions.
References
W Becker. The bh TCSPC Handbook. 9th Edition. Becker & Hickl GmbH 2021. pp 879.
SPC_data_file_structure.h header file. Part of the Becker & Hickl SPCM software installation.
Examples
Read image and metadata from an “SPC Setup & Data File”:
>>> sdt = SdtFile('image.sdt')
>>> int(sdt.header.revision)
588
>>> sdt.info.id[1:-1]
'SPC Setup & Data File'
>>> int(sdt.measure_info[0].scan_x)
128
>>> len(sdt.data)
1
>>> sdt.data[0].shape
(128, 128, 256)
>>> sdt.times[0].shape
(256,)
>>> sdt.close()
Read data and metadata from an “SPC Setup & Data File” with multiple data sets:
>>> sdt = SdtFile('fluorescein.sdt')
>>> len(sdt.data)
4
>>> sdt.data[3].shape
(1, 1024)
>>> sdt.times[3].shape
(1024,)
>>> int(sdt.setup.bh_bin_hdr['soft_rev'])
850
>>> sdt.close()
Read image data from an “SPC FCS Data File” as numpy array:
>>> sdt = SdtFile('fcs.sdt')
>>> sdt.info.id[1:-1]
'SPC FCS Data File'
>>> len(sdt.data)
1
>>> sdt.data[0].shape
(512, 512, 256)
>>> sdt.times[0].shape
(256,)
>>> sdt.close()
View the image and metadata in an SDT file from the console:
$ python -m sdtfile image.sdt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sdtfile-2026.7.12.tar.gz.
File metadata
- Download URL: sdtfile-2026.7.12.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3740351b398706b0b80a15939c4ebf756fc15946855b4abad96716f0a2ab5e5
|
|
| MD5 |
e4049725e52c0cd1be6bed2a67234ebd
|
|
| BLAKE2b-256 |
edbd7a369a4c045eae7364978c71ee4ff9c3bca5d87d8a196955a5bb7f3e2e34
|
File details
Details for the file sdtfile-2026.7.12-py3-none-any.whl.
File metadata
- Download URL: sdtfile-2026.7.12-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
100152ab62f1d5d71880cfc058272d63c86d90933593e79aaffa6291ecd9c0df
|
|
| MD5 |
cb476fba2c82c60ebb3cff19ad95d771
|
|
| BLAKE2b-256 |
3eacc3221073296cf27716f74645abdecd885c88a8b40556745c1ea54cdc3ffa
|