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.4-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd41116d76ab0d21566cfb89c1f9ac50cc560fe44211b0c0720e832f8be95710 |
|
MD5 | f8c81c465ec3f56fe3f237064c347113 |
|
BLAKE2b-256 | 51fc70b4eee56bce6bc8f0142bf3b207ae64a88097a050bada6e63a8fb712e0d |
Hashes for tangy-0.5.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f9941f3ce8282f67423228e6913337db5f8b1e3bbda3d3189e2e8e131fa5315 |
|
MD5 | b7edce692cca62ecc02b57c2b4f89bc0 |
|
BLAKE2b-256 | 11bba09fc82f9f363aba4d6c236207a10659b1a6fd099bab6ae37b7a815c5f1d |
Hashes for tangy-0.5.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 440437dd9ba22f9e5d71a52a082ee5fe4483361e57cd9d3ca43107e8e451c9e3 |
|
MD5 | 0a88b7f8cc352bec59659fcae7f71774 |
|
BLAKE2b-256 | 875af7138f22cb6d665c8338659958f6d1a659420c72a0497d648ed54171cfed |
Hashes for tangy-0.5.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e7b7c68e65b8aef370f16935aab1699286de56323e06e280fc662c0c48b70d3 |
|
MD5 | 219e94d21ccc31ea006925da45f2642a |
|
BLAKE2b-256 | 630260391a40881caa026aab83f364bfdff8b8d1f7f4f91eb3d83144b2a3aede |
Hashes for tangy-0.5.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d5bb7e187aa4eb6151310343c60b26adc9044ced34790eddc158b889922fd00 |
|
MD5 | 69ea3d1ed51e2cc42917293f497dd4ba |
|
BLAKE2b-256 | 59903bba0a728b5d98510f7f7a2ec75d3e23ca50624621f4d7b2cde0dec92b46 |
Hashes for tangy-0.5.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bcebc9216191a893232d3f939060406d14fad578410e2457ed5f8bb83f9058b |
|
MD5 | 0f42c4707096732f9056afa08030bc9a |
|
BLAKE2b-256 | 8f6b142e38d4d6f94f81af8bb0ba4b22edbda1d1779db850052d0be0498e4dcf |
Hashes for tangy-0.5.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf9f2721f50b4afc60cc4b0618d8da2695f777a7559bf828c0cc8e2178407d7b |
|
MD5 | e412912e52a36b7c37d0d0638750a0e8 |
|
BLAKE2b-256 | e7939cf05759d78d232829889663405542433782a0bc6c12c81a75d527c5c1ad |
Hashes for tangy-0.5.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f7f41c0651a648bf59c25488d3776792fe611b0d7c2b2c678a0c33a5f2b760d |
|
MD5 | 59fb44876b66e9d40248399dde46a55a |
|
BLAKE2b-256 | 0411a3b5447fa69b4942d0db18812872c8432f51c4cc027958e1ee33f4959342 |