OpenPIV 0.25.2__tar.gz → 0.25.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. {openpiv-0.25.2 → openpiv-0.25.4}/PKG-INFO +39 -25
  2. {openpiv-0.25.2 → openpiv-0.25.4}/README.md +24 -11
  3. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/PIV_3D_plotting.py +16 -10
  4. openpiv-0.25.4/openpiv/__init__.py +10 -0
  5. openpiv-0.25.4/openpiv/data/test1/test_data.vec +71 -0
  6. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/conf.py +1 -1
  7. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/requirements.txt +0 -1
  8. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/installation_instruction.rst +27 -8
  9. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/filters.py +20 -14
  10. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/lib.py +12 -21
  11. openpiv-0.25.4/openpiv/piv.py +288 -0
  12. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/preprocess.py +150 -138
  13. openpiv-0.25.4/openpiv/preprocess.py,cover +579 -0
  14. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/pyprocess.py +25 -17
  15. openpiv-0.25.4/openpiv/settings.py +149 -0
  16. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/smoothn.py +183 -219
  17. openpiv-0.25.4/openpiv/test/OpenPIV_results_16_test1/field_A0000.png +0 -0
  18. openpiv-0.25.4/openpiv/test/conftest.py +57 -0
  19. openpiv-0.25.4/openpiv/test/test_PIV_3D_plotting.py +236 -0
  20. openpiv-0.25.4/openpiv/test/test_filters.py +190 -0
  21. openpiv-0.25.4/openpiv/test/test_lib.py +196 -0
  22. openpiv-0.25.4/openpiv/test/test_package_metadata.py +7 -0
  23. openpiv-0.25.4/openpiv/test/test_performance.py +161 -0
  24. openpiv-0.25.4/openpiv/test/test_piv.py +440 -0
  25. openpiv-0.25.4/openpiv/test/test_preprocess.py +491 -0
  26. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_process.py +88 -21
  27. openpiv-0.25.4/openpiv/test/test_pyprocess.py +390 -0
  28. openpiv-0.25.4/openpiv/test/test_smoothn.py +611 -0
  29. openpiv-0.25.4/openpiv/test/test_tools.py +233 -0
  30. openpiv-0.25.4/openpiv/test/test_tools_background.py +199 -0
  31. openpiv-0.25.4/openpiv/test/test_tools_basic_utils.py +131 -0
  32. openpiv-0.25.4/openpiv/test/test_tools_image_processing.py +229 -0
  33. openpiv-0.25.4/openpiv/test/test_tools_multiprocessing.py +197 -0
  34. openpiv-0.25.4/openpiv/test/test_tools_vector_field.py +230 -0
  35. openpiv-0.25.4/openpiv/test/test_validation.py +395 -0
  36. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_windef.py +30 -22
  37. openpiv-0.25.4/openpiv/test/test_windef_coverage.py +215 -0
  38. openpiv-0.25.4/openpiv/test/test_windef_detailed.py +808 -0
  39. openpiv-0.25.4/openpiv/test/test_windef_final.py +76 -0
  40. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/tools.py +138 -117
  41. openpiv-0.25.4/openpiv/tutorials/Example for overlap setting change.ipynb +410 -0
  42. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/tutorials/masking_tutorial.py +1 -1
  43. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/tutorials/tutorial1.py +1 -1
  44. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/tutorials/tutorial2.py +1 -1
  45. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/tutorials/windef_tutorial.py +1 -1
  46. openpiv-0.25.4/openpiv/validation.py +532 -0
  47. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/windef.py +1 -144
  48. {openpiv-0.25.2 → openpiv-0.25.4}/pyproject.toml +13 -13
  49. openpiv-0.25.2/openpiv/__init__.py +0 -4
  50. openpiv-0.25.2/openpiv/data/test1/test_data.vec +0 -71
  51. openpiv-0.25.2/openpiv/piv.py +0 -117
  52. openpiv-0.25.2/openpiv/test/test_filters.py +0 -83
  53. openpiv-0.25.2/openpiv/test/test_preprocess.py +0 -46
  54. openpiv-0.25.2/openpiv/test/test_tools.py +0 -78
  55. openpiv-0.25.2/openpiv/test/test_validation.py +0 -155
  56. openpiv-0.25.2/openpiv/validation.py +0 -316
  57. {openpiv-0.25.2 → openpiv-0.25.4}/LICENSE.txt +0 -0
  58. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test1/exp1_001_a.bmp +0 -0
  59. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test1/exp1_001_b.bmp +0 -0
  60. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_00.tif +0 -0
  61. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_01.tif +0 -0
  62. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_10.tif +0 -0
  63. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_11.tif +0 -0
  64. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_20.tif +0 -0
  65. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_21.tif +0 -0
  66. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_30.tif +0 -0
  67. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_31.tif +0 -0
  68. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_40.tif +0 -0
  69. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_41.tif +0 -0
  70. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_50.tif +0 -0
  71. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test2/2image_51.tif +0 -0
  72. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test3/pair_4_frame_0.jpg +0 -0
  73. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test3/pair_4_frame_1.jpg +0 -0
  74. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test4/Camera1-0101.tif +0 -0
  75. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test4/Camera1-0102.tif +0 -0
  76. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_10_A.tif +0 -0
  77. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_10_B.tif +0 -0
  78. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_1_A.tif +0 -0
  79. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_1_B.tif +0 -0
  80. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_2_A.tif +0 -0
  81. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_2_B.tif +0 -0
  82. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_3_A.tif +0 -0
  83. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_3_B.tif +0 -0
  84. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_4_A.tif +0 -0
  85. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_4_B.tif +0 -0
  86. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_5_A.tif +0 -0
  87. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_5_B.tif +0 -0
  88. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_6_A.tif +0 -0
  89. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_6_B.tif +0 -0
  90. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_7_A.tif +0 -0
  91. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_7_B.tif +0 -0
  92. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_8_A.tif +0 -0
  93. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_8_B.tif +0 -0
  94. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_9_A.tif +0 -0
  95. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test5/Pattern_9_B.tif +0 -0
  96. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_0001_A.tif +0 -0
  97. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_0002_A.tif +0 -0
  98. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_0003_A.tif +0 -0
  99. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_0004_A.tif +0 -0
  100. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_0005_A.tif +0 -0
  101. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_1001_B.tif +0 -0
  102. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_1002_B.tif +0 -0
  103. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_1003_B.tif +0 -0
  104. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_1004_B.tif +0 -0
  105. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/data/test6/Pattern_1005_B.tif +0 -0
  106. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/Makefile +0 -0
  107. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/OpenPIV.pdf +0 -0
  108. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/OpenPIV_advanced_processing_parameters.pdf +0 -0
  109. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/images/B005_1.tif +0 -0
  110. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/images/B005_2.tif +0 -0
  111. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/images/image1.png +0 -0
  112. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/images/image2.png +0 -0
  113. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/images/image3.png +0 -0
  114. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/images/image4.png +0 -0
  115. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/index.rst +0 -0
  116. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/make.bat +0 -0
  117. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/api_reference.rst +0 -0
  118. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/developers.rst +0 -0
  119. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/faq.rst +0 -0
  120. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.filters._gaussian_kernel.rst +0 -0
  121. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.filters.gaussian.rst +0 -0
  122. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.filters.replace_outliers.rst +0 -0
  123. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.lib.replace_nans.rst +0 -0
  124. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.lib.sincinterp.rst +0 -0
  125. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.preprocess.dynamic_masking.rst +0 -0
  126. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.process.CorrelationFunction.rst +0 -0
  127. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.process.correlate_windows.rst +0 -0
  128. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.process.extended_search_area_piv.rst +0 -0
  129. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.process.get_coordinates.rst +0 -0
  130. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.process.get_field_shape.rst +0 -0
  131. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.process.normalize_intensity.rst +0 -0
  132. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.correlate_windows.rst +0 -0
  133. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.find_first_peak.rst +0 -0
  134. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.find_second_peak.rst +0 -0
  135. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.find_subpixel_peak_position.rst +0 -0
  136. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.get_coordinates.rst +0 -0
  137. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.get_field_shape.rst +0 -0
  138. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.moving_window_array.rst +0 -0
  139. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.normalize_intensity.rst +0 -0
  140. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.pyprocess.piv.rst +0 -0
  141. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.scaling.uniform.rst +0 -0
  142. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.tools.Multiprocesser.rst +0 -0
  143. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.tools.display.rst +0 -0
  144. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.tools.display_vector_field.rst +0 -0
  145. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.tools.imread.rst +0 -0
  146. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.tools.save.rst +0 -0
  147. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.validation.global_std.rst +0 -0
  148. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.validation.global_val.rst +0 -0
  149. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.validation.local_median_val.rst +0 -0
  150. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/generated/openpiv.validation.sig2noise_val.rst +0 -0
  151. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/gui_doc.rst +0 -0
  152. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/introduction.rst +0 -0
  153. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/masking.ipynb +0 -0
  154. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/modules.rst +0 -0
  155. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/openpiv.rst +0 -0
  156. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/openpiv_pivuq.ipynb +0 -0
  157. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/piv_basics.ipynb +0 -0
  158. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/tutorial1.ipynb +0 -0
  159. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/docs/src/windef.ipynb +0 -0
  160. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/phase_separation.py +0 -0
  161. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/pyprocess3D.py +0 -0
  162. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/scaling.py +0 -0
  163. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/__init__.py +0 -0
  164. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/extended_search_area_vectorized.ipynb +0 -0
  165. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/moon.png +0 -0
  166. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_filters.ipynb +0 -0
  167. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_find_peaks.ipynb +0 -0
  168. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_process.ipynb +0 -0
  169. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_pyprocess3D.py +0 -0
  170. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_scaling.py +0 -0
  171. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_tools.ipynb +0 -0
  172. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_tools.png +0 -0
  173. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_validation.ipynb +0 -0
  174. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_vectorized_extended_search.py +0 -0
  175. {openpiv-0.25.2 → openpiv-0.25.4}/openpiv/test/test_windef.ipynb +0 -0
