# %load test_tools.py
from openpiv.tools import imread, save, display_vector_field
from openpiv.pyprocess import extended_search_area_piv, get_coordinates
import pathlib
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.testing import compare
# np.seterr(all='raise')
# test settings.pattern_a, b
from openpiv.windef import PIVSettings
from openpiv.tools import Multiprocesser
settings = PIVSettings()
settings.filepath_images = pathlib.Path('../data/test2/')
settings.frame_pattern_a = '2image_00.tif'
settings.frame_pattern_b = '2image_01.tif'
print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)
multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)
multi.n_files
../data/test2 2image_00.tif 2image_01.tif
1
settings.frame_pattern_a = '2image_*.tif'
settings.frame_pattern_b = '(1+2),(3+4)'
print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)
multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)
for (a,b) in zip(multi.files_a, multi.files_b):
print(f"Pair: {a}-{b}")
../data/test2 2image_*.tif (1+2),(3+4) Pair: ../data/test2/2image_00.tif-../data/test2/2image_01.tif Pair: ../data/test2/2image_10.tif-../data/test2/2image_11.tif Pair: ../data/test2/2image_20.tif-../data/test2/2image_21.tif Pair: ../data/test2/2image_30.tif-../data/test2/2image_31.tif Pair: ../data/test2/2image_40.tif-../data/test2/2image_41.tif Pair: ../data/test2/2image_50.tif-../data/test2/2image_51.tif
settings.frame_pattern_a = '2image_*.tif'
settings.frame_pattern_b = '(1+2),(2+3)'
print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)
multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)
for (a,b) in zip(multi.files_a, multi.files_b):
print(f"Pair: {a}-{b}")
../data/test2 2image_*.tif (1+2),(2+3) Pair: ../data/test2/2image_00.tif-../data/test2/2image_01.tif Pair: ../data/test2/2image_01.tif-../data/test2/2image_10.tif Pair: ../data/test2/2image_10.tif-../data/test2/2image_11.tif Pair: ../data/test2/2image_11.tif-../data/test2/2image_20.tif Pair: ../data/test2/2image_20.tif-../data/test2/2image_21.tif Pair: ../data/test2/2image_21.tif-../data/test2/2image_30.tif Pair: ../data/test2/2image_30.tif-../data/test2/2image_31.tif Pair: ../data/test2/2image_31.tif-../data/test2/2image_40.tif Pair: ../data/test2/2image_40.tif-../data/test2/2image_41.tif Pair: ../data/test2/2image_41.tif-../data/test2/2image_50.tif Pair: ../data/test2/2image_50.tif-../data/test2/2image_51.tif
settings.frame_pattern_a = '2image_*.tif'
settings.frame_pattern_b = '(1+3),(2+4)'
print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)
multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)
for (a,b) in zip(multi.files_a, multi.files_b):
print(f"Pair: {a}-{b}")
../data/test2 2image_*.tif (1+3),(2+4) Pair: ../data/test2/2image_00.tif-../data/test2/2image_10.tif Pair: ../data/test2/2image_01.tif-../data/test2/2image_11.tif Pair: ../data/test2/2image_10.tif-../data/test2/2image_20.tif Pair: ../data/test2/2image_11.tif-../data/test2/2image_21.tif Pair: ../data/test2/2image_20.tif-../data/test2/2image_30.tif Pair: ../data/test2/2image_21.tif-../data/test2/2image_31.tif Pair: ../data/test2/2image_30.tif-../data/test2/2image_40.tif Pair: ../data/test2/2image_31.tif-../data/test2/2image_41.tif Pair: ../data/test2/2image_40.tif-../data/test2/2image_50.tif Pair: ../data/test2/2image_41.tif-../data/test2/2image_51.tif
settings = PIVSettings()
settings.filepath_images = pathlib.Path('../data/test5')
settings.frame_pattern_a = 'Pattern*_A.tif'
settings.frame_pattern_b = 'Pattern*_B.tif'
print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)
multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)
print(f'Number of files is {multi.n_files}')
for (a,b) in zip(multi.files_a, multi.files_b):
print(f"Pair: {a}-{b}")
../data/test5 Pattern*_A.tif Pattern*_B.tif Number of files is 10 Pair: ../data/test5/Pattern_1_A.tif-../data/test5/Pattern_1_B.tif Pair: ../data/test5/Pattern_2_A.tif-../data/test5/Pattern_2_B.tif Pair: ../data/test5/Pattern_3_A.tif-../data/test5/Pattern_3_B.tif Pair: ../data/test5/Pattern_4_A.tif-../data/test5/Pattern_4_B.tif Pair: ../data/test5/Pattern_5_A.tif-../data/test5/Pattern_5_B.tif Pair: ../data/test5/Pattern_6_A.tif-../data/test5/Pattern_6_B.tif Pair: ../data/test5/Pattern_7_A.tif-../data/test5/Pattern_7_B.tif Pair: ../data/test5/Pattern_8_A.tif-../data/test5/Pattern_8_B.tif Pair: ../data/test5/Pattern_9_A.tif-../data/test5/Pattern_9_B.tif Pair: ../data/test5/Pattern_10_A.tif-../data/test5/Pattern_10_B.tif
settings = PIVSettings()
settings.filepath_images = pathlib.Path('../data/test6')
settings.frame_pattern_a = 'Pattern_*_A.tif'
settings.frame_pattern_b = 'Pattern_*_B.tif'
print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)
multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)
print(f'Number of files is {multi.n_files}')
for (a,b) in zip(multi.files_a, multi.files_b):
print(f"Pair: {a}-{b}")
../data/test6 Pattern_*_A.tif Pattern_*_B.tif Number of files is 5 Pair: ../data/test6/Pattern_0001_A.tif-../data/test6/Pattern_1001_B.tif Pair: ../data/test6/Pattern_0002_A.tif-../data/test6/Pattern_1002_B.tif Pair: ../data/test6/Pattern_0003_A.tif-../data/test6/Pattern_1003_B.tif Pair: ../data/test6/Pattern_0004_A.tif-../data/test6/Pattern_1004_B.tif Pair: ../data/test6/Pattern_0005_A.tif-../data/test6/Pattern_1005_B.tif