Structure functions on very large turbulence datasets, with error bars

0 replies · 21 views
pyturbosf
Messages
0
Reaction score
0
Hi all,

Anyone who has computed structure functions on a large simulation or satellite field knows the problem: comparing every point with every other point grows with the square of the data size, so a realistic grid can take hours, and at the end there is still no error bar on the curve.

PyTurbo_SF, an open-source Python package published in the Journal of Open Source Software, takes a different route. It draws blocks of the data at a ladder of spacings (1, 2, 4, 8 grid points and so on) and bootstraps them, which brings the cost of a 1D calculation down from N squared to N log N. Each separation bin is then followed on its own: as soon as its standard error falls below the threshold you choose, it stops, and the remaining effort goes only to the scales that still need it. You get the structure function, its confidence intervals and a flag telling you whether each scale has converged.

A few things physicists may find particularly useful. For 2D and 3D fields, the isotropic average comes with its own diagnostics of how isotropic and how homogeneous the flow actually is, so you can see whether the assumption holds before relying on it. In 2D, the advective structure function can be turned into a spectral energy flux through a Bessel transform, and its sign tells you directly whether energy is moving toward small scales or large ones. Structure functions can also be conditioned on any other variable, for example vorticity, temperature or strain rate, to separate fronts from eddies or one regime from another.

The documentation includes worked examples on real data: an ocean mooring time series, SWOT satellite altimetry, a regional ocean model, a sea-ice region of a global simulation and a 3D atmospheric large-eddy simulation.

pip install pyturbo_sf
https://pyturbo-sf.readthedocs.io

I would be very grateful for any feedback, and happy to help anyone try it on their own data.