MHKiT-MATLAB icon indicating copy to clipboard operation
MHKiT-MATLAB copied to clipboard

Add additional dolfyn functionality

Open zur-quin opened this issue 2 years ago • 1 comments

Starting with fillgaps_time() and val_exceeds_thresh() functions as well as some tests/examples for both.

zur-quin avatar Mar 01 '23 00:03 zur-quin

Finished Tasks:

  • added .nc files from MHKiT python for cleaning and comparing
  • fillgaps_depth.m function written
  • fillgaps_time.m function written
  • val_exceeds_thresh.m function written
  • Dolfyn_Test_Clean.m mimics test_clean.py with some function calls commented out (if they haven't been written yet), use this as a secondary TODO list to finish this PR

TO-DO:

  • [ ] Check the files uploaded are the files we want to use. In python .nc files are used, but many tests in Matlab use the .ad2cp files.
  • [ ] (In-progress) find_surface.m function: this function has been started, but still has some errors. See notes in the file for more details.
  • [ ] (In-progress) Dolfyn_Test_Clean.compare_structures helper function to compare the structures at the end of tests. This exists at the bottom of the Dolfyn_Test_Clean.m file, but is mostly just copied from the Dolfyn_Test_Rotate.m test and needs adjusting to compare the correct parts of the data.
  • The following are functions called in the test_clean.py that, as far as I'm aware, do not exist yet on the Matlab side. These are called in Dolfyn_Test_Clean.m but have been commented out. There are "TODO" comments in Dolfyn_Test_Clean.m listing these, but the list is reproduced here:
    • [ ] GN2002.m (File does not exist yet)
    • [ ] clean_fill.m (File does not exist yet)
    • [ ] fill_nan_ensemble_mean.m (File does not exist yet)
    • [ ] spike_tresh.m (File does not exist yet)
    • [ ] range_limit.m (File does not exist yet)
    • [ ] medfilt_orient.m (File does not exist yet)

Final notes:

  • As far as I'm aware the completed functions work as intended, but have not been verified.
  • MHKiT-MATLAB\mhkit\dolfyn\tools\create_dataset.m is a good function to be aware of, it creates the structure in Matlab that is attempting to mimic the xarray dataset used in python.
  • The best things to do first are probably the compare_structures function and finish find_surface.m function...then you can run test_clean_downADCP and test_clean_upADCP tests in Dolfyn_Test_Clean.m. After that, pick whichever test function you want to work on in DOlfyn_Test_Clean and finish the required functions in there.

zur-quin avatar Jun 15 '23 18:06 zur-quin