Skip to main content

PicoHarp .PhD file importer

Project description

PicoHarp 300 TCSPC .phd file loader

This module was written to be able to read in .phd photon time histograms from the PicoHarp software.

The layout of the file is as documented in the PicoHarp 300 manual in section 8.2.1 (pages 56-58).

Both of these are easy to modify, however the scope of this projec tis limited to our usage case.

The module also loads .txt files which are the copy-pasted data from the PicoHarp software. This is primary way our research group has extracted data in the past, so it makes sense to keep the functionality alive.

For our friends at the University of Saskatchewan, I've also added .asc file loading.

Installation

pip install phdimporter

Usage

The module only uses one struct import and contains one class of importance, TRF.

from phd import TRF

trf = phd('path/to/file/.phd')
## or
trf = phd('path/to/file/.txt')

The most simple way to return the histogram data is to:

x = trf.x # bins in ns
y = trf.y # counts/bin

It is possible to pull raw data out from the .phd file since it's all stored in the TRF object, however I'm not going to document this as the variables share the same names as in the PicoHarp manual, and are easily seen in phd.py.

Not Implemented

The importer has been written with a couple of limitations in mind that are based on our usage:

  • Assumes only one histogram per file
  • Assumes only one PicoHarp device on the machine

The only variable I haven't implemented is the acquisition time, as the computer that we use is not internet connected and the clock is always off, and I'm also not sure how to interpret the time_t data type that the variable is stored in.

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

phdimporter-0.0.3.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

phdimporter-0.0.3-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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