@@ -1,10 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: OpenPIV
3
- Version: 0.25.2
3
+ Version: 0.25.4
4
4
  Summary: OpenPIV consists in a Python and Cython modules for scripting and executing the analysis of a set of PIV image pairs. In addition, a Qt and Tk graphical user interfaces are in development, to ease the use for those users who don't have python skills.
5
5
  License: GPLv3
6
+ License-File: LICENSE.txt
6
7
  Author: Alex Liberzon
7
- Requires-Python: >=3.7,<3.11
8
+ Requires-Python: >=3.10
8
9
  Classifier: Development Status :: 4 - Beta
9
10
  Classifier: Intended Audience :: Science/Research
10
11
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
@@ -15,32 +16,27 @@ Classifier: Operating System :: Microsoft :: Windows
15
16
  Classifier: Operating System :: OS Independent
16
17
  Classifier: Operating System :: POSIX
17
18
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.7
19
- Classifier: Programming Language :: Python :: 3.8
20
- Classifier: Programming Language :: Python :: 3.9
21
19
  Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
22
24
  Classifier: Topic :: Scientific/Engineering
23
- Requires-Dist: imageio (>=2.22.4,<3.0.0)
24
- Requires-Dist: importlib_resources (==5.12.0)
25
- Requires-Dist: matplotlib (>=3,<4)
26
- Requires-Dist: natsort (>=8.4.0,<9.0.0)
27
- Requires-Dist: numpy (>=1.21.6,<2.0.0)
28
- Requires-Dist: scikit-image (>=0.19.3,<0.20.0)
29
- Requires-Dist: scipy (>=1.7.3,<2.0.0)
30
- Requires-Dist: tqdm (>=4.66.1,<5.0.0)
25
+ Requires-Dist: imageio (>=2.35.0)
26
+ Requires-Dist: matplotlib (>=3.8.0)
27
+ Requires-Dist: natsort (>=8.4.0)
28
+ Requires-Dist: numpy (>=2.0.0)
29
+ Requires-Dist: scikit-image (>=0.23.0)
30
+ Requires-Dist: scipy (>=1.11.0)
31
+ Requires-Dist: tqdm (>=4.66.0)
31
32
  Project-URL: Documentation, http://openpiv.readthedocs.org
