Skip to main content

This Python Package allows interfacing with dotThz files.

Project description

Interface with dotTHz files using Python

PEP8 PyPI PyPI - Downloads

This crate provides an easy way to interface with dotTHz files in Python.

Install it

pip install pydotthz

or

pip3 install pydotthz

and then use like specified in the following example:

from pathlib import Path
import numpy as np
from pydotthz import DotthzFile, DotthzMetaData

if __name__ == "__main__":
    # Sample data
    time = np.linspace(0, 1, 100)  # your time array
    data = np.random.rand(100)  # example 3D data array

    # save the file
    path1 = Path("test1.thz")
    with DotthzFile(path1, "w") as file:
        file.create_measurement("Measurement 1")

        # create meta-data
        metadata = DotthzMetaData()
        metadata.user = "John Doe"
        metadata.version = "1.00"
        metadata.instrument = "Toptica TeraFlash Pro"
        metadata.mode = "THz-TDS/Transmission"

        file["Measurement 1"].set_metadata(metadata)

        # for thzVer 1.00, we need to transpose the array!
        # important: do not manipulate keys on the `dataset` field, otherwise it won't be written to the file.
        file["Measurement 1"]["Sample"] = np.array([time, data]).T

Further examples (e.g. THz image scans) can be found in the examples directory.

Requirements

Requires hdf5 to be installed.

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

pydotthz-1.0.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

pydotthz-1.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file pydotthz-1.0.1.tar.gz.

File metadata

  • Download URL: pydotthz-1.0.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pydotthz-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9be21fcdfef6320d3ceb1815763d0896e004a8fc5a79489b26b573780836c41e
MD5 8dc3fca1cd9465f00c09cc3c14e68368
BLAKE2b-256 3dec8872d535644cfe23c8e668cfb3345b060a90c3edce3fda3708e530b94f7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydotthz-1.0.1.tar.gz:

Publisher: publish.yml on dotTHzTAG/pydotthz

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

File details

Details for the file pydotthz-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pydotthz-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pydotthz-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3654f41c13e3862c664218505f39fa1b550d900e54723ff07c7469df4f504aea
MD5 1a8a024ffa278df97091bdb020b3abf6
BLAKE2b-256 a1938a4092124dbb755729b1db67a45448ac5d94a58a3f47c9bfbb1504e32161

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydotthz-1.0.1-py3-none-any.whl:

Publisher: publish.yml on dotTHzTAG/pydotthz

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