Skip to main content

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:

Christoph Gohlke

License:

BSD-3-Clause

Version:

2026.6.6

DOI:

10.5281/zenodo.10125608

Quickstart

Install the sdtfile package and all dependencies from the Python Package Index:

python -m pip install -U sdtfile

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.13, 3.14.5, 3.15.0b2 64-bit

  • Numpy 2.4.6

Revisions

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

  • Support Python 3.14.

2025.3.25

  • Fix shape of data with routing channels.

  • Drop support for Python 3.9, support Python 3.13.

2024.12.6

  • Fix read MeasureInfo fields as scalars (breaking).

  • Update some structure field names with BH reference (breaking).

  • Parse some SetupBlock binary structures (#7).

  • Include more information in str(SdtFile).

  • Add subtype to FileRevision.

2024.11.24

Refer to the CHANGES file for older revisions.

References

  1. W Becker. The bh TCSPC Handbook. 9th Edition. Becker & Hickl GmbH 2021. pp 879.

  2. SPC_data_file_structure.h header file. Part of the Becker & Hickl SPCM software installation.

Examples

Read image and metadata from a “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 a “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 a “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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdtfile-2026.6.6.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sdtfile-2026.6.6-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file sdtfile-2026.6.6.tar.gz.

File metadata

  • Download URL: sdtfile-2026.6.6.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for sdtfile-2026.6.6.tar.gz
Algorithm Hash digest
SHA256 82948b389f770f55b7d398f98c34309f1e1c435cb8a4295161904d3a8afe8c88
MD5 43ed278f94815cd8c2c9e9b3385d207e
BLAKE2b-256 22425820380769a40f6856f5349d394db03f30d916e8b3dab0365b0adce3b043

See more details on using hashes here.

File details

Details for the file sdtfile-2026.6.6-py3-none-any.whl.

File metadata

  • Download URL: sdtfile-2026.6.6-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for sdtfile-2026.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 98c5f84abba185bd94899ab558fded0b4e6596357c3ed3a50f655bf436a33337
MD5 2bd011b8cff63e91d0309e96a96d7317
BLAKE2b-256 a11a5886bc31b7abb7150b653f1d4672477b24e9805bb7c538267a3b4a1eb8d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page