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.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de969685cc868a06dc5239f7169a10ab14da95da695c0c3dc6c122f36944e6c9 |
|
MD5 | 6c2eb4fdcdfab102177ea22d8e64188f |
|
BLAKE2b-256 | 299a75bd19f85a770e988d6264c146cd02538e54063e13a0979a1f48259f901e |
Hashes for tangy-0.5.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4d2ee0d6ac71efcbd44fcdc2df036374658c949b9fc2a9c52f84f912e682912 |
|
MD5 | cb79e4ee9b6648cf3cfebfecefe8fd78 |
|
BLAKE2b-256 | 6ccfc932e2e7110be531512b7871a0c41479b6dca32a16ee181296b339c014d1 |
Hashes for tangy-0.5.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b73d8fe48c53c0b3344c85320c122d1272061b4ea360035160f24eace7ccfcf5 |
|
MD5 | 2e0b056e11cdb0671d443002343e336b |
|
BLAKE2b-256 | 10112c69d208a93651ba1c689b2c085233ba2ded2d50f9bf238ef7135a619969 |
Hashes for tangy-0.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08530ec037ef9f38279e434d70e1bb27ef26cd9d8e78cb192fd9137b8bab650b |
|
MD5 | 637c498f85d8de6ef42aecc6f369acbb |
|
BLAKE2b-256 | d7d86ddd6f79d04db443ac57567c08daea2b2d8deedd7c63e7ecdd9fe0259d0f |
Hashes for tangy-0.5.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 136e5d6b2fc620b0d83f646dd72febc96b8506daa89e7e516494c62343926af9 |
|
MD5 | c2be2586362442386208ef4a8ece436d |
|
BLAKE2b-256 | 798ca980ea5835abdef2e64c654cf1831dcabaf50f1e760c15a84641b54cf602 |
Hashes for tangy-0.5.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4db8e665a5358237cfd0d83b5eb8e8346992aa4be8591b8d19851d42e74fc24 |
|
MD5 | 392641066af2d9db5dbd52be43a1bfbd |
|
BLAKE2b-256 | 3a102c33dfddd3b4372bdcf76db5179d78339c8e20da92473bc910c7d12bf795 |
Hashes for tangy-0.5.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 641442dba65a467ae8bcb91e7c239f6897fefbfaf2977db9d6137df7d455f612 |
|
MD5 | 6025c07e4be8e8f713f6b60f62b9aa52 |
|
BLAKE2b-256 | f4682553648e3a839c015057d1931fec28842e0073354fed3d62db374f36289c |
Hashes for tangy-0.5.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d1e1d7bf1cae6d3d32af86bbb81db9272dc9b740d5a37018388066ab405519a |
|
MD5 | dee881de146b1d1a887cc06d47f403c7 |
|
BLAKE2b-256 | 9c49e59b9c3cc571d8d0eb34b757c0e0d8a8f558992311bb1ef2403665d1f2d4 |