Read-only Python library for PTIR5 files (HDF5-based format from Photothermal Spectroscopy Corp.)
Project description
ptir5
Read-only Python library for PTIR5 files — the HDF5-based native format of Photothermal Spectroscopy Corp.'s PTIR Studio software (v5.0+).
Installation
pip install ptir5
For local development and testing:
pip install -e .[dev]
pytest -q
Quick Start
import ptir5
with ptir5.open("sample.ptir") as f:
# List all measurements
for m in f.measurements:
print(m.label, m.measurement_type, m.data.shape)
# Access a specific spectrum
spec = f.measurements[0]
x = spec.x_values # wavenumber axis
y = spec.data # signal values
# Navigate the document tree
if f.tree:
for node, folders, leaves in f.tree.walk():
for leaf in leaves:
if leaf.measurement is not None:
print(leaf.name, leaf.measurement.data.shape)
Features
- Read-only access to all PTIR5 measurement types as numpy arrays
- 16 measurement types: O-PTIR spectra/images/hyperspectra, Raman spectra/hyperspectra, camera images, fluorescence images, FL-PTIR images, PTSRS spectra/images, and image stacks
- Hierarchical tree navigation matching PTIR Studio's document structure
- Flat measurement enumeration with type filtering and GUID lookup
- Background spectra access
- Generated data (ROI spectra, band images) from hyperspectral measurements
- Lazy loading — data is read from disk only when accessed
- Dict-like metadata with Python-native types
Data Types
| Type | Class | Array Shape | Dtype |
|---|---|---|---|
| O-PTIR Spectrum | OPTIRSpectrum |
(points,) |
float32 |
| Raman Spectrum | RamanSpectrum |
(points,) |
float32 |
| Generated Spectrum | GeneratedSpectrum |
(points,) |
float32 |
| PTSRS Spectrum | PTSRSSpectrum |
(points,) |
float32 |
| O-PTIR Image | OPTIRImage |
(height, width) |
float32 |
| Generated Image | GeneratedImage |
(height, width) |
float32 |
| PTSRS Image | PTSRSImage |
(height, width) |
float32 |
| Camera Image | CameraImage |
(height, width, bpp) |
uint8 |
| Fluorescence Image | FluorescenceImage |
(height, width, bpp) |
uint8 |
| FL-PTIR Image | FLPTIRImage |
(height, width, bpp) |
uint8 |
| O-PTIR Hyperspectra | OPTIRHyperspectra |
(points, height, width) |
float32 |
| Raman Hyperspectra | RamanHyperspectra |
(points, height, width) |
float32 |
| O-PTIR Image Stack | OPTIRImageStack |
(images, height, width) |
float32 |
| PTSRS Image Stack | PTSRSImageStack |
(images, height, width) |
float32 |
| Camera Image Stack | CameraImageStack |
(images, height, width, bpp) |
uint8 |
| FL-PTIR Image Stack | FLPTIRImageStack |
(images, height, width, bpp) |
uint8 |
Requirements
- Python >= 3.11
- h5py >= 3.9
- numpy >= 1.24
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 ptir5-0.1.0.tar.gz.
File metadata
- Download URL: ptir5-0.1.0.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d00be847ca34c9ac044415723424d042441cb3b49780a343d1cdfc6444c4b9d2
|
|
| MD5 |
8c572734c006ce28a0973be3144ce6ff
|
|
| BLAKE2b-256 |
456d0ae1ec1483f7b1c45cc4689b9da2788aa944ba7b7ed82946d7b6e58e63de
|
Provenance
The following attestation bundles were made for ptir5-0.1.0.tar.gz:
Publisher:
publish.yml on photothermal/PTIR5-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ptir5-0.1.0.tar.gz -
Subject digest:
d00be847ca34c9ac044415723424d042441cb3b49780a343d1cdfc6444c4b9d2 - Sigstore transparency entry: 1645189758
- Sigstore integration time:
-
Permalink:
photothermal/PTIR5-py@ec9c941a915d989af4a8ea3a9a3ba3c8410c1a95 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/photothermal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ec9c941a915d989af4a8ea3a9a3ba3c8410c1a95 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ptir5-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ptir5-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
208301c4eb8930b6573b01370cdc9ff58d56babab6219c09f5a5f50d70ec17c5
|
|
| MD5 |
e31fee3986815ec9ec1044bb7c89afc1
|
|
| BLAKE2b-256 |
84ec3789799c4138ede9f37ba9328fdde73191cf940ef24f66716f81febf146a
|
Provenance
The following attestation bundles were made for ptir5-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on photothermal/PTIR5-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ptir5-0.1.0-py3-none-any.whl -
Subject digest:
208301c4eb8930b6573b01370cdc9ff58d56babab6219c09f5a5f50d70ec17c5 - Sigstore transparency entry: 1645189820
- Sigstore integration time:
-
Permalink:
photothermal/PTIR5-py@ec9c941a915d989af4a8ea3a9a3ba3c8410c1a95 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/photothermal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ec9c941a915d989af4a8ea3a9a3ba3c8410c1a95 -
Trigger Event:
release
-
Statement type: