Skip to main content

pybhspc: Control Becker & Hickl SPC modules from Python

pip install pybhspc
import bh_spc
from bh_spc import spcm

Full Documentation

Overview

The pybhspc package provides Python bindings to the Becker & Hickl SPCM DLL, which is the control and acquisition interface for SPC modules. (SPC moduels are PCI/PCIe boards that perform TCSPC (time-correlated single photon counting) or time-tagging.)

Note: The author of this package is not affiliated with Becker & Hickl GmbH.

The main package bh_spc provides a few utility functions. The module bh_spc.spcm provides Python bindings to the SPCM functions and data types.

To use the relatively direct bindings in bh_spc.spcm, you will need to understand the underlying SPCM DLL interface, provided and documented by BH. (I plan to add a higher-level interface that simplifies device enumeration and FIFO acquisition, but this is not yet available.)

Access to all of the functions that are required for FIFO (time tag stream) mode acquisition on SPC boards (including with multiple boards) is provided by the bh_spc.spcm module. Not supported are functions that are specific to conventional (non-FIFO mode) acquisition, the DPC-230, and stream buffering (data buffering can readily be done using other Python facilities).

Note that interpreting the time tag stream data (a seqeunce of binary records) is outside the scope of this library. It's always good to keep data acquisition and data processing/analysis code separate (even if they run concurrently in a particular application).

Status and Versioning

This package should be considered experimental, even though the spcm module is reasonably complete for FIFO mode acquisition. Until version 1.0.0 is released, all APIs are subject to backward-incompatible changes. However, backward-incompatible changes will be documented following the first release (version 0.1.0).

Hardware Requirements

An effort has been made to avoid making unnecessary assumptions about the SPC module type (i.e., device model). pybhspc also allows testing with the SPCM DLL set to simulation modes.

It should be possible to operate most of the SPC boards supported by the SPCM DLL: SPC-600, 630, 130, 830, 140, 930, 150, 130EM, 150N (NX, NXX), 130EMN, 160 (X, PCIE), 180N (NX, NXX), and 130IN (INX, INXX). Recent versions of SPCM do not support some of the older models except in simulation; check the BH documentation.

Caveat: Most of these have not been tested, especially with hardware.

SPC-700 and 730 are not listed here because they do not have a FIFO mode.

DPC-230 is not currently supported by pybhspc (it requires some extra functions and data types).

SPC-QC-104 and 004 may work (no attempt has been made to test these yet, even in simulation).

SPC-QC-008 uses a completely different programming interface and is out of scope for the pybhspc package (but BH offers a Python interface called bhpy for SPC-QC-104/004/008).

Software Requirements

Windows (64-bit Intel) only.

Python 3.10+ (64-bit).

The Becker & Hickl SPCM DLL (part of their TCSPC Package installer) must be installed on the system. The most recent version is usually recommended; absolute minimum is version 4.0 (Apr 2014; but versions below 5.2 have not been tested). Note that these are version numbers of the SPCM DLL, not of the TCSPC Package or the SPCM application.

The SPCM DLL is usually found in its installed location; there is no need to copy it or set any environment variables.

License

The pybhspc package is distributed under the MIT license.

Getting Started

Check out the example in the documentation.

Release files for pybhspc 0.1.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 pybhspc 0.1.0
File Size Uploaded
pybhspc-0.1.0.tar.gz 394.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pybhspc 0.1.0
File Interpreter ABI Platform
pybhspc-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pybhspc-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pybhspc-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details

Total release size: 2.2 MB

Release files / pybhspc-0.1.0.tar.gz

Download URL pybhspc-0.1.0.tar.gz
Size 394.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3791f75050694552c6d5b57c69d43c53fe61340b0092723d0babf0308dd06572
BLAKE2b-256 checksum
How to use checksums
c5b904038002135bc460abffd75370992d298c6333327bc04b4b60c1b1cd0151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / pybhspc-0.1.0-cp312-cp312-win_amd64.whl

Download URL pybhspc-0.1.0-cp312-cp312-win_amd64.whl
Size 593.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
62787f4d0e83706c8036ad73d4a22348c1b03e64406ea3b023e11c16744e1cbb
BLAKE2b-256 checksum
How to use checksums
63f3644db98d978956849631f09d1c846ed927ae924bb584fa3a9c1898a896b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / pybhspc-0.1.0-cp311-cp311-win_amd64.whl

Download URL pybhspc-0.1.0-cp311-cp311-win_amd64.whl
Size 594.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
75b62bc77d3a20e8674cc0eaff9ef48953288c0fe3e6d32a9cfebfc8a6b366b7
BLAKE2b-256 checksum
How to use checksums
1b989244fef13486642df78ad426d8b0ca07b025b6c3c6f6646627861cb6e7fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / pybhspc-0.1.0-cp310-cp310-win_amd64.whl

Download URL pybhspc-0.1.0-cp310-cp310-win_amd64.whl
Size 594.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1a8b6c8f4b68d7cde0791abd8103c2d96ba694f68d5328a46c5698a475e4a942
BLAKE2b-256 checksum
How to use checksums
e105ba41e7216bb06a46a241b1daf02e45d286fe7580943eaf206884a26ae6cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 release files

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