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.2-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e92699d0df96fe07c29b01f5c4f8c3b6daaf289c5b1c09da4cdc73a8f7102561 |
|
MD5 | c206ee3829512aa10c79410355a22258 |
|
BLAKE2b-256 | 3256c455f34dcac96d23f33b987ceb4d5b3412a8d103ddda71b873123a1ce4ff |
Hashes for tangy-0.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8adfa2ac620e813424d478db83a5b54f78532d0b531ab59b20d7b009dab293dd |
|
MD5 | d179ef1603bcf9c0a0eda9e420fbf1a6 |
|
BLAKE2b-256 | 3179019ad132594e1b425ca00788508f1dea8b2b8f67631ecccc34443abacbe1 |
Hashes for tangy-0.5.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47dd8ea3bf928885beb7cb01e99508ac0878934188516b3c8774bbadf1ee5e62 |
|
MD5 | 16dbc60c3195cdafe9fd8ba9a9338057 |
|
BLAKE2b-256 | 8b8aedb61b5275e7f7d497805a7226482db985029ac07d8df2a03902381c95bd |
Hashes for tangy-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d049c1902c0a0e03a393e511f7a0153bbc70394401447fce75cb542bca5cc587 |
|
MD5 | 0b05d12e0729a638051871935b277e6c |
|
BLAKE2b-256 | 4e8d49e53c4b6ada952379bf136bb363be7960ac8827b9f8bc4d9ad69d360cfb |
Hashes for tangy-0.5.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c411dfc14002eb2c8003d5f3632fe007e55f504aba43e49b95e778105cf60a |
|
MD5 | d622e4b2334cb8805e8ab935cd8eab11 |
|
BLAKE2b-256 | 1d32fe5ba87a4e7bb40855062d963b1b653e7a6852415d26240df55497d3b052 |
Hashes for tangy-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 200a2f4f71e0e1e4cd33647b3ac30034c59de45f4518f62e3a0981b3852be05a |
|
MD5 | 6033a0cf911b88910424c0494fd57733 |
|
BLAKE2b-256 | 032d2eb951812648f54e6625a946b2adc78cff24f4896cd9af80806a59b1850c |
Hashes for tangy-0.5.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e707dddc864fdea90b72970fc58063b6c5a70d5fd79d2e8c6d681d54458d006 |
|
MD5 | d402f2b6bb9b8da630c0e08579f3d7e4 |
|
BLAKE2b-256 | 383425647889e0c8dff25b50af825017e29724f0c8df6aee25303969ae28d737 |
Hashes for tangy-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a823261dab9283e02ef5f7d4e933ba691d7528d39c740dec4c72875517a8a858 |
|
MD5 | 2e764f994bfcea6dd6438529d702c273 |
|
BLAKE2b-256 | e6e04462075d6414a0112572c81ff9d0200c6ed9d5f763d24f47e5355c1fe8e6 |