Skip to content

Commit

Permalink
fixed the bug in pattern_b
Browse files Browse the repository at this point in the history
thanks to Chen M. - the bug is fixed, added two more test folders and it seems working.
  • Loading branch information
alexlib committed Oct 1, 2023
1 parent 1f66130 commit 4143b14
Show file tree
Hide file tree
Showing 32 changed files with 83 additions and 1 deletion.
Binary file added openpiv/data/test5/Pattern_10_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_10_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_1_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_1_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_2_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_2_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_3_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_3_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_4_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_4_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_5_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_5_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_6_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_6_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_7_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_7_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_8_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_8_B.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_9_A.tif
Binary file not shown.
Binary file added openpiv/data/test5/Pattern_9_B.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_0001_A.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_0002_A.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_0003_A.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_0004_A.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_0005_A.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_1001_B.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_1002_B.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_1003_B.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_1004_B.tif
Binary file not shown.
Binary file added openpiv/data/test6/Pattern_1005_B.tif
Binary file not shown.
82 changes: 82 additions & 0 deletions openpiv/test/test_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,88 @@
"for (a,b) in zip(multi.files_a, multi.files_b):\n",
" print(f\"Pair: {a}-{b}\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"../data/test5 Pattern*_A.tif Pattern*_B.tif\n",
"Number of files is 10\n",
"Pair: ../data/test5/Pattern_1_A.tif-../data/test5/Pattern_1_B.tif\n",
"Pair: ../data/test5/Pattern_2_A.tif-../data/test5/Pattern_2_B.tif\n",
"Pair: ../data/test5/Pattern_3_A.tif-../data/test5/Pattern_3_B.tif\n",
"Pair: ../data/test5/Pattern_4_A.tif-../data/test5/Pattern_4_B.tif\n",
"Pair: ../data/test5/Pattern_5_A.tif-../data/test5/Pattern_5_B.tif\n",
"Pair: ../data/test5/Pattern_6_A.tif-../data/test5/Pattern_6_B.tif\n",
"Pair: ../data/test5/Pattern_7_A.tif-../data/test5/Pattern_7_B.tif\n",
"Pair: ../data/test5/Pattern_8_A.tif-../data/test5/Pattern_8_B.tif\n",
"Pair: ../data/test5/Pattern_9_A.tif-../data/test5/Pattern_9_B.tif\n",
"Pair: ../data/test5/Pattern_10_A.tif-../data/test5/Pattern_10_B.tif\n"
]
}
],
"source": [
"settings = PIVSettings()\n",
"settings.filepath_images = pathlib.Path('../data/test5')\n",
"settings.frame_pattern_a = 'Pattern*_A.tif'\n",
"settings.frame_pattern_b = 'Pattern*_B.tif'\n",
"print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)\n",
"\n",
"multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)\n",
"print(f'Number of files is {multi.n_files}')\n",
"\n",
"for (a,b) in zip(multi.files_a, multi.files_b):\n",
" print(f\"Pair: {a}-{b}\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"../data/test6 Pattern_*_A.tif Pattern_*_B.tif\n",
"Number of files is 5\n",
"Pair: ../data/test6/Pattern_0001_A.tif-../data/test6/Pattern_1001_B.tif\n",
"Pair: ../data/test6/Pattern_0002_A.tif-../data/test6/Pattern_1002_B.tif\n",
"Pair: ../data/test6/Pattern_0003_A.tif-../data/test6/Pattern_1003_B.tif\n",
"Pair: ../data/test6/Pattern_0004_A.tif-../data/test6/Pattern_1004_B.tif\n",
"Pair: ../data/test6/Pattern_0005_A.tif-../data/test6/Pattern_1005_B.tif\n"
]
}
],
"source": [
"settings = PIVSettings()\n",
"settings.filepath_images = pathlib.Path('../data/test6')\n",
"settings.frame_pattern_a = 'Pattern_*_A.tif'\n",
"settings.frame_pattern_b = 'Pattern_*_B.tif'\n",
"print(settings.filepath_images,settings.frame_pattern_a, settings.frame_pattern_b)\n",
"\n",
"multi = Multiprocesser(settings.filepath_images, settings.frame_pattern_a, settings.frame_pattern_b)\n",
"print(f'Number of files is {multi.n_files}')\n",
"\n",
"for (a,b) in zip(multi.files_a, multi.files_b):\n",
" print(f\"Pair: {a}-{b}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion openpiv/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def __init__(self,
self.files_b = self.files_a[1::2]
self.files_a = self.files_a[0::2]
else:
self.files_b = sorted(data_dir.glob(pattern_b))
self.files_b = natural_sort(list(data_dir.glob(pattern_b)))

# number of images
self.n_files = len(self.files_a)
Expand Down

0 comments on commit 4143b14

Please sign in to comment.