Skip to main content

THzPy

THzPy is a scientific computing library for processing terahertz time-domain spectroscopy data.

The aim of this library is simplify and speed up the analysis of THz-TDS data, as well as promote the standardisation of processing methods between research groups and industry.

Development of this package is ongoing, we are in the process of adding features and support for a wider range of experimental setups and processes. If you encounter any bugs or there are any specific features you would like to see added please get in touch.

Features

  • Windowing and filtering.
  • Extraction of optical constants.
  • Spectral feature extraction. (UPCOMING)
  • Support for the DotTHz file format. (see examples/basic_thz.py for a possible application)

Usage

The package can be installed via pip:

pip install thzpy

The package then presents various functions to use like so:

from thzpy.timedomain import common_window
from thzpy.transferfunctions import uniform_slab

# Apply the same hanning window to all datasets with a half-width of 15 ps.
reference, baseline = common_window([reference, baseline],
                                    half_width=15, win_func="hanning")

# Calculate buffer material properties.
buffer = uniform_slab(reference_thickness,
                      reference, baseline,
                      upsampling=3, min_frequency=0.2, max_frequency=3,
                      all_optical_constants=True)

Please see the examples folder for full demonstrations of how to use the package.

Documentation

GitHub

Authors

Feedback

If you have any feedback, please reach out to us at jnw35@cam.ac.uk

License

LGPLv3

Metadata

Release files for thzpy 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thzpy 0.2.1
File Size Uploaded
thzpy-0.2.1.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for thzpy 0.2.1
File Interpreter ABI Platform
thzpy-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 37.6 kB

Release files / thzpy-0.2.1.tar.gz

Download URL thzpy-0.2.1.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3bed08c31d714ae134b12ee0440155775153dcffefc2c91ba2572bc3255eea47
BLAKE2b-256 checksum
How to use checksums
bcd3762dfff9fe6ef31c4fd76396e80eaf8b888298c065333f29eab46e83e0da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2025.

Transparency log

Release files / thzpy-0.2.1-py3-none-any.whl

Download URL thzpy-0.2.1-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50d3f6cfc6e3555d1f868eab3020739a4df7c4cf434611db0a52932b22c7e433
BLAKE2b-256 checksum
How to use checksums
7b58bcacd8185a2999931d903ce6795d456aada685ed0031fa81cef632ff2533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

1 release file

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