Skip to content

v0.2.1: Turbulence Analysis Suite & Accessor Modernization

Choose a tag to compare

@alexlib alexlib released this 01 Oct 21:19
· 10 commits to master since this release

What's Changed in PIVPy v0.2.1

Turbulence Analysis Suite (Adapted & Learned from Lior Shig's xrturb)

  • Weighted Ensemble Fluctuations & Product Parser:
    • ds.piv.fluct(var_key, weights=...): weighted/unweighted velocity fluctuations $u' = u - \langle u \rangle$.
    • ds.piv.product("u'v'"), ds.piv.product("u'u'u'"): declarative parser for instantaneous products of raw or fluctuating variables.
  • Full Reynolds Stress Tensor & TKE:
    • ds.piv.reynolds_stresses(weights=...): calculates all normal and shear stress components ($\langle u'u' \rangle, \langle v'v' \rangle, \langle w'w' \rangle, \langle u'v' \rangle, \langle u'w' \rangle, \langle v'w' \rangle$) for 2D and 3D datasets.
    • ds.piv.tke(): corrected canonical factor of 0.5 in $k = \frac{1}{2} \sum \langle u_i'^2 \rangle$, support for multi-component stereo PIV, and added time_average and weights options.
  • Higher-Order Moments & Products:
    • ds.piv.moments(order=3, standardized=True): central and standardized moments up to arbitrary order (skewness, flatness/kurtosis, triple correlations).
    • ds.piv.all_products(order=2): appends instantaneous fluctuation products up to order N.
  • Probe-Based Two-Point Correlation & Multi-Model Length Scales:
    • ds.piv.two_point_correlation(var_name="u", x_ref=..., y_ref=...): localized cross-covariance map relative to an arbitrary probe position with lag_x and lag_y coordinates.
    • ds.piv.length_scale() & compute_length_scale(): multi-method integral length scale estimations (1/e threshold with linear interpolation, zero-crossing integral, single exponential fit, bi-exponential fit).
  • Quadrant & Octant Analysis:
    • ds.piv.add_quadrants() & ds.piv.quadrant_analysis(): hyperbolic hole filtering $|u'v'| \ge H |\langle u'v' \rangle|$ and event classification (Q1 outward, Q2 ejection, Q3 inward, Q4 sweep), conditional averages, stress contribution fractions, and residence durations.
  • Profile Smoothing & Analytic Derivatives:
    • ds.piv.smooth_savgol(): 1D Savitzky-Golay filtering with automatic non-uniform grid resampling.
    • ds.piv.smooth_spline(): B-spline smoothing with analytical derivatives (deriv=1 for noise-free gradients $\partial u / \partial y$).
    • Integrated into ds.piv.smooth(method="savgol"|"spline").
  • Irregular Time-Series Spectra:
    • ds.piv.non_uniform_spectra(): slot correlation with arrival-time weighting (ATW) and local normalization for non-uniform signals.

Accessor & Core Cleanup

  • ds.piv.crop() and ds.piv.vec2scal() are now pure functions returning the new dataset without in-place mutation of internal accessor state or raising deprecation warnings.
  • Added Lior Shig to the authors in pyproject.toml and pivpy/pivpy.py.
  • Bumped version to 0.2.1.