Skip to content

Commit a1c17e4

Browse files
authored
Merge pull request #144 from ericyang125/master
Round the prediction vectors to reduce error in multipass.
2 parents 0e78e5d + c5715e7 commit a1c17e4

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

openpiv/process.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,8 @@ def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,
765765
for J in range(Ncol[K]):
766766

767767
#compute xb, yb:
768-
F[K,I,J,2]=np.floor(F[K,I,J,0]+F[K,I,J,6])#xb=xa+dpx
769-
F[K,I,J,3]=np.floor(F[K,I,J,1]+F[K,I,J,7])#yb=yb+dpy
768+
F[K,I,J,2]=F[K,I,J,0]+F[K,I,J,6]#xb=xa+dpx
769+
F[K,I,J,3]=F[K,I,J,1]+F[K,I,J,7]#yb=yb+dpy
770770
#look for corrupted window (ie. going outside of the picture) and relocate them with 0 displacement:
771771
if F[K,I,J,2] + W[K]/2 > pic_size[0]-1 or F[K,I,J,2] - W[K]/2 < 0: #if corrupted on x-axis do:
772772
F[K,I,J,2]=F[K,I,J,0]#xb=x
@@ -920,11 +920,11 @@ def WiDIM( np.ndarray[DTYPEi_t, ndim=2] frame_a,
920920
# pbar.update(100*I/Nrow[K+1])
921921
for J in range(Ncol[K+1]):
922922
if Nrow[K+1]==Nrow[K] and Ncol[K+1]==Ncol[K]:
923-
F[K+1,I,J,6] = F[K,I,J,4]#dpx_k+1 = dx_k
924-
F[K+1,I,J,7] = F[K,I,J,5]#dpy_k+1 = dy_k
923+
F[K+1,I,J,6] = np.floor(F[K,I,J,4])#dpx_k+1 = dx_k
924+
F[K+1,I,J,7] = np.floor(F[K,I,J,5])#dpy_k+1 = dy_k
925925
else:#interpolate if dimensions do not agree
926-
F[K+1,I,J,6] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 4)
927-
F[K+1,I,J,7] = interpolate_surroundings(F,Nrow,Ncol,K,I,J, 5)
926+
F[K+1,I,J,6] = np.floor(interpolate_surroundings(F,Nrow,Ncol,K,I,J, 4))
927+
F[K+1,I,J,7] = np.floor(interpolate_surroundings(F,Nrow,Ncol,K,I,J, 5))
928928
# pbar.finish()
929929
print("..[DONE] -----> going to iteration ",K+1)
930930
print(" ")

0 commit comments

Comments
 (0)