myimagelib.corrLib.vacf_piv

myimagelib.corrLib.vacf_piv(vstack, dt, mode='direct')

Compute averaged vacf from PIV data. This is a wrapper of function autocorr_t(), adding the averaging over all the velocity spots.

Parameters
  • vstack – a 2-D np array of velocity data. axis-0 is time and axes-1,2 are spots in velocity field. Usually, this stack can be constracted by np.stack(u_list) and then reshape to flatten axes 1 and 2.

  • dt – time between two data points

  • mode – the averaging method, can be “direct” or “weighted”. “weighted” will use mean velocity as the averaging weight, whereas “direct” uses 1.

Returns

DataFrame of (corr, t)

Edit

10262022

add condition x.sum() != 0, avoids nan in all-zero columns.