TeraFlash Pro Python Package
This code is developed by the University of Bern and is no official product of Toptica Photonics AG.
This Python Package allows the configuration and readout of the TeraFlash Pro THz spectrometer.
The TCP communication protocol is probably incomplete and features may be missing as it was reverse engineered using
wireshark. The scanning stage is not supported but a list of other features is.
This is a simple library with no persistence settings (the configurations of the previous run will not be stored when the python session is closed). A complete GUI written in Rust is also available here.
Features:
- Select begin time for the time window
- Select range
- Select average
- Start/Stop Laser
- Start/Stop Emitters
- Start/Stop Acquisition
- Set transmission
- Set motion mode
- Set channel
- Get status
- Get data (time domain and frequency domain)
- auto pulse detection function
- Set antenna range
- ...
I. Installation
Download from PyPi:
pip install teraflash-ctrl
II. Taking a measurement
When connected to the device, you can turn on the laser and then the emitter.
After starting the acquisition, new data should be continuously updated and the most recent dataset can be obtained using device.get_data():
from teraflash import TeraFlash
if __name__ == "__main__":
ip = "169.254.84.101"
with TeraFlash(ip) as device:
print(device.get_status())
device.set_laser(True)
device.set_emitter(1, True)
device.set_acq_start()
print(device.get_data())
Always use the context manager to ensure that the connection is properly closed upon exiting!
Consult the example.py for usage.
Disclaimer: This package is provided on a best effort basis with no guarantee as to the functionality and correctness. Use at your own risk. Users are encouraged to contribute by submitting issues and/or pull requests for bug reporting or feature requests.
Copyright (c) 2026 University of Bern, Space Research & Planetary Sciences, Linus Leo Stöckli.
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc/4.0/
Metadata
Release files for teraflash-ctrl 1.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| teraflash_ctrl-1.4.3.tar.gz | 19.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| teraflash_ctrl-1.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.0 kB
Release files / teraflash_ctrl-1.4.3.tar.gz
| Download URL | teraflash_ctrl-1.4.3.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5d9fe518e15407a950292031404299bfe7ac68b9e59abcfd00c28636ef64a57
|
|
BLAKE2b-256 checksum How to use checksums |
d2397a2c9f59a235e5d1e03c53abf387900b6b7f4e62408848d83dadaad3da4d
|
| 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 Apr 7, 2026.
Transparency logRelease files / teraflash_ctrl-1.4.3-py3-none-any.whl
| Download URL | teraflash_ctrl-1.4.3-py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7a35509f61a90f54a56861a6885e819762059841ce5fc38ea73d0d17513aa53
|
|
BLAKE2b-256 checksum How to use checksums |
5dc38efe73d72243e9ddd4633d5022103305c5451734dc80b7f956b82124df07
|
| 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 Apr 7, 2026.
Transparency log