moving_mask_piv#
This script performs PIV on the flow field in a moving droplet. In short, the job is done in 3 steps:
determine droplet trajectory
generate cropped images
perform normal PIV on cropped images
For more information, see my note here.
Syntax
python moving_mask_piv.py image_folder save_folder winsize overlap dt mask x0 y0 maskw maskh
image_folder: folder containing tif images
save_folder: folder to save .csv PIV data
winsize, overlap, dt: PIV settings
mask: dir of mask image (tif)
x0, y0, maskw, maskh: initial mask information, for computing the offset of the trajectory. Can be read from positions.csv file.
Test
python moving_mask_piv.py test_images\moving_mask_piv
aw test_imagesmoving_mask_pivpiv_result 20 10 0.02 test_imagesmoving_mask_pivmask.tif 178 161 174 174
Edit
Mar 03, 2022 – Initial commit.
Jan 05, 2023 – Adapt myimagelib import style.
Feb 08, 2023 – Rewrite in function wrapper form, to make autodoc work properly. (autodoc import the script and execute it, so anything outside
if __name__=="__main__"
will be executed, causing problems)