Parser for Gigahertz-Optik S-BTS2048 and S-BTS256 spectral data files
Project description
sbts-py
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.
License
MIT
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 sbts_py-1.0.1.tar.gz.
File metadata
- Download URL: sbts_py-1.0.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa271ced2fcd73ca704234e54cce547f0f5f97fdab30830e3394bdcbda9dc32d
|
|
| MD5 |
af704558fd575f1bbc62809d3dd5d4dc
|
|
| BLAKE2b-256 |
d80fc247e13d92d39c3b58fb98ae8593c32d77aad447447abc9490cab84583e5
|
File details
Details for the file sbts_py-1.0.1-py3-none-any.whl.
File metadata
- Download URL: sbts_py-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
306f576ae92a51f21825b5a4d38c8223fe59d5c2e1387e5aa337648aa8cde05e
|
|
| MD5 |
aa1b58afeee6e4f3d79420f26281c821
|
|
| BLAKE2b-256 |
2836463488fd3992c71f8582d50f5b09ca933f9b89dd456ee0cb7afc532cff44
|