Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tangy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tangy

Timetag analysing library

  • 0.9.1
  • PyPI
  • Socket score

Maintainers
1

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)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc