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 themarkers
DataFrame.overflows.csv
- A CSV file containing theoverflows
DataFrame.photons.csv
- A CSV containing thephotons
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
Built Distribution
File details
Details for the file pyptu-2023.2.tar.gz
.
File metadata
- Download URL: pyptu-2023.2.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7afd82d153de026f1be84c056f587132ff6814f8901ca9ccb7eaedabdc5e79d2 |
|
MD5 | c1ad7756d25017095a2fe262a127347a |
|
BLAKE2b-256 | 9606149878071beb2d7e45b69af28fb02a56e3bebfb7b07819a59a363912766e |
File details
Details for the file pyptu-2023.2-py3-none-any.whl
.
File metadata
- Download URL: pyptu-2023.2-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 153ee3381ce138ddebf0190a5d583e87440904ea15e51150005df7d936c76686 |
|
MD5 | c81e64424edfd062bb277eab073a7193 |
|
BLAKE2b-256 | 9ee01ade1a5f4e5bd3ac94ad1e1a14958c53396784f3c5e1a3b8fc55de7f2ad1 |