Skip to content

Commit 62c022e

Browse files
committed
Refactor smoothn.py with scipy interpolate and NumPy fallbacks
1 parent 0ad33b4 commit 62c022e

4 files changed

Lines changed: 957 additions & 732 deletions

File tree

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ OpenPIV is a Python library for Particle Image Velocimetry (PIV) analysis of flu
3636
- `tools.py` — I/O and visualization: `imread()`, `save()`, `display_vector_field()`, `transform_coordinates()` (always call before saving/displaying results — raw PIV output coordinates are in image/array convention, not physical/plot convention).
3737
- `scaling.py` — coordinate scaling and transformation.
3838
- `preprocess.py` — image preprocessing (background subtraction, masking).
39-
- `smoothn.py` — robust spline smoothing; a Python port of `smoothn.m` (D. Garcia / Prof. Lewis) bundled for convenience — it is not covered by the OpenPIV license, see README for attribution.
39+
- `smoothn.py` — robust scalar field smoothing using `scipy.interpolate` and penalized splines for 1D, 2D, and N-D data with missing values (NaNs) and masked arrays.
4040
- `phase_separation.py` — solid-phase / liquid-tracer separation utilities.
4141

4242
### Typical call chains

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ These and many additional examples are in another repository: [OpenPIV-Python-Ex
190190
15. [Yuri Ishizawa](https://github.com/yuriishizawa)
191191

192192

193-
Copyright statement: `smoothn.py` is a Python version of `smoothn.m` originally created by D. Garcia [https://de.mathworks.com/matlabcentral/fileexchange/25634-smoothn], written by Prof. Lewis and available on Github [https://github.com/profLewis/geogg122/blob/master/Chapter5_Interpolation/python/smoothn.py]. We include a version of it in the `openpiv` folder for convenience and preservation. We are thankful to the original authors for releasing their work as an open source. OpenPIV license does not relate to this code. Please communicate with the authors regarding their license.
193+
Smoothing: `smoothn.py` provides scalar field smoothing for velocity fields (1D, 2D, and N-D) with support for missing data (NaNs) and masked arrays using `scipy.interpolate` and robust penalized spline methods. It is covered under the OpenPIV GPL v3 license. Based on discretized smoothing principles from D. Garcia (2010).
194194

195195
## How to cite this work
196196
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.593157.svg)](https://doi.org/10.5281/zenodo.593157)

0 commit comments

Comments
 (0)