Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 102 lines (95 sloc) 6.53 KB
function [p]=findwidth(r)
% --- Window Size Interpolation Function ---
% This function determines the width of the gaussian to use for the
% windowing function based on the ratio (r) of window size to windown
% resolution. This code has been modified so that when ratio is greater
% then 1 (windown resolution is larger window size, this is a no-no but
% does sometimes happen when people edit their job files) the results will
% effectively turn the windowing off (i.e. no gaussian filter).
% This file is part of prana, an open-source GUI-driven program for
% calculating velocity fields using PIV or PTV.
% Copyright (C) 2012 Virginia Polytechnic Institute and State
% University
%
% prana is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
% Written by Adric Eckstein
% Modified by Sam Raben & John Charonko
R = [0.0000 0.0051 0.0052 0.0053 0.0055 0.0056 0.0057 0.0059 0.0060 ...
0.0063 0.0064 0.0066 0.0067 0.0069 0.0070 0.0072 0.0074 0.0076 ...
0.0079 0.0081 0.0083 0.0085 0.0087 0.0089 0.0091 0.0093 0.0095 ...
0.0100 0.0102 0.0104 0.0107 0.0109 0.0112 0.0114 0.0117 0.0120 ...
0.0125 0.0128 0.0131 0.0134 0.0137 0.0141 0.0144 0.0147 0.0151 ...
0.0158 0.0161 0.0165 0.0169 0.0173 0.0177 0.0181 0.0185 0.0190 ...
0.0199 0.0203 0.0208 0.0213 0.0218 0.0223 0.0228 0.0233 0.0239 ...
0.0250 0.0256 0.0262 0.0268 0.0274 0.0281 0.0287 0.0294 0.0301 ...
0.0315 0.0322 0.0330 0.0337 0.0345 0.0353 0.0361 0.0370 0.0378 ...
0.0396 0.0406 0.0415 0.0425 0.0435 0.0445 0.0455 0.0466 0.0476 ...
0.0499 0.0511 0.0522 0.0535 0.0547 0.0560 0.0573 0.0586 0.0600 ...
0.0628 0.0643 0.0658 0.0673 0.0689 0.0705 0.0721 0.0738 0.0755 ...
0.0791 0.0809 0.0828 0.0847 0.0867 0.0887 0.0908 0.0929 0.0951 ...
0.0996 0.1019 0.1042 0.1067 0.1092 0.1117 0.1143 0.1170 0.1197 ...
0.1253 0.1283 0.1312 0.1343 0.1374 0.1406 0.1439 0.1473 0.1507 ...
0.1578 0.1615 0.1652 0.1691 0.1730 0.1770 0.1812 0.1854 0.1897 ...
0.1986 0.2033 0.2080 0.2128 0.2178 0.2229 0.2281 0.2334 0.2388 ...
0.2501 0.2559 0.2619 0.2680 0.2742 0.2806 0.2871 0.2938 0.3006 ...
0.3148 0.3221 0.3296 0.3373 0.3451 0.3531 0.3613 0.3696 0.3781 ...
0.3957 0.4048 0.4140 0.4233 0.4329 0.4425 0.4524 0.4623 0.4724 ...
0.4930 0.5034 0.5139 0.5244 0.5351 0.5457 0.5564 0.5672 0.5779 ...
0.5992 0.6099 0.6204 0.6309 0.6414 0.6517 0.6619 0.6720 0.6819 ...
0.7014 0.7109 0.7203 0.7295 0.7385 0.7473 0.7559 0.7643 0.7726 ...
0.7884 0.7960 0.8035 0.8107 0.8177 0.8245 0.8311 0.8376 0.8438 ...
0.8556 0.8613 0.8667 0.8720 0.8771 0.8820 0.8867 0.8913 0.8957 ...
0.9041 0.9080 0.9118 0.9155 0.9190 0.9224 0.9256 0.9288 0.9318 ...
0.9374 0.9401 0.9426 0.9451 0.9474 0.9497 0.9519 0.9539 0.9559 ...
0.9597 0.9614 0.9631 0.9647 0.9662 0.9677 0.9691 0.9705 0.9718 ...
0.9742 0.9753 0.9764 0.9775 0.9785 0.9794 0.9803 0.9812 0.9820 ...
0.9836 0.9843 0.9850 0.9857 0.9863 0.9869 0.9875 0.9881 0.9886 ...
0.9896 0.9900 0.9905 0.9909 0.9913 0.9917 0.9921 0.9924 0.9928 ...
0.9934 0.9937 0.9940 0.9943 0.9945 0.9948 0.9950 1.0000 ...
inf]';
P = [500.0000 245.4709 239.8833 234.4229 229.0868 223.8721 218.7762 213.7962 208.9296 ...
199.5262 194.9845 190.5461 186.2087 181.9701 177.8279 173.7801 169.8244 165.9587 ...
158.4893 154.8817 151.3561 147.9108 144.5440 141.2538 138.0384 134.8963 131.8257 ...
125.8925 123.0269 120.2264 117.4898 114.8154 112.2018 109.6478 107.1519 104.7129 ...
100.0000 97.7237 95.4993 93.3254 91.2011 89.1251 87.0964 85.1138 83.1764 ...
79.4328 77.6247 75.8578 74.1310 72.4436 70.7946 69.1831 67.6083 66.0693 ...
63.0957 61.6595 60.2560 58.8844 57.5440 56.2341 54.9541 53.7032 52.4807 ...
50.1187 48.9779 47.8630 46.7735 45.7088 44.6684 43.6516 42.6580 41.6869 ...
39.8107 38.9045 38.0189 37.1535 36.3078 35.4813 34.6737 33.8844 33.1131 ...
31.6228 30.9030 30.1995 29.5121 28.8403 28.1838 27.5423 26.9153 26.3027 ...
25.1189 24.5471 23.9883 23.4423 22.9087 22.3872 21.8776 21.3796 20.8930 ...
19.9526 19.4984 19.0546 18.6209 18.1970 17.7828 17.3780 16.9824 16.5959 ...
15.8489 15.4882 15.1356 14.7911 14.4544 14.1254 13.8038 13.4896 13.1826 ...
12.5893 12.3027 12.0226 11.7490 11.4815 11.2202 10.9648 10.7152 10.4713 ...
10.0000 9.7724 9.5499 9.3325 9.1201 8.9125 8.7096 8.5114 8.3176 ...
7.9433 7.7625 7.5858 7.4131 7.2444 7.0795 6.9183 6.7608 6.6069 ...
6.3096 6.1660 6.0256 5.8884 5.7544 5.6234 5.4954 5.3703 5.2481 ...
5.0119 4.8978 4.7863 4.6774 4.5709 4.4668 4.3652 4.2658 4.1687 ...
3.9811 3.8905 3.8019 3.7154 3.6308 3.5481 3.4674 3.3884 3.3113 ...
3.1623 3.0903 3.0200 2.9512 2.8840 2.8184 2.7542 2.6915 2.6303 ...
2.5119 2.4547 2.3988 2.3442 2.2909 2.2387 2.1878 2.1380 2.0893 ...
1.9953 1.9498 1.9055 1.8621 1.8197 1.7783 1.7378 1.6982 1.6596 ...
1.5849 1.5488 1.5136 1.4791 1.4454 1.4125 1.3804 1.3490 1.3183 ...
1.2589 1.2303 1.2023 1.1749 1.1482 1.1220 1.0965 1.0715 1.0471 ...
1.0000 0.9772 0.9550 0.9333 0.9120 0.8913 0.8710 0.8511 0.8318 ...
0.7943 0.7762 0.7586 0.7413 0.7244 0.7079 0.6918 0.6761 0.6607 ...
0.6310 0.6166 0.6026 0.5888 0.5754 0.5623 0.5495 0.5370 0.5248 ...
0.5012 0.4898 0.4786 0.4677 0.4571 0.4467 0.4365 0.4266 0.4169 ...
0.3981 0.3890 0.3802 0.3715 0.3631 0.3548 0.3467 0.3388 0.3311 ...
0.3162 0.3090 0.3020 0.2951 0.2884 0.2818 0.2754 0.2692 0.2630 ...
0.2512 0.2455 0.2399 0.2344 0.2291 0.2239 0.2188 0.2138 0.2089 ...
0.1995 0.1950 0.1905 0.1862 0.1820 0.1778 0.1738 0.0000 ...
0.0000]';
p=interp1q(R,P,r);
end