frank-engel-usgs / VMT

The Velocity Mapping Toolbox
Other
19 stars 12 forks source link

VMT 4.08 not recognizing RiverPro ADCPs (marks them as Rio Grande) #7

Open Ryan-Jackson-USGS opened 7 years ago

Ryan-Jackson-USGS commented 7 years ago

VMT (v4.08) is not correctly recognizing RiverPro ADCPs and is marking the instrument type as a Rio Grande in the sensor type. Because the Rio Grande ADCPs have fixed configuration (bin size, blank, mode, etc.) and the RiverPro does not, there are slightly different processing pathways used depending on instrument type. VMT is trying to put RiverPro data into the wrong processing pathway and it is causing the program to generate errors during 2-D interpolation. We have not extensively tested VMT with RiverPro or RioPros, so you have discovered a bug that we need to fix.

Need to add RioPro and RiverPro to the sensor types in order to force VMT to use TriScatteredInterp in VMT_GridData2MeanXS.m rather than interp2. Since instrument type is not in the ASCII file, perhaps th ebest way to determine if the instrument is a RioPro or RiverPro is to check for consistency in bin depths for all ensembles (I found the offending ensembles using diff(Y) at breakpoint for line 136 of interp2, but could be done earlier). For instance, in tfile, check for sum(abs(diff(Wat.binDepth(1,:)))) ~= 0. This will pick up any changes in bin depth signaling auto-adaptive sampling and the sensor type can be marked as RioPro or RiverPro.

Ryan-Jackson-USGS commented 7 years ago

I implemented the suggested change above to tfile and had to change VMT_SmoothVar (added RP to the list of sensor types) and that seemed to do the trick. Will send the new code to Frank for testing.

frank-engel-usgs commented 6 years ago

I am considering changing the default interpretation method in VMT to avoid using MESHGRID altogether. We had established early on that MESHGRID seems to give a more reasonable interpolation when the data are monotonic 2D, but the difference is subtle. @Ryan-Jackson-USGS do you have any strong opinion on abandoning MESHGRID? Doing so would effectively solve this issue.