Closed nepomnyi closed 1 year ago
Thanks for the suggestion @nepomnyi please fork the repo, change the notebook, and suggest the change by the pull request. Please check before that the notebook performs without errors and the other notebooks are not affected by your change.
@nepomnyi please note that we just merged the recent set of changes to match openpiv v 0.25.0
Thank you @alexlib .
I was about to start working on that, when I noticed that you removed theensemble-correlation.ipynb
notebook from the examples.
I think I will close the current issue and will focus on providing an example with my multi-processed ensemble correlations as we discussed in our Zoom call.
Thank you @alexlib . I was about to start working on that, when I noticed that you removed the
ensemble-correlation.ipynb
notebook from the examples. I think I will close the current issue and will focus on providing an example with my multi-processed ensemble correlations as we discussed in our Zoom call.
that was my mistake. i recover the file and upload it back to the repo
My issue.
I'm working with ensemble_correlation.ipynb example.
In block [12], we find
x
andy
displacements inpixels
using the functioncorrelation_to_displacement(mean_correlation, nrows, ncols)
. But those displacements denoted asu
andv
.Because they denoted as
u
andv
, I decided that we got velocities inpix/mm
there. That led me to wrong conclusions.My suggestion.
Use different notation for displacements.
Delete the current code from block [12].
Introduces the following code to block [12]:
To obtain velocities from the displacements, divide the displacements by the time between the images
dt = 0.001 # s - time between the images in seconds u = xDisp / dt # pix/s - horizontal component of velocity in pixels per second y = yDisp / dt # pix/s - vertical component of velocity in pixels per second
The following is written for displacements. To obtain velocities, simply, delete by dt.
XDisp = [] YDisp = []
for i in range(corrs.shape[0]): tmpxDisp,tmpyDisp = correlation_to_displacement(corrs[i,:,:,:], nrows, ncols) XDisp.append(tmpxDisp) YDisp.append(tmpyDisp) fig, ax = subplots(figsize=(6,6)) ax.quiver(x,y,tmpxDisp,tmpyDisp,scale=200) ax.invert_yaxis() plot(tmpxDisp.mean(axis=1)*80+400,y[:,0])
XDisp = np.array(XDisp) YDisp = np.array(YDisp)
meanXDisp = np.mean(XDisp, axis=0) meanYDisp = np.mean(YDisp, axis=0)