Skip to main content

sbts-py

PyPI version License Python

Parser for spectral data files exported by Gigahertz-Optik S-BTS2048 and S-BTS256 spectroradiometers (.xls BIFF8 format).

Installation

pip install sbts-py

Usage

from sbts import read

# Single measurement
measurements = read('measurement.xls')
s = measurements[0]

print(s.instrument)               # 'S-BTS2048' or 'S-BTS256'
print(s.wavelengths[0])           # 350.0  (nm)
print(len(s.spd))                 # 701 (S-BTS2048) or 371 (S-BTS256)

print(s.data.get('CCT'))          # 4043.16
print(s.data.get('CRI: Ra'))      # 82.45
print(s.data.get('date'))         # '23.06.2025'

# Multi-measurement file
measurements = read('multi.xls')
for m in measurements:
    print(m.data.get('CCT'), m.data.get('samplenumber'))

# S-BTS256 — diode progression
s = read('S-BTS256.xls')[0]
print(s.diode_time_ms)            # [0.0, 0.02, ...] or None
print(s.data.get('Pst'))          # flicker Pst

Returned object

read() always returns list[Sbts] — a list of one element for a single-measurement file, N elements for a multi-measurement file.

@dataclass
class Sbts:
    wavelengths: list[float]        # wavelengths in nm
    spd: list[float]                # spectral irradiance (W/m²)/nm
    data: dict[str, Any]            # all scalar key/value pairs from the file
    diode_time_ms: list[float] | None
    diode_values: list[float] | None
    instrument: str | None          # 'S-BTS2048' | 'S-BTS256' | None

All missing or unavailable values (-9999.0 convention) are normalized to None.

Compatibility

The sheet name used by the Gigahertz-Optik export software has changed across versions (Sheet3 in older versions, Sheet1 in recent ones). sbts-py automatically tries Sheet3, then Sheet1, then Sheet2.

License

MIT

Release files for sbts-py 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 sbts-py 1.0.2
File Size Uploaded
sbts_py-1.0.2.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sbts-py 1.0.2
File Interpreter ABI Platform
sbts_py-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / sbts_py-1.0.2.tar.gz

Download URL sbts_py-1.0.2.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
97648e67da8613d830e8060124bf4a50338777b1e5ea0f7d436484d58ba9ef88
BLAKE2b-256 checksum
How to use checksums
5c5ced89f70b3d51dae7c39a3ecdb549ec8f1f5f62c920e5983bd182b6819085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / sbts_py-1.0.2-py3-none-any.whl

Download URL sbts_py-1.0.2-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f8756f99dc839822c0c3cfb96d4c6aba37e80ff5916aed2ffd968d139b9c382
BLAKE2b-256 checksum
How to use checksums
2322d404dc49878fe61d7a2a549b7a0c66e9628e90e6d7712ee58813886dc82d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 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