This is a large refactor to improve the readability of the code and add substantial testing.
Summary of updates
advection_velocity is now generate_structure_functions and can return advective and traditional structure functions for velocity and scalar data.
Separated some functions from generate_structure_functions to create:
bin_data: bins the separation distances and structure function array in the case of uneven data
shift_array1d and shift_array2d: shift arrays (1D and 2D) by a given integer (set within generate_structure_functions based on number of grid points)
calculate_separation_distances: gets separation distances for uniform and latitude-longitude grids
calculate_structure_function: calculates the structure function for two points of data (called within generate_structure_functions, does not return the full array of structure functions for each separation distance). Supports advective and traditional structure functions for velocity and scalar data.
calculate_velocity_advection and calculate_scalar_advection have been combined into calculate_advection and can therefore calculate either. Supports uniform and latitude-longitude grids.
All functions have docstring
All functions have tests. More can be added and are welcome
This is a large refactor to improve the readability of the code and add substantial testing.
Summary of updates
advection_velocity
is nowgenerate_structure_functions
and can return advective and traditional structure functions for velocity and scalar data.generate_structure_functions
to create:bin_data
: bins the separation distances and structure function array in the case of uneven datashift_array1d
andshift_array2d
: shift arrays (1D and 2D) by a given integer (set withingenerate_structure_functions
based on number of grid points)calculate_separation_distances
: gets separation distances for uniform and latitude-longitude gridscalculate_structure_function
: calculates the structure function for two points of data (called withingenerate_structure_functions
, does not return the full array of structure functions for each separation distance). Supports advective and traditional structure functions for velocity and scalar data.calculate_velocity_advection
andcalculate_scalar_advection
have been combined intocalculate_advection
and can therefore calculate either. Supports uniform and latitude-longitude grids.