Git Product home page Git Product logo

tpxpy's Introduction

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:

tpxpy's People

Contributors

k-m-jordan avatar jceplab avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.