Hello everyone,
I would like to share PyTurbo_SF, an open-source Python package I have been developing for structure function analysis of turbulent flows and other spatially or temporally varying fields. It was recently published in the Journal of Open Source Software, and I thought it might be useful to people in the Pangeo community who work with observations or model output at scales where structure functions are a natural diagnostic.
The package computes longitudinal, transverse, scalar and combined structure functions on 1D, 2D and 3D data, with isotropic averaging for the 2D and 3D cases. Since many of us work with large datasets, a good part of the effort went into memory efficiency and parallel processing, and into the statistics: confidence intervals come from an adaptive bootstrap, and the calculation stops automatically once the standard error falls below a threshold you set in physical units. It also supports conditional structure functions and a Bessel-function decomposition of the energy flux across scales.
You can install it with pip:
pip install pyturbo_sf
Documentation and examples: https://pyturbo-sf.readthedocs.io
JOSS paper: Journal of Open Source Software: PyTurbo_SF: An Adaptive Bootstrap Framework for Efficient Structure Function Analysis in Turbulent Flows
I would be very grateful for any feedback, bug reports or feature requests, and I would be particularly happy to hear from anyone applying structure functions to drifter trajectories, satellite altimetry such as SWOT, mooring time series or high resolution simulations. If you have a dataset or a use case you think the package should handle, please do not hesitate to open an issue on GitHub or reply here, and I will do my best to help.
Thank you for reading, and many thanks to the JOSS editor and reviewers whose comments improved the package considerably.
Best regards,
Adam