ddm#
Differential dynamic microscopy interface with backends.
The image structure function is computed from the images \(I(\vec{x}, t)\) as
where \(\tilde{I}(\vec{q},t)\) is the 2D Fourier transform of the image at time \(t\).
The image power spectrum is computed as
The background-corrected image power spectrum is computed as
where \(\tilde{I}_0(\vec{q}) = \langle\tilde{I}(\vec{q}, t)\rangle_t\). This is just the variance over time of the 2D Fourier transformed image sequence.
- fastddm._ddm.ddm(img_seq: ndarray, lags: Iterable[int], *, core: str = 'py', mode: str = 'fft', window: ndarray | None = None, **kwargs) ImageStructureFunction #
Perform Differential Dynamic Microscopy analysis on given image sequence. Returns the full image structure function.
- Parameters:
img_seq (numpy.ndarray) – Image sequence of shape
(t, y, x)
wheret
is time.lags (Iterable[int]) – The delays to be inspected by the analysis.
core (str, optional) – The backend core, choose between “py”, “cpp”, and “cuda”. Default is “py”.
mode (str, optional) – The mode of calculating the structure function, choose between “diff” and “fft”. Default is “fft”.
window (numpy.ndarray, optional) – A 2D array containing the window function to be applied to the images. Default is None.
- Returns:
The image structure function.
- Return type:
- Raises:
RuntimeError – If a value for
core
other than “py”, “cpp”, and “cuda” are given.RuntimeError – If a value for
mode
other than “diff” and “fft” are given.RuntimeError – If
window
andimg_seq
shapes are not compatible.RuntimeError – If negative
lags
are given.