Skip to content

Fast analysis of intensified Timepix3 images using CUDA

License

Notifications You must be signed in to change notification settings

k-m-jordan/tpxpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tpxpy - fast Timepix3 analysis using CUDA

This package can be used to process raw *.tpx3 files output from a Timepix3 camera. It is meant for use in few-photon imaging with an intensified Timepix camera. These systems output raw files in a binary format, with a single photon detection being stored as a cluster of nearby pixel clicks. This package has functionality for parsing raw files, identifying clusters in an image based on spatiotemporal correlations, and analysis of the resulting data. In particular, it allows for photon positions to be calculated with arbitrary sub-pixel precision (whether this is useful is another question).

This code was written for use in a Timepix-based biphoton spectrometer, and so has analysis functions meant for this purpose, such as spectral calibration. Parsing and clustering functionality may be useful in more general contexts.

Dependencies:

  • cupy-cuda12x (requires a modern NVIDIA GPU)
  • numpy
  • matplotlib
  • scipy
  • tqdm

Simple example

from tpxpy.loader import TpxLoader, TpxImage

from tkinter.filedialog import askopenfilename
import matplotlib.pyplot as plt

fname = askopenfilename()

tpxl = TpxLoader()

# for best results, you should create a ToT calibration file, which is camera-specific. For example,
tpxl.generate_tot_calibration([fname,], 'tot_cal.txt') # can be generated from any .tpx3 image(s)
tpxl.set_tot_calibration('tot_cal.txt')

img = tpxl.load(fname)

hist2d = img.to_2d_image()
plt.imshow(hist2d)
plt.show()

If you encounter any errors, report them to the maintainer of the repository by email.

Related projects from our lab:

About

Fast analysis of intensified Timepix3 images using CUDA

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages