Skip to main content

This Python package allows the configuration and readout of the TeraFlash Pro THz spectrometer. Use at own risk.

Project description

TeraFlash Pro Python Package

PEP8 PyPI PyPI - Downloads

“”

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/

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

teraflash_ctrl-1.4.3.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

teraflash_ctrl-1.4.3-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file teraflash_ctrl-1.4.3.tar.gz.

File metadata

  • Download URL: teraflash_ctrl-1.4.3.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for teraflash_ctrl-1.4.3.tar.gz
Algorithm Hash digest
SHA256 a5d9fe518e15407a950292031404299bfe7ac68b9e59abcfd00c28636ef64a57
MD5 deabe3173a5b4d1eb3b34a2ba0c6ea2d
BLAKE2b-256 d2397a2c9f59a235e5d1e03c53abf387900b6b7f4e62408848d83dadaad3da4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for teraflash_ctrl-1.4.3.tar.gz:

Publisher: publish.yml on unibe-icelab/teraflash-ctrl-python

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

File details

Details for the file teraflash_ctrl-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: teraflash_ctrl-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for teraflash_ctrl-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a7a35509f61a90f54a56861a6885e819762059841ce5fc38ea73d0d17513aa53
MD5 e89848074c4665f7496ca0c6fbded9a5
BLAKE2b-256 5dc38efe73d72243e9ddd4633d5022103305c5451734dc80b7f956b82124df07

See more details on using hashes here.

Provenance

The following attestation bundles were made for teraflash_ctrl-1.4.3-py3-none-any.whl:

Publisher: publish.yml on unibe-icelab/teraflash-ctrl-python

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