Skip to main content

This Python package allows the configuration and readout of the TeraFlash Pro THz spectrometer.

Project description

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 the latest release or the current state as a zip archive, move it into your working directory and then run:

pip install teraflash-ctrl-python-v1.4.0.zip

for the latest version or

pip install teraflash-ctrl-python-main.zip

for the current state of the main branch to install the package for your virtual python environment or system-wide.

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.0.tar.gz (14.2 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.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: teraflash_ctrl-1.4.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for teraflash_ctrl-1.4.0.tar.gz
Algorithm Hash digest
SHA256 b07f28f5866f15fe8dd0d25565199edb9b28c97da7d2ceea4967f34f2a83d469
MD5 807b17723b87d97448b832b21b89e1f5
BLAKE2b-256 b74bdeffa14440eefd1a436b4261c80ae843ca63be09284ddf5147a74be78b71

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teraflash_ctrl-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for teraflash_ctrl-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 449ce2bb81369c4a58c8bc14dca1678a9f86b03c7618d007e1f401c88f71daab
MD5 121b63d90c1629cb83734a0a6e61bbd9
BLAKE2b-256 f632cc9d1a5288a9ee405941e2cdd660970db775fcd2bdded2dcb305521f4ea3

See more details on using hashes here.

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