%23%20%2F%2F%2F%20script%0A%23%20requires-python%20%3D%20%22%3E%3D3.11%22%0A%23%20dependencies%20%3D%20%5B%0A%23%20%20%20%20%20%22marimo%22%2C%0A%23%20%20%20%20%20%22openpiv%3D%3D0.26.3%22%2C%0A%23%20%20%20%20%20%22numpy%22%2C%0A%23%20%20%20%20%20%22matplotlib%22%2C%0A%23%20%20%20%20%20%22scipy%22%2C%0A%23%20%20%20%20%20%22scikit-image%22%2C%0A%23%20%5D%0A%23%20%2F%2F%2F%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%2003%20%E2%80%94%20Multi-pass%20%26%20window%20deformation%0A%0A%20%20%20%20A%20single%20pass%20with%20fixed%20windows%20struggles%20with%20strong%20gradients%20and%20large%20displacements.%20**Multi-pass**%20(multi-grid)%20PIV%20refines%20the%20estimate%3A%0A%0A%20%20%20%201.%20**Pass%201**%3A%20large%20windows%20to%20capture%20large%20displacements%20robustly.%0A%20%20%20%202.%20**Pass%202%2B**%3A%20smaller%20windows%2C%20using%20previous%20pass%20to%20offset%2Fdeform%20windows%2C%20improving%20spatial%20resolution.%0A%20%20%20%203.%20**Window%20deformation**%20warps%20images%2Fwindows%20to%20account%20for%20velocity%20gradients%20inside%20the%20window.%0A%0A%20%20%20%20%23%23%20Why%20it%20helps%0A%20%20%20%20-%20Better%20accuracy%20in%20shear%2C%20vortices%2C%20and%20boundary%20layers.%0A%20%20%20%20-%20Reduces%20in-plane%20loss%20of%20correlation.%0A%20%20%20%20-%20Allows%20smaller%20final%20windows%20than%20single-pass%20would%20permit.%0A%0A%20%20%20%20%23%23%20Learn%20from%20these%20examples%0A%20%20%20%20-%20**%5Btutorial_multipass%5D(marimo_notebooks%2Ftutorial_multipass.html)**%20(%5Binteractive%20.py%5D(marimo_notebooks%2Ftutorial_multipass.py)%2C%20%5Bmolab%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2Fopenpiv%2Fopenpiv-python-examples%2Fblob%2Fmain%2Fmarimo_notebooks%2Ftutorial_multipass.py))%20%E2%80%94%20step-by-step%20multi-pass%20processing.%0A%20%20%20%20-%20**%5Btest20_windef%5D(marimo_notebooks%2Ftest20_windef.html)**%20(%5Binteractive%20.py%5D(marimo_notebooks%2Ftest20_windef.py)%2C%20%5Bmolab%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2Fopenpiv%2Fopenpiv-python-examples%2Fblob%2Fmain%2Fmarimo_notebooks%2Ftest20_windef.py))%20%E2%80%94%20window%20deformation%20algorithm%20in%20action.%20*Use%20when%3A*%20you%20need%20higher%20accuracy%20in%20gradients.%0A%20%20%20%20-%20**%5Bwindow_deformation_comparison%5D(marimo_notebooks%2Fwindow_deformation_comparison.html)**%20(%5Binteractive%20.py%5D(marimo_notebooks%2Fwindow_deformation_comparison.py)%2C%20%5Bmolab%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2Fopenpiv%2Fopenpiv-python-examples%2Fblob%2Fmain%2Fmarimo_notebooks%2Fwindow_deformation_comparison.py))%20%E2%80%94%20compare%20deformation%20strategies.%0A%20%20%20%20-%20**%5Bcase_B_windef_small_window%5D(marimo_notebooks%2Fcase_B_windef_small_window.html)**%20(%5Binteractive%20.py%5D(marimo_notebooks%2Fcase_B_windef_small_window.py)%2C%20%5Bmolab%5D(https%3A%2F%2Fmolab.marimo.io%2Fgithub%2Fopenpiv%2Fopenpiv-python-examples%2Fblob%2Fmain%2Fmarimo_notebooks%2Fcase_B_windef_small_window.py))%20%E2%80%94%20PIV%20challenge%20case%20with%20multi-grid%20deformation.%0A%20%20%20%20-%20**%5Btest20_multipass%5D(marimo_notebooks%2Ftest20_multipass.html)**%20%2F%20**%5Btest20%20case%5D(marimo_cases%2Ftest20.html)**%20%E2%80%94%20practical%20multi-pass%20on%20test20%20data.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20from%20openpiv%20import%20windef%0A%20%20%20%20s%20%3D%20windef.Settings()%0A%20%20%20%20s.windowsizes%20%3D%20(64%2C%2032%2C%2016)%0A%20%20%20%20s.overlap%20%3D%20(32%2C%2016%2C%208)%0A%20%20%20%20s.num_iterations%20%3D%203%0A%20%20%20%20print('windows%3A'%2C%20s.windowsizes%2C%20'overlap%3A'%2C%20s.overlap%2C%20'passes%3A'%2C%20s.num_iterations)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Tips%0A%20%20%20%20-%20Start%20coarse%20enough%20that%20pass%201%20finds%20the%20main%20displacement%20reliably.%0A%20%20%20%20-%20Keep%20~50%25%20overlap%20as%20a%20good%20default.%0A%20%20%20%20-%20Enable%20validation%20between%20passes%20to%20prevent%20error%20propagation.%0A%20%20%20%20-%20Use%20deformation%20for%20strong%20gradients%3B%20symmetric%20deformation%20is%20often%20robust.%0A%0A%20%20%20%20Next%3A%20%5B04%20%E2%80%94%20Validation%20%26%20filtering%5D(04_validation_and_filtering.html)%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
5fa4f64693fe4f1e4c73ca8901e5f5dd