{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from openpiv.pyprocess import extended_search_area_piv as piv\n", "\n", "import numpy as np\n", "from test_process import create_pair, shift_u, shift_v, threshold, dist\n", "\n", "frame_a, frame_b = create_pair(image_size=128)\n", "\n", "def test_validation_peak2mean():\n", " \"\"\"test of the simplest PIV run\n", " default window_size = 32\n", " \"\"\"\n", " u, v, s2n = piv(frame_a, frame_b, \n", " window_size=32, \n", " sig2noise_method=\"peak2mean\")\n", " print(s2n)\n", " assert np.min(s2n) > 100\n", "\n", "def test_validation_peak2peak():\n", " \"\"\"test of the simplest PIV run\n", " default window_size = 32\n", " \"\"\"\n", " u, v, s2n = piv(frame_a, frame_b, \n", " window_size=32, \n", " sig2noise_method=\"peak2peak\")\n", " print(s2n)\n", " assert np.min(s2n) > 2." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[31651.50689355 7276.43203813 1070.1945963 286.64718398\n", " 181.2253235 271.44815387 499.77221408 505.2763263\n", " 527.12411827 530.67110432 1447.30059122 389.65655111\n", " 9658.23118895 21345.16202089 10011.43301824 3443.85733039]\n", "[5.79892078 6.71540125 5.82674561 6.95471397 5.37812978 6.59115116\n", " 7.81064533 7.41666389 6.01386887 7.99544287 5.0413923 6.38373715\n", " 6.02108702 7.60786248 5.52798591 6.47109895]\n" ] } ], "source": [ "# %%timeit\n", "test_validation_peak2mean()\n", "test_validation_peak2peak()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:windef] *", "language": "python", "name": "conda-env-windef-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }