Skip to main content

Load PicoQuant PTU files.

Project description


title: README author: Jan-Michael Rye

Synopsis

Read PicoQuand PTU files. The code follows the same parsing logic as the Python demo provided by PicoQuant but is up to 40 times faster due to the use of vectorized operations using Numpy arrays.

Links

Usage

Python API

The data in the file is parsed into the following objects which are set as attributes of the parser:

  • headers - A dict mapping header fields to their values.
  • markers - A Pandas DataFrame where each row is a record index with an index, a time tag and a marker.
  • overflows - A Pandas DataFrame where each row is a record with a record index and an overflow values.
  • photons.csv - A Pandas DataFrame where each row is a record with a record index, a channel, a time tag, a resolved time tag (using the global resolution value), and a dtime value.
from pyptu import PTUParser

# A path to a PTU file.
path = /tmp/example.ptu

# Instantiate the parser.
parser = PTUParser(path)

# Load the data.
parser.load()

# The PTU header data.
headers = parser.headers

# The Pandas DataFrame of photon data.
photons = parser.photons

# The Pandas DataFrame of marker data.
markers = parser.markers

# The Pandas DataFrame of overflow values.
overflows = parser.overflows

Command-Line

The package installs the pyptu command-line tool that can be used to convert the data in a PTU file to JSON and CSV files. It accepts the path to a PTU file and an output directory.

# Extract the PTU data to files in an output directory.
pyptu example.ptu output_directory

The output directory will contain the following files:

  • header.json - A JSON file with the headers described above.
  • markers.csv - A CSV file containing the markers DataFrame.
  • overflows.csv - A CSV file containing the overflows DataFrame.
  • photons.csv - A CSV containing the photons DataFrame.

Help Message

$ pyptu -h
usage: pyptu [-h] path dir

Extract PTU data to standard files.

positional arguments:
  path        A path to a PTU file.
  dir         A path to an output directory.

options:
  -h, --help  show this help message and exit

Project details


Download files

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

Source Distribution

pyptu-2023.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

pyptu-2023.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file pyptu-2023.1.tar.gz.

File metadata

  • Download URL: pyptu-2023.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyptu-2023.1.tar.gz
Algorithm Hash digest
SHA256 06eaccfa579b07ca112f5ce25e4d0924a347595650ffa62786086c4a3ac8ba56
MD5 fe00ec5f59d53370cd31af1d07d8637d
BLAKE2b-256 164c8a6fdff2b2aae989165b2e432157e5b82808aeb08302c67e1d9f8f956b67

See more details on using hashes here.

File details

Details for the file pyptu-2023.1-py3-none-any.whl.

File metadata

  • Download URL: pyptu-2023.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for pyptu-2023.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81ca94039069ddb12f9bfee2712daaa4a63a1ce46a74037b2fd57e66ccedcf8f
MD5 b6afba54143ce200fa66c7980d93c892
BLAKE2b-256 7d2130407d67b3f73dabe9460e70af8d55a81420ee8d975f8b625a8e5a97a21e

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