Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOLfYN: Add dimensional averaging, current speed/direction calculations, and enhance ADCP example #141

Merged
merged 23 commits into from
Feb 14, 2025

Conversation

simmsa
Copy link
Contributor

@simmsa simmsa commented Jul 23, 2024

Overview

  • Added surface interference cleaning, averaging, speed and direction calculations to ADCP example
  • Added current speed and direction calculation functions
  • Added averaging by dimension calculations for flexible data analysis
  • Improved DOLFYN tests for better reliability
  • Added standardization features to dolfyn_plot for consistent visualizations
  • Improved performance of read_signature function
  • Enhanced NetCDF support: Now reading all data attributes, not just "units"

Details

  • Added .m file for acdp_example.m
    • Fixed typos, added clarity where MATLAB deviates from Python
    • Added additional visualizations for all velocity directions
  • Added averaging by dimension calculation
  • Added horizontal speed and velocity calculations
  • dolfyn_plot
    • Use dataset attributes for labels, if they exist
    • Add argument to set color bar range
    • Add argument to plot histograms, kind
    • Allow plotting multiple directions using subplots
    • Added colormaps that use matplotlib colors
  • Added caching to py_struct_2_bytes_format for better performance
  • Updated write_netcdf for MATLAB 2022+ compatibility

Function Renaming to Match MHKiT-Python Conventions

  • find_surface_from_Pwater_depth_from_pressure
  • nan_beyond_surfaceremove_surface_interference

These renames align our function names with MHKiT-Python conventions for better consistency across the ecosystem.

Testing

  • Added averaging, speed, and velocity calculation tests
  • Added tests for NetCDF data attribute reading
  • Added simple tests for read_netcdf
  • Verified surface masking calculations

simmsa added 5 commits July 25, 2024 07:03
The previous code here appeared to use an xarray features that allow for
comparison across coordinates/dimensions. This more explicitly creates a
matrix of ranges over time and outputs bds as a binary matrix with 1
denoting a value below the surface interference distance and 0 a value
above the surface interference distance.
Add `plotArgs` argument allowing the user to passing arguments directly
to the selected plotting function
@simmsa simmsa changed the title Dolfyn Parity Dolfyn Cleaning Jul 25, 2024
@simmsa simmsa marked this pull request as ready for review February 4, 2025 17:53
@simmsa simmsa marked this pull request as draft February 4, 2025 17:53
@simmsa simmsa added this to the 0.6.0 milestone Feb 4, 2025
* Extract titles and labels from dataset where possible
* Add subplots via dimension array argument
* Add color bar limits
* Specify colors for specific fields
* Add "kind", histogram only for now
* Improve code readability
This improves the speed of `read_signature` by caching the result
instead of performing the conversion. Testing on `accp_example` gives a
roughly 10% improvement speed read speed.
Remove older `.h5` writer in favor of `ncreate`, `ncwrite`, and
`ncwriteatt`. NetCDF support in MATLAB seems to have improved
significantly compared to the 2021 releases.
Includes all python features except turbulence statistics
@simmsa simmsa changed the title Dolfyn Cleaning DOLfYN: Add dimensional averaging, current speed/direction calculations, and enhance ADCP example Feb 13, 2025
@simmsa simmsa requested a review from rpauly18 February 13, 2025 20:36
@simmsa simmsa marked this pull request as ready for review February 13, 2025 20:42
@rpauly18
Copy link
Contributor

@simmsa I have a few tests failing - screenshots below. I am looking into it, but let me know if you have seen these before.
Screenshot 2025-02-14 at 9 08 52 AM
Screenshot 2025-02-14 at 9 10 31 AM
Screenshot 2025-02-14 at 9 11 21 AM
Screenshot 2025-02-14 at 9 12 07 AM

@simmsa
Copy link
Contributor Author

simmsa commented Feb 14, 2025

@rpauly18 thank you. Those failing tests look familiar, can you try the code from here: https://github.com/simmsa/MHKiT-MATLAB/tree/dolfyn-parity?

git clone [email protected]:simmsa/MHKiT-MATLAB.git dolfyn-parity
cd dolfyn-parity
git checkout -b dolfyn-parity

Those tests are fixed in develop and I merged them into this pr here: simmsa@486f817 to avoid any merge conflicts and can see changes the dolfyn-parity branch above, but I do not see the changes in this PR. LMK if this doesn't work.

@simmsa simmsa merged commit 2948408 into MHKiT-Software:develop Feb 14, 2025
46 checks passed
This was referenced Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants