Velocity estimation

velocity_estimation is a Python library implementing the three-point velocity estimation technique described here. This technique is tailored for coarse-grained imaging data, and has been applied to avalanche photodiode gass-puff imaging and synthetic data.

Other relevant repositories:

  • cmod functions: Gathering data from cmod tree, in xarray format.

  • blobmodel: For generating 2D synthetic data.

  • xarray: Manipulation of labelled multi-dimensional arrays.

Method description

The mathematical background for the method is explained in detail in the paper. The basic idea is that in order to estimate velocities in two-dimensions, a minimum of three measurement points (or pixels) is needed.

_images/3tde.png

This sketch describes the setup of three measuring points \(P_0\), \(P_x\) and \(P_y\) used to estimate the velocity components. \(R_x(\Delta_t)\) and \(R_y(\Delta_t)\) denote the cross-correlation function between points \(P_0\) and \(P_x\), and between \(P_0\) and \(P_y\), respectively. Maximization of these cross-correlation function yields time lags \(\tau_x\) and \(\tau_y\), which are used to estimate the velocity components according to

\[\begin{split}\widehat{v} &= \frac{\Delta x \widehat{\tau_x}}{\widehat{\tau_x}^2 + \widehat{\tau_y}^2 \Delta x^2/\Delta y^2 } \\ \widehat{w} &= \frac{\Delta y \widehat{\tau_y}}{\widehat{\tau_y}^2 + \widehat{\tau_x}^2 \Delta y^2/\Delta x^2}\end{split}\]

In standard imaging data, where more than three pixels are available, there are several combinations of three pixels that can be made starting from a reference pixel \(P_0\): one can go right and down, as shown in the image, but also right and up, or left and down, etc. The code is configured to take all possible combinations of pixels (typically four, but only two on the edges, and one in the corners), then it computes the velocities for each of them assuming that the data from each pixel fulfills some data-quality requirements, and lastly the estimated velocity for that reference pixel is estimated as the average over all estimated velocities. With this in mind, we can roughly divide the algorithm in the following steps:

  1. For each pixel \(P\) in the dataset:

  2. Find all horizontal and vertical neighbours of \(P\) satisfying some user-defined Neighbour Selection.

  3. For each combination of [\(P\) + one horizontal neighbour + one vertical neighbour]:
    1. Estimate the time delays, \(\widehat{\tau}_x\) and \(\widehat{\tau}_y\), between the signal measured at \(P\) and each auxiliary points with some user-defined EstimationOptions.

    2. It the time delay estimation succeeds, estimate the velocity components following a user defined velocity estimation option.

  4. Average over all successful velocity estimations and assign the resulting velocity to \(P\).

This and the relevant options are summarize in the next figure:

_images/options.png

Each set of options is described in each section:

1. Neighbour Options. 1. CC Options. 1. CA Options. 1. CCF Options.

Contents