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.8.2-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c01a9d7013ddb525425f7d4f59bbf4b8a579030f1e8de4ef62f2010bfe982a2 |
|
MD5 | b807e6650f8186d541418a709c457839 |
|
BLAKE2b-256 | 5032c8117e1da99ac820cf248f9a07f80d7c0ed92fe8eb8b5345533915c4a56e |
Hashes for tangy-0.8.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f7db2195762c3308cc82b1a823c56b217a038e34c629d8957f7e23c570b3707 |
|
MD5 | 0a7dab002958cd3fd5420893bb19705a |
|
BLAKE2b-256 | c7b7d7348380dc05bf99e95e77970c518aa6cd945004c75a638ffd1c50b54dd8 |
Hashes for tangy-0.8.2-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1b7e951c7920132ca47203a6f8e3cf9be513415a883b344168bd3cbdb199ead |
|
MD5 | 9c1e637fa238276513a034bee76a5712 |
|
BLAKE2b-256 | 773fbafab3c76bfb291c1798379f13fbd4ca067ce3b17cfb7c84f94ab7c8fa5e |
Hashes for tangy-0.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3321d333f5c8f32d91ab2368dc4f1119345e44368f89928874045f647d51ab5a |
|
MD5 | ae4228a12259eaaa2a1a54541ecfc43f |
|
BLAKE2b-256 | 2c060992c00528f7ab78eff3dca116b49b690dd30fbcd0fe363eb88cca89a382 |
Hashes for tangy-0.8.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c853c5323adf0ccbed49f67621495b0e26c54ca7802298009c93d9cdc526928 |
|
MD5 | 53b01b2e134efe7ad3af817565e645fe |
|
BLAKE2b-256 | e39759554c729fd3c16f643cb4edbada41e470f9994612a06dafe355d392ec24 |
Hashes for tangy-0.8.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd51a7907b2d1e3fe44e3f188c6959619c397673d252c4de71437b04b10735a8 |
|
MD5 | f70b01d84691bef52c0151375d72bd98 |
|
BLAKE2b-256 | 4deb3befd80d84eae78d0cc5e18e7c27c0e3d6549a6721c2849eb8ae045dbc4d |
Hashes for tangy-0.8.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf1d12b06799f481c4abb59600693bf914c57deac9eac05bf4738f0d52ac664f |
|
MD5 | 65d77da30afd6dfc6481a25b722fd707 |
|
BLAKE2b-256 | 1d4a5e9b832ae7a05b93b21c042f1f51800b057b20f119c802eaaee1789fd30a |
Hashes for tangy-0.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91acd1d573b7c61335ec737a25dcbd4218f63729c9fd0e018900671fc6c35d9c |
|
MD5 | e879985c944862f240ab04615baacec5 |
|
BLAKE2b-256 | ce20db2f8ca325e39380049a203ce1de06b13636a6c703e85028f03a72ce4ea7 |
Hashes for tangy-0.8.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e17abd6d2652fdaf1401ddeae4257966d5bdb484a85916085d3d8827fc404b9 |
|
MD5 | 41b97a1c17c832dd4d6e0a15f224ef61 |
|
BLAKE2b-256 | c803054bf196ff471397dd929a38f1d6b7ba994dbc43839762c29b62afe9e15d |
Hashes for tangy-0.8.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faa02aacc5cdf7ad5a7640326053f677fbbb4ea02a89ac80e9810c31ded45e8a |
|
MD5 | e474702ee29014fbc746de8de3a02485 |
|
BLAKE2b-256 | ad151a16d623d968755c2c554468ca254ede3094b69c4d8c65eaa6f2102ab751 |
Hashes for tangy-0.8.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a92ed2fa48a71ae5024d72c0085040480f715bc08a219c64527238e045ad0151 |
|
MD5 | a4e34190eddbabceaec14c514271a64b |
|
BLAKE2b-256 | 1d97791b6149055603f516deb692f06e1dcfb82912e36dc8accdc8ee7ddd2773 |
Hashes for tangy-0.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 689036949dd09f4c5b1d5feab04ffb1f72e3ed48d13728047061f1139e3f167d |
|
MD5 | 4bf8ca8903f511ae596f9a75a06989ea |
|
BLAKE2b-256 | fd6ed9a5bc9d6e41119f446e8d31f9c24bd751a073f513897f5a8912347e126c |
Hashes for tangy-0.8.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c128b29a131db5b9928bd61d23d3ee1d23294fda8075b0bc3dc05215f8535964 |
|
MD5 | 0087c71cf3ac64cc546f059fb5a6d84c |
|
BLAKE2b-256 | 4ec518da06a65c0da73b93f82926d4878a2c995b4a7469079b4868f60446e1cd |
Hashes for tangy-0.8.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7647fae8a77c43364c17a9e0e3aacba0e11223e00d3e5abe9babb6a1f2f656c3 |
|
MD5 | 8d72fd24066ab9f0692cfbb7c7baff43 |
|
BLAKE2b-256 | aaf40f4866ed20df5133ad9a0a45ae3c927afcccd1806564686d995312dfdc02 |