Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

tangy-0.9.0-cp312-cp312-win_amd64.whl (439.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

tangy-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

tangy-0.9.0-cp311-cp311-win_amd64.whl (448.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

tangy-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

tangy-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (300.0 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

tangy-0.9.0-cp311-cp311-macosx_10_9_x86_64.whl (329.1 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

tangy-0.9.0-cp310-cp310-win_amd64.whl (446.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

tangy-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tangy-0.9.0-cp310-cp310-macosx_11_0_arm64.whl (298.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

tangy-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl (328.1 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

tangy-0.9.0-cp39-cp39-win_amd64.whl (446.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

tangy-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tangy-0.9.0-cp39-cp39-macosx_11_0_arm64.whl (298.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

tangy-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl (327.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file tangy-0.9.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: tangy-0.9.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 439.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tangy-0.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a1cd02fdd44ca265f6318fd4034f500754a4fabf542422f2ff81e1886b1601a7
MD5 58ff4bcc7baf46bf36ee02721e12650f
BLAKE2b-256 a24b1839eb8930a18baa3c0747ff14c2eb230e407984759b320c7be1f24caf13

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b1ae0311b433144385d1a3283ab9cffd0225fe0fe3abb55b41484f860affbed
MD5 2d142f88ac1b6a33613b6146eaf75e97
BLAKE2b-256 f2325f12596a3ebc83aee034fc3015113efdd631ac316861d9273a740f50b388

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: tangy-0.9.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 448.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tangy-0.9.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 168fc59c2495e8b470682630fee4d10dd646f035ec94440f4c59e6ffbdf410c7
MD5 63f0a6d2f7cf40e06bd2e19503dc267e
BLAKE2b-256 3e0d6c5971a3ddbd9663e36dda0459ad610273a234ed25616671e3a8621f52e8

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 341e84e5fe16876ca47d0fc57521410a088c7350ea8b28ee59fdee5a3e88f580
MD5 af0aad1d8527464052c228b69d35865a
BLAKE2b-256 a6707377c7381b5c5a2d83f7b910717aaefa0c22974d7990e157ababba6b0162

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 262a0bc16ca3a35a5b2f3ef9c468b461c114e43b1c9fabe50e4d7a6cc3a88e5a
MD5 858f65a091441a656eae5494b8e99a30
BLAKE2b-256 b80e143ef34938df9a2a6d0bb26a3125745bb07469d362b50f236138f1d224e9

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8302261348b33474cc991ad01ce6584380a4a586ff0065df1e3e24d339186b33
MD5 1bd5d26aa1f781430c8b3b6b76e3c1b1
BLAKE2b-256 62f96174b3aad607cced441cfa7baa01c11d6bebe8d791ebb7a5a79ceac9e5d1

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: tangy-0.9.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 446.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tangy-0.9.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 94e1b35ace0db247943a52d49d5457e554d59b1735fa9ce2ce60abfc0b232814
MD5 3de189afc1db67404e0fb610eb22788c
BLAKE2b-256 a1f2289030a8c5cf17fde5b80c14759f0a39ebb024aa658a070692f325fcb5e9

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6cb21608aa9fcabae2c813c980f215ce8d861dacc91b8eeb109acd3cf21803f
MD5 5b340b992566b4af036b5f2e76980fc1
BLAKE2b-256 3fe5c5f91056d7593ad5f54845c4bc14433d3244a3756c5e230c680337a06edf

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3da643e6bde4c87d63cb355f33f0b7a051cfd98198ab19c07aa578df35235796
MD5 bd4135bff785650fa0024519b03b7e4a
BLAKE2b-256 d0a07ed33dbf5f1d920b4a0f393303d3281376fa987f7341eb00fda0b9759a0f

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bfe5818a0e21bd65c94ebda38122fef9577adc1847f17f0a3022ff66ab32476e
MD5 05eeddf57b9a30da509966b52bd7d00d
BLAKE2b-256 77cb130bd93355edc1f8021d64b6e336a3de2511cff1d5bd58ed9995d11b8a53

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: tangy-0.9.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 446.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for tangy-0.9.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 dbc382ad22e3b9ddc2d410ef552c1df9df6cde7b082bdbc5ec0b1dd7093ce097
MD5 2ce953d95f7089dbdc3c522ad6f47667
BLAKE2b-256 d101df2136ee48b04ece53eee2c37f6a1b4e851b8003e41e558620f5b9e3d980

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ac85456c4ccd1b78ed3ebb341149ec0ada3abb68548609573fbb2620e99efd2
MD5 838c10ca971578392a0bcac526dfbd8e
BLAKE2b-256 4c3ce61e1a50e75c83c2a7dfbffeb94a2a4c217bca1f5cb33fddee7c22bbbb80

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ba6f107325686982319a8ca6c42dc84e6042e02353dc7b16b8ec4cbf3543d61
MD5 351a444f54ed732374a753c2a839b588
BLAKE2b-256 ac543934b7bcb8c2f3b6f8ab43745fad066a67eda532832bb15db8606cf2c30f

See more details on using hashes here.

File details

Details for the file tangy-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tangy-0.9.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 345b1e35202276a0fe8f68a283d114223472ab658df139035b1d22bd5bb2c33c
MD5 a53a8f1f57c68af6d4c25acdc5be45ba
BLAKE2b-256 78388acc0932e4e4bcbece081bd88d6a2f3f55abc5ea53b55ac7f0be44bfefd1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page