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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file phdimporter-0.0.3.tar.gz.

File metadata

  • Download URL: phdimporter-0.0.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for phdimporter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 cf2f097120b099be48de9e86858c272f9efe9f51e336d450b8d24bcbe79de7e8
MD5 c1c00aa3fcb4f69ffc4e714639c17d30
BLAKE2b-256 cec66fa3d8b3adb50ed0840a8bbcd5b7dc01039c8549591236cb4f7198f71983

See more details on using hashes here.

File details

Details for the file phdimporter-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: phdimporter-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for phdimporter-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 289b8389c395edaec9748f833c22bbcbc24cd4babb9ddf0bfe2c121168f93f52
MD5 fb9803595fadbc9a7bb452ae9b2f9c70
BLAKE2b-256 ffad02524ab870579576c87cfae4e6011fad0292b8dd74db64e708f41760b861

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page