Skip to content

silx-kit/dynamix

Repository files navigation

dynamix

About

dynamix is a Python module for X-ray photon correlation spectroscopy (XPCS). It primarily aims at offering fast correlation function computation with OpenCL/CUDA implementations.

Work in progress: please keep in mind that this is work in progress. The API might change at this early stage of the project.

dynamix provides classes named correlators to compute the XPCS correlation function g2 defined by g2

where < . >_p denotes averaging pixels belonging to the current bin (scattering vector), and < . >_t denotes time averaging.

All correlators compute the function g_2, although through different means.

Installation

Python dependencies

dynamix depends on the following python packages:

  • numpy
  • pyopencl 2021.1.6
  • silx

Optionally:

  • pyfftw
  • scikit-cuda

These modules should be automatically installed when installing dynamix.

System dependencies

dynamix needs:

  • An implementation of OpenCL (>= 1.2)
  • Optionally, CUDA and CUFFT
  • Optionally, FFTW library and header files

Releases versions

To install the current release from pypi:

pip install [--user] dynamix

Development versions

To install the current development version:

pip install [--user] git+https://github.com/silx-kit/dynamix

Usage

First load a dataset. dynamix provides some datasets acquired at ESRF ID10.

from dynamix.test.utils import XPCSDataset
dataset = XPCSDataset("eiger_514_10k")
data = dataset.data
shape = dataset.dataset_desc.frame_shape
nframes = dataset.dataset_desc.nframes
print(dataset.dataset_desc.description)

Then use a correlator:

from dynamix.correlator.dense import MatMulCorrelator
correlator = MatMulCorrelator(shape, nframes, qmask=dataset.qmask)
result = correlator.correlate(data)

This is the basic (and slowest) correlator. Please refer to the documentation to use other backends.

Question ? Bug ?

Please open an issue on the project page to report bugs or ask questions.