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/Peter-Barrow/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.7.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 791861d0e6db94852acdb43ed4a69c234233f1f0b20530532fa3c03706d15a91 |
|
MD5 | 2e8df0c040bf6317c943b90209cd9f56 |
|
BLAKE2b-256 | b1d95e0b09f039508caa7ff7596750a0a2ffe519a4c45884fd42f0d5b6d947e0 |
Hashes for tangy-0.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c91fd771858aa751eaabb257b68230884d704002cf973520a0cdbaac8795b129 |
|
MD5 | 11f5a9294c73044bbd9cbfbef513039b |
|
BLAKE2b-256 | 120be055f1ef7cfc2b913b8282e129139d7ea9b99e89a36b14effa49df468268 |
Hashes for tangy-0.7.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a7d01c23d907c467a4479340b3d27e38d110a899f7b8bf7e0278c9d72402892 |
|
MD5 | f0d5823bec329dd8195fb40b41b04ec2 |
|
BLAKE2b-256 | c21621bbc70e1a8e9835686b20ae7c0e4437af22614af7dad1121b16976692b1 |
Hashes for tangy-0.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d0444d16d489fac919a9cbfd820ea28d0b15618da9f982875e03a0e85416ed |
|
MD5 | 4aa51604a208e3568163289e0a2e83c3 |
|
BLAKE2b-256 | ee323626a8cb65876fe3c6d3198e50e73cdbc87ac21c19e55fd82a3a67aedd70 |
Hashes for tangy-0.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d44251739338ed88044e52ec666dd8b1ecf619020620efef3dabc11e2fa33df7 |
|
MD5 | 66848784478629cade6e91b0d43bd26b |
|
BLAKE2b-256 | aa91b7f4ac45fa576980c2515552abdc77b70a95928b55f161b4f9fb99648798 |
Hashes for tangy-0.7.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63e9e34e575d16e167dd98e18f15872fb47a0aafe2fd201e69586cfda76c04e9 |
|
MD5 | 21a06e4070f7c15ace6e4cc62d63c832 |
|
BLAKE2b-256 | 50830cd981250c858743a728be9308bce7aebaea89288762fa5717bc661062b6 |
Hashes for tangy-0.7.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98d9299e6b050573bde8b37655e638c32098d67081a5c5da8ee647c71a490fa1 |
|
MD5 | 37f0f96e92b3a4657309d0f743528731 |
|
BLAKE2b-256 | 4694e5a8d6a570e4e15353903011f839d72d70812be2a4a90739d7df679c0980 |
Hashes for tangy-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed414f7fd50960b04aff396eeb40e62a245d72f7055e1b851c5f8e30a7632931 |
|
MD5 | b29a1eb3a32ad1ecbce45a9703390d6b |
|
BLAKE2b-256 | 3192a4a162f1b585a00fca58a7ebf17ca5df22f5bcd8f11aae1d29b8566ee277 |
Hashes for tangy-0.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0e995a04621121f19fdd8880179cfa71a28097b56fbc9bb11bb63fb4ff3b711 |
|
MD5 | abe7b064b31e26a28a4df7055fd8edbe |
|
BLAKE2b-256 | 6439d85106ebaa0237c0a26125944cf70dd5c50d3b76cf64e1afc56fa0ea98c9 |
Hashes for tangy-0.7.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d59f1b94818f293226ee440ea3fa7b06852074410a8ba1d780f3772300f8c1c |
|
MD5 | db9f2d9b4d5e3388024e785c1b9e074d |
|
BLAKE2b-256 | 89d13f7a806dda313b22fd1d1b612796b86fc7ba4884369054f2da2b9540bef8 |
Hashes for tangy-0.7.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b9af0537a7a316c95e0285068eac1f4f90dde76295be24d1c0f216765c791ed |
|
MD5 | 32462566e03a94bf5547762f3e737821 |
|
BLAKE2b-256 | c03448e6e0c3babde952f2576c7139f7137c3fe29d84fa177130605f98c668ae |
Hashes for tangy-0.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad47734c6f9e641ec55f42d2cf563ce2b46436db7138ea050799dcc54e791c0 |
|
MD5 | 2ca7930fab24a1abdc3686d4887716c0 |
|
BLAKE2b-256 | 1c8af1373686f633eb59a6075ed70236740a5e114f272abf88032f51d9cbb223 |
Hashes for tangy-0.7.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebc07130b474154da10e02a2ede8bc733cca2a4bb0c661c65c7934898a7dca49 |
|
MD5 | ec0f97afab9799cd7931314bf151b6f4 |
|
BLAKE2b-256 | 439d46d779ba85dbad4e6dbc00e096e6dff581556b4ff1dc80f5e94fa687f405 |
Hashes for tangy-0.7.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31557d07748f6d474c0d3f32294d204a57d1407d83dee9169c9a2e4d7a3a678a |
|
MD5 | cf0235eb30876242e14bb169bce7a03a |
|
BLAKE2b-256 | e5960143e3a6d7088ded9b0b9573bb4a854aa545131d438c8a0ed2e4f3815072 |