Skip to content

Commit bd32530

Browse files
committed
added test_global_val to test_validation.py
1 parent c65c186 commit bd32530

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

openpiv/test/test_validation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,16 @@ def test_local_median_validation(u_threshold=3, N=3, size=1):
139139
assert mask2[N,N]
140140
assert u2.mask[N+1,N+1]
141141

142+
143+
def test_global_val(N=2,U=(-10,10)):
144+
u = np.random.rand(2*N+1, 2*N+1)
145+
u[N, N] = U[0]-.1
146+
u[0,0] = U[1]+.1
147+
print('\n\n\n')
148+
print(u)
149+
150+
u1, _, mask = validation.global_val(u,u,U,U)
151+
assert np.isnan(u1[N,N])
152+
assert np.isnan(u1[0,0])
153+
assert mask[N,N]
154+
assert mask[0,0]

0 commit comments

Comments
 (0)