Skip to main content

🍕 Trattoria 🍕

Trattoria delivers you the fastest streaming algorithms to analyze your TTTR data. We currenlty support the following algorithms:

  • Second order autocorrelations: Calculate the autocorrelation between two channels of your TCSPC.
  • Third Order autocorrelations: Calculate the coincidences between 3 channels. A sync version is provided were it uses the fact that the sync channel is periodic and known.
  • Intensity time trace: Calculate the intensity on each (or all) channels versus time.
  • Zero finder: Given two uncorrelated channels (e.g. a laser behind a 50/50 splitter) compute the delay between the input channels.
  • Lifetime: Compute the lifetime histogram from a pulsed excitation experiment.

Supported file formats

Currently Trattoria can only read PTU files from PicoQuant. If you want support for more or want to help providing it please put a ticket on the tttr-toolbox project.

Installing

pip install trattoria

Examples

The entry point to Trattoria is the PTUFile class. This class has methods that give us access to the algorithms. Each of the algorithms takes as input a parameter object and returns a results object. For a complete list of the functionality see the examples folder.

from pathlib import Path

import trattoria

import matplotlib.pyplot as plt

ptu_filepath = Path("/path/to/some.ptu")
ptu = trattoria.PTUFile(ptu_filepath)

timetrace_params = trattoria.TimeTraceParameters(
    resolution=10.0,
    channel=None,
)
tt_res = ptu.timetrace(timetrace_params)

plt.plot(tt_res.t, tt_res.tt / timetrace_params.resolution)
plt.xlabel("Time (s)")
plt.ylabel("Intensity (Hz)")
plt.show()

The examples folders contains examples of all the functionality available in Trattoria. For more details check the docstrings in core.py.

Design

Trattoria is just a very thin wrapper around the trattoria-core library which itselfs provides a lower level interface to the the tttr-toolbox library. A Rust project that provides the compiled components that allows us to go fast.

Changelog

0.3.5

  • Bug fix. The last 1024*16 where being ignored for performance reasons. This has has been fixed upstream in tttr-toolbox and this version of Trattoria uses the upgraded version of trattoria-core.
  • trattoria-core dropped support for Python 3.6 and 3.7 and therefore Trattoria too.

0.3.4

  • The g2 algorithm now supports a mode flag. With "symmetric" we use the prefered version of the algorithm that returns negative and positive delays. "asymmetric" returns only positive delays but is faster. Default is "symmetric".

0.3.3

  • The underlying TTTR Toolbox and Trattoria Core were refactored to support multiple custom ranges or records at once. start_range and stop_range have disappeared in favor of record_ranges. It takes a list of tuples of integers or None.

Citing

Metadata

Release files for trattoria 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trattoria 0.3.7
File Size Uploaded
trattoria-0.3.7.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trattoria 0.3.7
File Interpreter ABI Platform
trattoria-0.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / trattoria-0.3.7.tar.gz

Download URL trattoria-0.3.7.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7a960c6b3a1979ef86f8ef5d0cda18bc4ed3cecd4ba57e23447d1f39caa95150
BLAKE2b-256 checksum
How to use checksums
8da32b37a7833e7a2e3a61b694be35b11c5ad9e9d7970f902cf4bec43161cb11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.11 Darwin/22.1.0

Release files / trattoria-0.3.7-py3-none-any.whl

Download URL trattoria-0.3.7-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29a6451ca1042aed629edf0d246c1a8f9751d2d2e31830047975655cf9367662
BLAKE2b-256 checksum
How to use checksums
304ddeeba367edc3ae148758eb3e5e6f8a1b22d563136eafdc0138a491d3449f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.11 Darwin/22.1.0

Release history Release notifications | RSS feed

This release

0.3.7 This release

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page