Skip to main content

Read-only Python library for PTIR5 files (HDF5-based format from Photothermal Spectroscopy Corp.)

Project description

ptir5

CI PyPI version License: MIT

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


Download files

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

Source Distribution

ptir5-0.1.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

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

ptir5-0.1.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

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

Hashes for ptir5-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d00be847ca34c9ac044415723424d042441cb3b49780a343d1cdfc6444c4b9d2
MD5 8c572734c006ce28a0973be3144ce6ff
BLAKE2b-256 456d0ae1ec1483f7b1c45cc4689b9da2788aa944ba7b7ed82946d7b6e58e63de

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptir5-0.1.0.tar.gz:

Publisher: publish.yml on photothermal/PTIR5-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ptir5-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 208301c4eb8930b6573b01370cdc9ff58d56babab6219c09f5a5f50d70ec17c5
MD5 e31fee3986815ec9ec1044bb7c89afc1
BLAKE2b-256 84ec3789799c4138ede9f37ba9328fdde73191cf940ef24f66716f81febf146a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptir5-0.1.0-py3-none-any.whl:

Publisher: publish.yml on photothermal/PTIR5-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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