32
33
  Project-URL: Repository, https://pypi.python.org/pypi/OpenPIV
33
34
  Description-Content-Type: text/markdown
34
35
 
35
36
  # OpenPIV
36
- [![Build Status](https://travis-ci.org/OpenPIV/openpiv-python.svg?branch=master)](https://travis-ci.org/OpenPIV/openpiv-python)
37
- ![Build and upload to PyPI](https://github.com/OpenPIV/openpiv-python/workflows/Build%20and%20upload%20to%20PyPI/badge.svg)
38
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4409178.svg)](https://doi.org/10.5281/zenodo.4409178)
39
-
40
-
41
-
37
+ [![Python package](https://github.com/OpenPIV/openpiv-python/actions/workflows/testing.yml/badge.svg)](https://github.com/OpenPIV/openpiv-python/actions/workflows/testing.yml)
38
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18304582.svg)](https://doi.org/10.5281/zenodo.18304582)
42
39
  ![PyPI](https://img.shields.io/pypi/v/openpiv)
43
- [![Anaconda-Server Badge](https://anaconda.org/alexlib/openpiv/badges/version.svg)](https://anaconda.org/alexlib/openpiv)
44
40
 
45
41
 
46
42
  OpenPIV consists in a Python and Cython modules for scripting and executing the analysis of
@@ -63,18 +59,36 @@ Click the link - thanks to BinderHub, Jupyter and Conda you can now get it in yo
63
59
 
64
60
  ## Installing
65
61
 
62
+ ### Recommended: Using uv (fastest)
63
+
64
+ [uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver written in Rust:
65
+
66
+ pip install uv
67
+ uv pip install openpiv
68
+
69
+ ### Using pip (standard)
70
+
66
71
  Use PyPI: <https://pypi.python.org/pypi/OpenPIV>:
67
72
 
68
73
  pip install openpiv
69
74
 
75
+ ### Or [Poetry](https://python-poetry.org/)
70
76
 
71
- ## Or `conda`
77
+ poetry add openpiv
72
78
 
73
- conda install -c alexlib openpiv
79
+ ### Note on Conda/Anaconda
74
80
 
75
- ## Or [Poetry](https://python-poetry.org/)
81
+ ⚠️ **Conda packages are no longer actively maintained.** The conda-forge package may be outdated.
76
82
 
77
- poetry add openpiv
83
+ If you previously installed OpenPIV via conda, you can migrate to pip or uv:
84
+
85
+ # Remove the conda package
86
+ conda remove openpiv
87
+
88
+ # Install with pip or uv
89
+ pip install openpiv
90
+ # or
91
+ uv pip install openpiv
78
92
 
79
93
 
80
94
  ### To build from source
@@ -1,12 +1,7 @@
1
1
  # OpenPIV
2
- [![Build Status](https://travis-ci.org/OpenPIV/openpiv-python.svg?branch=master)](https://travis-ci.org/OpenPIV/openpiv-python)
3
- ![Build and upload to PyPI](https://github.com/OpenPIV/openpiv-python/workflows/Build%20and%20upload%20to%20PyPI/badge.svg)
4
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4409178.svg)](https://doi.org/10.5281/zenodo.4409178)
5
-
6
-
7
-
2
+ [![Python package](https://github.com/OpenPIV/openpiv-python/actions/workflows/testing.yml/badge.svg)](https://github.com/OpenPIV/openpiv-python/actions/workflows/testing.yml)
3
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18304582.svg)](https://doi.org/10.5281/zenodo.18304582)
8
4
  ![PyPI](https://img.shields.io/pypi/v/openpiv)
9
- [![Anaconda-Server Badge](https://anaconda.org/alexlib/openpiv/badges/version.svg)](https://anaconda.org/alexlib/openpiv)
10
5
 
11
6
 
12
7
  OpenPIV consists in a Python and Cython modules for scripting and executing the analysis of
@@ -29,18 +24,36 @@ Click the link - thanks to BinderHub, Jupyter and Conda you can now get it in yo
29
24
 
30
25
  ## Installing
31
26
 
27
+ ### Recommended: Using uv (fastest)
28
+
29
+ [uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver written in Rust:
30
+
31
+ pip install uv
32
+ uv pip install openpiv
33
+
34
+ ### Using pip (standard)
35
+
32
36
  Use PyPI: <https://pypi.python.org/pypi/OpenPIV>:
33
37
 
34
38
  pip install openpiv
35
39
 
40
+ ### Or [Poetry](https://python-poetry.org/)
36
41
 
37
- ## Or `conda`
42
+ poetry add openpiv
38
43
 
39
- conda install -c alexlib openpiv
44
+ ### Note on Conda/Anaconda
40
45
 
41
- ## Or [Poetry](https://python-poetry.org/)
46
+ ⚠️ **Conda packages are no longer actively maintained.** The conda-forge package may be outdated.
42
47
 
43
- poetry add openpiv
48
+ If you previously installed OpenPIV via conda, you can migrate to pip or uv:
49
+
50
+ # Remove the conda package
51
+ conda remove openpiv
52
+
53
+ # Install with pip or uv
54
+ pip install openpiv
55
+ # or
56
+ uv pip install openpiv
44
57
 
45
58
 
46
59
  ### To build from source
@@ -71,7 +71,7 @@ def scatter_3D(a, cmap="jet", sca_args=None, control="color", size=60):
71
71
  sm = matplotlib.cm.ScalarMappable(cmap=cmap, norm=norm)
72
72
  sm.set_array([])
73
73
  # different option
74
- cm = matplotlib.cm.get_cmap(cmap)
74
+ cm = matplotlib.colormaps.get_cmap(cmap)
75
75
  colors = cm(norm(a)).reshape(a.shape[0] * a.shape[1] * a.shape[2], 4) #
76
76
  # plotting
77
77
  nan_filter = ~np.isnan(a.flatten())
@@ -83,7 +83,7 @@ def scatter_3D(a, cmap="jet", sca_args=None, control="color", size=60):
83
83
  s=size,
84
84
  **scatter_args
85
85
  )
86
- plt.colorbar(sm)
86
+ fig.colorbar(sm, ax=ax)
87
87
 
88
88
  if control == "alpha":
89
89
  # untested #
@@ -92,8 +92,12 @@ def scatter_3D(a, cmap="jet", sca_args=None, control="color", size=60):
92
92
  plt.show()
93
93
 
94
94
  if control == "size":
95
- sizes = (a - a.min()) * size / a.ptp()
96
- ax.scatter(x, y, z, a, s=sizes, **scatter_args)
95
+ value_range = np.ptp(a)
96
+ if value_range == 0:
97
+ sizes = np.full(a.shape, size, dtype=float)
98
+ else:
99
+ sizes = (a - a.min()) * size / value_range
100
+ ax.scatter(x, y, z, c=a.flatten(), s=sizes.flatten(), **scatter_args)
97
101
  ax_scale = plt.axes([0.88, 0.1, 0.05, 0.7])
98
102
  # ax_scale.set_ylim((0.1,1.2))
99
103
  nm = 5
@@ -172,12 +176,13 @@ def plot_3D_alpha(data):
172
176
  z[:, :, 1::2] += 0.95
173
177
 
174
178
  fig = plt.figure()
175
- ax = fig.gca(projection="3d")
179
+ ax = fig.add_subplot(projection="3d")
176
180
  ax.voxels(x, y, z, fill, facecolors=col_exp, edgecolors=col_exp)
177
181
  ax.set_xlabel("x")
178
182
  ax.set_ylabel("y")
179
183
  ax.set_zlabel("z")
180
184
  plt.show()
185
+ return fig
181
186
 
182
187
 
183
188
  def quiver_3D(
@@ -332,11 +337,11 @@ def quiver_3D(
332
337
 
333
338
  # plotting
334
339
  fig = plt.figure()
335
- ax = fig.gca(projection="3d", rasterized=True)
340
+ ax = fig.add_subplot(projection="3d", rasterized=True)
336
341
  ax.quiver(
337
342
  xf, yf, zf, vf * scale, uf * scale, wf * scale, colors=colors, **quiver_args
338
343
  )
339
- plt.colorbar(sm)
344
+ fig.colorbar(sm, ax=ax)
340
345
 
341
346
  ax.set_xlim(ax_dims[0])
342
347
  ax.set_ylim(ax_dims[1])
@@ -348,8 +353,9 @@ def quiver_3D(
348
353
  ax.set_xlabel("x")
349
354
  ax.set_ylabel("y")
350
355
  ax.set_zlabel("z")
351
- ax.w_xaxis.set_pane_color((0.2, 0.2, 0.2, 1.0))
352
- ax.w_yaxis.set_pane_color((0.2, 0.2, 0.2, 1.0))
353
- ax.w_zaxis.set_pane_color((0.2, 0.2, 0.2, 1.0))
356
+ for axis in (ax.xaxis, ax.yaxis, ax.zaxis):
357
+ pane = getattr(axis, "pane", None)
358
+ if pane is not None:
359
+ pane.set_facecolor((0.2, 0.2, 0.2, 1.0))
354
360
 
355
361
  return fig
@@ -0,0 +1,10 @@
1
+ from importlib.metadata import version
2
+
3
+
4
+ __version__ = version("OpenPIV")
5
+
6
+
7
+ def test():
8
+ import pytest
9
+
10
+ pytest.main()
@@ -0,0 +1,71 @@
1
+ # x y u v flags mask
2
+ 4.0406e-01 3.3983e+00 -5.2592e-03 -5.9910e-02 0.0000e+00 0.0000e+00
3
+ 9.0137e-01 3.3983e+00 -9.6075e-04 -6.4036e-02 0.0000e+00 0.0000e+00
4
+ 1.3987e+00 3.3983e+00 -3.4784e-06 -5.9356e-02 1.0000e+00 0.0000e+00
5
+ 1.8960e+00 3.3983e+00 4.9192e-03 -6.1691e-02 0.0000e+00 0.0000e+00
6
+ 2.3933e+00 3.3983e+00 -9.2873e-04 -5.6505e-02 1.0000e+00 0.0000e+00
7
+ 2.8906e+00 3.3983e+00 -5.9565e-03 -5.0575e-02 0.0000e+00 0.0000e+00
8
+ 3.3879e+00 3.3983e+00 2.1094e-04 -5.7925e-02 0.0000e+00 0.0000e+00
9
+ 3.8852e+00 3.3983e+00 -2.7240e-03 -6.0472e-02 0.0000e+00 0.0000e+00
10
+ 4.3825e+00 3.3983e+00 -3.7283e-03 -5.8267e-02 1.0000e+00 0.0000e+00
11
+ 4.8798e+00 3.3983e+00 2.4173e-03 -6.4150e-02 0.0000e+00 0.0000e+00
12
+ 4.0406e-01 2.9010e+00 -1.8216e-03 -5.4789e-02 0.0000e+00 0.0000e+00
13
+ 9.0137e-01 2.9010e+00 -1.8865e-04 -5.9088e-02 1.0000e+00 0.0000e+00
14
+ 1.3987e+00 2.9010e+00 5.2738e-03 -5.5928e-02 0.0000e+00 0.0000e+00
15
+ 1.8960e+00 2.9010e+00 8.0944e-03 -5.4726e-02 0.0000e+00 0.0000e+00
16
+ 2.3933e+00 2.9010e+00 -2.6124e-03 -5.5983e-02 0.0000e+00 0.0000e+00
17
+ 2.8906e+00 2.9010e+00 -4.3661e-03 -5.1347e-02 0.0000e+00 0.0000e+00
18
+ 3.3879e+00 2.9010e+00 -3.3565e-03 -5.6682e-02 0.0000e+00 0.0000e+00
19
+ 3.8852e+00 2.9010e+00 -3.5475e-03 -6.1713e-02 0.0000e+00 0.0000e+00
20
+ 4.3825e+00 2.9010e+00 -3.8556e-03 -5.6242e-02 1.0000e+00 0.0000e+00
21
+ 4.8798e+00 2.9010e+00 -6.4612e-03 -6.4347e-02 0.0000e+00 0.0000e+00
22
+ 4.0406e-01 2.4036e+00 8.3705e-04 -5.9559e-02 0.0000e+00 0.0000e+00
23
+ 9.0137e-01 2.4036e+00 1.4459e-03 -6.0987e-02 0.0000e+00 0.0000e+00
24
+ 1.3987e+00 2.4036e+00 -3.0819e-04 -5.8402e-02 1.0000e+00 0.0000e+00
25
+ 1.8960e+00 2.4036e+00 -7.8548e-03 -6.5643e-02 0.0000e+00 0.0000e+00
26
+ 2.3933e+00 2.4036e+00 -6.7928e-04 -6.3742e-02 0.0000e+00 0.0000e+00
27
+ 2.8906e+00 2.4036e+00 1.2726e-04 -4.9550e-02 0.0000e+00 0.0000e+00
28
+ 3.3879e+00 2.4036e+00 -6.4997e-03 -4.9535e-02 0.0000e+00 0.0000e+00
29
+ 3.8852e+00 2.4036e+00 -5.7793e-03 -5.4359e-02 0.0000e+00 0.0000e+00
30
+ 4.3825e+00 2.4036e+00 -7.7358e-03 -5.8984e-02 0.0000e+00 0.0000e+00
31
+ 4.8798e+00 2.4036e+00 -3.6829e-03 -5.6436e-02 1.0000e+00 0.0000e+00
32
+ 4.0406e-01 1.9063e+00 -8.4074e-03 -5.9327e-02 0.0000e+00 0.0000e+00
33
+ 9.0137e-01 1.9063e+00 2.5401e-03 -5.4095e-02 0.0000e+00 0.0000e+00
34
+ 1.3987e+00 1.9063e+00 -3.3883e-03 -5.7585e-02 0.0000e+00 0.0000e+00
35
+ 1.8960e+00 1.9063e+00 1.9393e-03 -5.9907e-02 0.0000e+00 0.0000e+00
36
+ 2.3933e+00 1.9063e+00 1.4774e-03 -6.0280e-02 0.0000e+00 0.0000e+00
37
+ 2.8906e+00 1.9063e+00 -1.7161e-03 -5.2136e-02 0.0000e+00 0.0000e+00
38
+ 3.3879e+00 1.9063e+00 -9.2400e-03 -4.8946e-02 0.0000e+00 0.0000e+00
39
+ 3.8852e+00 1.9063e+00 -7.1067e-03 -4.8031e-02 0.0000e+00 0.0000e+00
40
+ 4.3825e+00 1.9063e+00 -1.2505e-03 -5.2882e-02 0.0000e+00 0.0000e+00
41
+ 4.8798e+00 1.9063e+00 6.4614e-04 -5.0812e-02 0.0000e+00 0.0000e+00
42
+ 4.0406e-01 1.4090e+00 2.2486e-03 -5.0550e-02 0.0000e+00 0.0000e+00
43
+ 9.0137e-01 1.4090e+00 -6.7877e-03 -5.4202e-02 0.0000e+00 0.0000e+00
44
+ 1.3987e+00 1.4090e+00 -2.5288e-03 -6.3126e-02 0.0000e+00 0.0000e+00
45
+ 1.8960e+00 1.4090e+00 -5.9178e-04 -5.8457e-02 0.0000e+00 0.0000e+00
46
+ 2.3933e+00 1.4090e+00 5.8459e-03 -5.2184e-02 0.0000e+00 0.0000e+00
47
+ 2.8906e+00 1.4090e+00 5.4790e-03 -4.3826e-02 0.0000e+00 0.0000e+00
48
+ 3.3879e+00 1.4090e+00 -7.8645e-04 -5.1268e-02 0.0000e+00 0.0000e+00
49
+ 3.8852e+00 1.4090e+00 -5.9201e-03 -5.2166e-02 0.0000e+00 0.0000e+00
50
+ 4.3825e+00 1.4090e+00 -4.3095e-03 -5.2602e-02 0.0000e+00 0.0000e+00
51
+ 4.8798e+00 1.4090e+00 -2.2094e-03 -5.4975e-02 0.0000e+00 0.0000e+00
52
+ 4.0406e-01 9.1173e-01 9.7924e-03 -5.5734e-02 0.0000e+00 0.0000e+00
53
+ 9.0137e-01 9.1173e-01 7.5636e-03 -5.2847e-02 0.0000e+00 0.0000e+00
54
+ 1.3987e+00 9.1173e-01 9.0445e-03 -4.9824e-02 0.0000e+00 0.0000e+00
55
+ 1.8960e+00 9.1173e-01 1.4482e-03 -5.3496e-02 0.0000e+00 0.0000e+00
56
+ 2.3933e+00 9.1173e-01 -3.3418e-03 -5.3215e-02 0.0000e+00 0.0000e+00
57
+ 2.8906e+00 9.1173e-01 -5.2835e-03 -4.9696e-02 0.0000e+00 0.0000e+00
58
+ 3.3879e+00 9.1173e-01 -5.0878e-03 -5.0559e-02 0.0000e+00 0.0000e+00
59
+ 3.8852e+00 9.1173e-01 -5.8373e-03 -5.1331e-02 0.0000e+00 0.0000e+00
60
+ 4.3825e+00 9.1173e-01 -9.5435e-04 -5.1071e-02 0.0000e+00 0.0000e+00
61
+ 4.8798e+00 9.1173e-01 -1.7836e-03 -5.0735e-02 0.0000e+00 0.0000e+00
62
+ 4.0406e-01 4.1442e-01 7.7151e-03 -5.9321e-02 0.0000e+00 0.0000e+00
63
+ 9.0137e-01 4.1442e-01 1.0424e-02 -5.2889e-02 0.0000e+00 0.0000e+00
64
+ 1.3987e+00 4.1442e-01 -1.2132e-03 -5.1367e-02 0.0000e+00 0.0000e+00
65
+ 1.8960e+00 4.1442e-01 1.8418e-03 -5.2428e-02 1.0000e+00 0.0000e+00
66
+ 2.3933e+00 4.1442e-01 3.0095e-03 -4.7837e-02 0.0000e+00 0.0000e+00
67
+ 2.8906e+00 4.1442e-01 2.7171e-03 -5.1027e-02 0.0000e+00 0.0000e+00
68
+ 3.3879e+00 4.1442e-01 -5.2003e-03 -5.0522e-02 0.0000e+00 0.0000e+00
69
+ 3.8852e+00 4.1442e-01 -4.6899e-03 -5.3185e-02 0.0000e+00 0.0000e+00
70
+ 4.3825e+00 4.1442e-01 -2.9401e-03 -5.4006e-02 0.0000e+00 0.0000e+00
71
+ 4.8798e+00 4.1442e-01 2.9101e-03 -5.1380e-02 0.0000e+00 0.0000e+00
@@ -64,7 +64,7 @@ copyright = '2014, OpenPIV team'
64
64
  # built documents.
65
65
  #
66
66
  # The short X.Y version.
67
- version = '0.24.4a'
67
+ version = '0.25.4'
68
68
  # The full version, including alpha/beta/rc tags.
69
69
  # release = '0.0.1a'
70
70
 
@@ -1,4 +1,3 @@
1
- numpy>=1.9
2
1
  openpiv
3
2
  sphinx
4
3
  recommonmark
@@ -19,23 +19,42 @@ The dependencies are:
19
19
  * `Python <http://python.org/>`_
20
20
  * `Scipy <http://numpy.scipy.org/>`_
21
21
  * `Numpy <http://www.scipy.org/>`_
22
- * `scikit-image <http://scikit-image.org/>`_
23
-
24
- On all platforms, the following Python distribution is recommended:
25
-
26
- * Anaconda <https://store.continuum.io/cshop/anaconda/>
22
+ * `scikit-image <http://scikit-image.org/>`_
27
23
 
28
24
 
29
25
  Installation
30
26
  ============
31
27
 
32
- Use `conda` ::
28
+ Recommended: Use `uv` (fastest)
29
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
+
31
+ `uv <https://github.com/astral-sh/uv>`_ is a fast Python package installer and resolver written in Rust.
32
+ It provides faster and more reliable package installation compared to traditional tools.
33
+
34
+ To install OpenPIV with uv::
33
35
 
34
- conda install -c alexlib openpiv
36
+ pip install uv
37
+ uv pip install openpiv
35
38
 
36
- Or use `pip` ::
39
+ Or use `pip` (standard)
40
+ ^^^^^^^^^^^^^^^^^^^^^^^^
41
+
42
+ ::
37
43
 
38
44
  pip install openpiv
45
+
46
+ .. warning::
47
+ **Conda packages are no longer actively maintained.** The conda-forge package may be outdated.
48
+
49
+ If you previously installed OpenPIV via conda, you can migrate to pip or uv::
50
+
51
+ # Remove the conda package
52
+ conda remove openpiv
53
+
54
+ # Install with pip or uv
55
+ pip install openpiv
56
+ # or
57
+ uv pip install openpiv
39
58
 
40
59
  Get OpenPIV source code!
41
60
  ========================
@@ -44,8 +44,13 @@ def _gaussian_kernel(half_width: int=1)-> np.ndarray:
44
44
 
45
45
  """
46
46
  # size = int(half_width)
47
- x, y = np.mgrid[-half_width:half_width + 1, -half_width:half_width + 1]
48
- g = np.exp(-(x ** 2 / float(half_width) + y ** 2 / float(half_width)))
47
+
48
+ if half_width == 0:
49
+ return 1
50
+ else:
51
+ x, y = np.mgrid[-half_width:half_width + 1, -half_width:half_width + 1]
52
+ g = np.exp(-(x ** 2 / float(half_width) + y ** 2 / float(half_width)))
53
+
49
54
  return g / g.sum()
50
55
 
51
56
 
@@ -169,21 +174,21 @@ def replace_outliers(
169
174
  # regardless the grid_mask (which is a user-provided masked region)
170
175
 
171
176
 
172
- if not isinstance(u, np.ma.MaskedArray):
173
- u = np.ma.masked_array(u, mask=np.ma.nomask)
174
-
175
- # store grid_mask for reinforcement
176
- grid_mask = u.mask.copy()
177
-
178
- u[flags] = np.nan
179
- v[flags] = np.nan
177
+ has_mask = isinstance(u, np.ma.MaskedArray)
178
+ grid_mask = np.ma.getmaskarray(u).copy() if has_mask else np.ma.nomask
179
+
180
+ u_data = np.array(np.ma.getdata(u), copy=True)
181
+ v_data = np.array(np.ma.getdata(v), copy=True)
182
+
183
+ u_data[flags] = np.nan
184
+ v_data[flags] = np.nan
180
185
 
181
186
  uf = replace_nans(
182
- u, method=method, max_iter=max_iter, tol=tol,
187
+ u_data, method=method, max_iter=max_iter, tol=tol,
183
188
  kernel_size=kernel_size
184
189
  )
185
190
  vf = replace_nans(
186
- v, method=method, max_iter=max_iter, tol=tol,
191
+ v_data, method=method, max_iter=max_iter, tol=tol,
187
192
  kernel_size=kernel_size
188
193
  )
189
194
 
@@ -192,9 +197,10 @@ def replace_outliers(
192
197
  vf = np.ma.masked_array(vf, mask=grid_mask)
193
198
 
194
199
  if isinstance(w, np.ndarray):
195
- w[flags] = np.nan
200
+ w_data = np.array(np.ma.getdata(w), copy=True)
201
+ w_data[flags] = np.nan
196
202
  wf = replace_nans(
197
- w, method=method, max_iter=max_iter, tol=tol,
203
+ w_data, method=method, max_iter=max_iter, tol=tol,
198
204
  kernel_size=kernel_size
199
205
  )
200
206
  wf = np.ma.masked_array(wf, mask=grid_mask)
@@ -2,7 +2,6 @@ import numpy as np
2
2
 
3
3
 
4
4
  def replace_nans(array, max_iter, tol, kernel_size=2, method="disk"):
5
-
6
5
  """Replace NaN elements in an array using an iterative image inpainting
7
6
  algorithm.
8
7
 
@@ -18,26 +17,15 @@ def replace_nans(array, max_iter, tol, kernel_size=2, method="disk"):
18
17
  threshold.
19
18
 
20
19
  Methods:
21
-
22
- localmean - A square kernel where all elements have the same value,
23
- weights are equal to n/( (2*kernel_size+1)**2 -1 ),
24
- where n is the number of non-NaN elements.
25
- disk - A circular kernel where all elements have the same value,
26
- kernel is calculated by::
27
- if ((S-i)**2 + (S-j)**2)**0.5 <= S:
28
- kernel[i,j] = 1.0
29
- else:
30
- kernel[i,j] = 0.0
31
- where S is the kernel radius.
32
- distance - A circular inverse distance kernel where elements are
33
- weighted proportional to their distance away from the
34
- center of the kernel, elements farther away have less
35
- weight. Elements outside the specified radius are set
36
- to 0.0 as in 'disk', the remaining of the weights are
37
- calculated as::
38
- maxDist = ((S)**2 + (S)**2)**0.5
39
- kernel[i,j] = -1*(((S-i)**2 + (S-j)**2)**0.5 - maxDist)
40
- where S is the kernel radius.
20
+ localmean - A square kernel where all elements have the same weight.
21
+ disk - A circular kernel where all elements have the same weight.
22
+ distance - A circular kernel where the weight of each element depends
23
+ on its distance from the center of the kernel. The weights
24
+ are given by a function of the form:
25
+ w_i = 1 - (d_i / d_max)^2
26
+ where d_i is the distance from the center, and d_max is the
27
+ distance of the element farthest from the center.
28
+ This method requires SciPy.
41
29
 
42
30
  Parameters
43
31
  ----------
@@ -68,6 +56,9 @@ def replace_nans(array, max_iter, tol, kernel_size=2, method="disk"):
68
56
  a copy of the input array, where NaN elements have been replaced.
69
57
 
70
58
  """
59
+ # Check if there are any NaNs to replace
60
+ if not np.any(np.isnan(array)):
61
+ return array.copy()
71
62
 
72
63
  kernel_size = int(kernel_size)
73
64
  filled = array.copy()