Timetag analysing library
Project description
Welcome to tangy 🍊
tangy is a high performance library to buffer timetags from timetaggers and files and provides soft-realtime analysis.
About
It stores your timetag data in a circular buffer backed by shared memory allowing you to have multiple client connect to the same buffer. When streaming data from a device into a tangy buffer this allows you to have multiple connections to the same device facilitating either mulitple lab users or multiple concurrent experiments. Alternatively, if you have a large file of containing timetags you can read a section into a tangy buffer in one python interpreter and perform analysis on that section in another speeding up exploratory analysis.
Features
- Support for different timetag formats
- A client-server model for buffering and analysis
- Analysis for:
- Singles counting
- Coincidence counting
- Delay finding
- Joint delay histograms
Installation
python3 -m pip install tangy
python3 -m pip install tangy[gui] # if you intend on using the guis
Advanced
Install from git to get the latest version
python3 -m pip install git+https://gitlab.com/PeterBarrow/tangy.git
Quick Examples
Open a file and read some data
import tangy
target_file = 'tttr_data.ptu'
n = int(1e7)
name = "tagbuffer"
# Open the file
ptu = tangy.PTUFile(target_file, name, n)
# Read some data from the file
for i in range(11):
start_time = perf_counter()
a = ptu.read(1e6)
stop_time = perf_counter()
run_time += (stop_time - start_time)
print([ptu.record_count, ptu.count])
# Acquire the buffer
buffer = ptu.buffer()
Count coincidences in the last second for channels [0, 1] with a 1ns window
integration_time = 1
coincidence_window = 1e-9
channels = [0, 1]
count = buffer.coincidence_count(integration_time, coincidence_window, channels)
Collect coincident timetags
records = buffer.coincidence_collect(integration_time, coincidence_window, channels)
Find the delays between pairs of channels
channel_a = 0
channel_b = 1
integration_time = 10
measurement_resolution = 6.25e-9
result_delay = buffer.relative_delay(channel_a, channel_b,
integration_time,
resolution=6.25e-9,
window=250e-7)
delays = [0, result_delay.t0]
Count (or collect) coincidences with delays
count = buffer.coincidence_count(integration_time,
coincidence_window,
channels,
delays=delays)
records = buffer.coincidence_collect(integration_time,
coincidence_window,
channels,
delays=delays)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for tangy-0.5.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84d531d4d761951a71df442e875e948e86ca8f3ae4180fa78303f92204e7a1fc |
|
MD5 | 5f0f148ed98c3c9b08de012ed811cdfb |
|
BLAKE2b-256 | 19c8de79a1b3ce5a992f27c06a8c98f4dd683f79cfce9ad1ed7d146df136775e |
Hashes for tangy-0.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09187c651492099bed832cbe469d161759f87f0acba5e761fe500fea07fe1011 |
|
MD5 | a4ea0c8ebcade23ec436478ba4542d74 |
|
BLAKE2b-256 | 2a9f6afd07d7334b7551c4bdaac680ddfab8fca222c0c0cb7cdca9f7bf3c0ba7 |
Hashes for tangy-0.5.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09675a1e7885d21c726ee976d6d97b3107c331d1b95458856e6fc45c96d33ea8 |
|
MD5 | 5169c66828b0a27ab32241132eab1a0a |
|
BLAKE2b-256 | 2d5506986f818b7d02f203dbb1c5f108986330b306b65f37c50b4a0f83323722 |
Hashes for tangy-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04ffb77f6e61f622e9176613f682e6f0f45603abbc6c2b15a577553955df2f3 |
|
MD5 | 499b5fbdc5fa5fd8ea7b984f80264210 |
|
BLAKE2b-256 | 5307dd12f1733069b994278a8b0afe829debbb810d302166ae417b2fae8069f2 |
Hashes for tangy-0.5.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edc24a7c52d5f83ba952fe69c93c3ca7a573a06cfc273f4d9fc26c2892dd1c07 |
|
MD5 | f12150c801ac9b2c569708d2703027e2 |
|
BLAKE2b-256 | b157034119e8083342cd9594d2d5d8c6cc97b63ca3045b187f8d6914e0da26fa |
Hashes for tangy-0.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3afb01fe2edb02867d1c233834019bf9fcf525131f19f006fe52aa0d29fc9d3b |
|
MD5 | e51e163af9df95835eaa07b79f158797 |
|
BLAKE2b-256 | 4eb0b3c4da61ce5fa7f36b42fe14ff14f684de2f7044b3a4eb339a5a41d16afc |
Hashes for tangy-0.5.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d649105bbbf9686ecee60ca6e6d211ef55da9d23b9471993debcd8d0370ee96 |
|
MD5 | 4aca57326f2385c98c2cced9931ea055 |
|
BLAKE2b-256 | 8a45f7edd4996d793c4ccc2e81600d5c5d225d8ddd494f5033e2a2bb1160f160 |
Hashes for tangy-0.5.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23e16e0d49180a50bf36dd310e75fe95360f4f6f46299e121dd39f8943289443 |
|
MD5 | d23d769f6b8b5675417cf853d729d2ff |
|
BLAKE2b-256 | 316a26ecca2e480b2079ebcf51b1015cc54557c40f97252e9aed61be2dbbdb35 |