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.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfde95fb17ea35fe5c496b2c52008e3412e3103fcf4490a38c925602e10eabe1 |
|
MD5 | 8028f610cbb1688d4e883d503bfabfb8 |
|
BLAKE2b-256 | 8ecead24f38419067179e20677727a06e4df910e24584fc19aae2591ee1caa3b |
Hashes for tangy-0.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dde3da7c772bdaa86a3bbd7d49edc20ca3026a3cb93413f6fe438f157a3528c1 |
|
MD5 | 1dd0864e1f9ecfd873e052cd48f2bd7a |
|
BLAKE2b-256 | 4c2d488f1ab295fca0acb2ff04897f6ac95a8c2925e2500651674408aa6c2e26 |
Hashes for tangy-0.5.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d1b3b8132794f9d51be4b3107b53697f2cd5dd2de65673e945f136ffdd94249 |
|
MD5 | 07700f5efff3bf26aa3cb02e93c63503 |
|
BLAKE2b-256 | 6b4fd1c95320a88abbf2bb90a39475bf29e71b22d0f36e9c97496f5c1b313e0f |
Hashes for tangy-0.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fdc742279c626400c3ca20da2088d09f58d685840a39d33b7d129e31c6a873f |
|
MD5 | 452ad639436a4c308bc4302c62ad7b34 |
|
BLAKE2b-256 | 743a00ff49a67be3f1c9caf63bf3c8ba7caf17886873f8b821ea4767734a8f23 |
Hashes for tangy-0.5.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20801bed20b0dd64e65325a55444316a2ed2cc0425ae6ffb34f75b52de04dcac |
|
MD5 | 9a2586101afed0993eaebeaba8167835 |
|
BLAKE2b-256 | ed2fa616327366dd522f6e9d24e873b588027d05188b830f5209602e8c0174e7 |
Hashes for tangy-0.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f149039899132f4218a48f29ec17b745320b970f67943acb0747ccbd86fc65 |
|
MD5 | 757f522617e6d3e56324b7cd050dde23 |
|
BLAKE2b-256 | c18af201a41def9af44019eca636e852b8ac69e5158e3a5a99a1ba30d3a21887 |
Hashes for tangy-0.5.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a48f3d356cb953bb99ff1c26353015fb9b782d46b1392f8c0af6edb82869b54 |
|
MD5 | 89a8cf58cdd130c3bc05f3edaa67fe10 |
|
BLAKE2b-256 | d11479075c1a9c919db74721b33a331a8ed9f523c46717caddd85004e0118bce |
Hashes for tangy-0.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47dca6454da1740fb4de30568b8207e697ab853d045f5463c2cfe1a5fa1f9579 |
|
MD5 | 303015b739afee2328c349b93371dbfc |
|
BLAKE2b-256 | 1eb0e2067325a7f2a9d7c222285e2a69692ea90c2864df195f9b39cf3bf0a6ec |