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.6.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51a261daf301ef069eb20e64fd15fa41f2180f370740d3971fc3e4513cd0d757 |
|
MD5 | 122c8d9f8f95ae919a4630f69be43779 |
|
BLAKE2b-256 | 2c32965e7aa63dbc9ce6fb4985d47dbbc4e02a90ee9f1ecc967ba8cae684d6a2 |
Hashes for tangy-0.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3179a2f2d1299b3825c7c2f94e6b88edd66d32062b7e41852033a423521b324d |
|
MD5 | 719b789ede217516b1f545ddb47c4e0f |
|
BLAKE2b-256 | b2861559539bbcfdaaaa347b9f0153be358241b9a11017304527a1eecf414475 |
Hashes for tangy-0.6.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 629aa9ecd7996e37ca9c7043bd37ec7585820c7c7b7b811d5979aad587b3a10d |
|
MD5 | 0223570e4108212c5534e14d57f0d666 |
|
BLAKE2b-256 | 88e2f1c3fd31f01323f86a6cdb4b4748f564cf26cbb5299d9f08f27ffa8e5eb7 |
Hashes for tangy-0.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f40e2175ef7540c9df6bff3b0aeabd17fffd7339adbdcbac074ebbe1adc310b2 |
|
MD5 | a2d96bfdc5e15809d03f9ba9ae9b9b43 |
|
BLAKE2b-256 | 7003e361fcf92efcf9a73ec516f7a7163034081bc176efa0842ee52547a30017 |
Hashes for tangy-0.6.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9865d979cd1ac44f7ed1789361a5bbf9c0a6bde946648e9f2707c97ef94e4b30 |
|
MD5 | 8dc29a1877b1cc7e9693993c121c5f58 |
|
BLAKE2b-256 | af5ab3087a031dc7997ddea751c98780c86739513809abaf173fb6ecf104dba7 |
Hashes for tangy-0.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f4fb3f303a97c917d69fb9e3bef06a427476b9ddbff6b57302110d7f36d72b6 |
|
MD5 | 9775b84bfb690a0e189c8c3926fd5ec9 |
|
BLAKE2b-256 | 7979bd16de16b831c00ab4eb2113925b58e9089f934030a3d8b1751f72afb4c7 |
Hashes for tangy-0.6.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b913f1c741474b546b66ed0b5af4353d8a6ae7f135bcf9f0e08951421fe29b22 |
|
MD5 | c930b874184d0a5d61ebc025f01d1929 |
|
BLAKE2b-256 | 4ee77a6f936814d655605939ea832dd487b82ab0825ecf274050b60257499189 |
Hashes for tangy-0.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c415fdfafb86048bda675eadf9b4ddbb9ebd8dd459ea8a81362f5e73da1de684 |
|
MD5 | 210454fe7a0e4a3f2fdbba59ecb507b0 |
|
BLAKE2b-256 | ae44647bf21debedf14bd6f459ef370dd091f18721fa5d2587f3f13bc0621037 |