frank-engel-usgs / VMT

The Velocity Mapping Toolbox
Other
19 stars 12 forks source link

VMT 4.08 ERROR: Interp2 for RG (VMT_GridData2MeanXS.m) "Input grid is not a valid MESHGRID" #12

Open Ryan-Jackson-USGS opened 6 years ago

Ryan-Jackson-USGS commented 6 years ago

The revision of the interpolation method (interp2 vs TriScatteredInterp) in VMT 4.08 is producing errors for RG data. I first noticed this when running the WhiteWabash test dataset in 4.08 (transect 022). It is also occurring for a user dataset (05418570_000_ASC.txt). I have attached both files.

The error thrown is the same: Error using interp2>makegriddedinterp (line 237) Input grid is not a valid MESHGRID. Error in interp2 (line 136) Error in VMT_GridData2MeanXS (line 153) Error in VMT_ProcessTransects (line 43) Error in VMT>shiptracksPlotCallback (line 2026) Error in VMT>loadDataCallback (line 1812)

Debugging and looking at the inputs to interp2 (X,Y,v,Xi,Yi) I do not see evidence that X,Y,Xi, or Yi, are not monotonically increasing. Interp2 was used in previous versions before Sontek data was included and the WhiteWabash data has never produced this error (one of the most robust datasets we have).

After a first review, it appears the root of the issue is ensemble 5872 in the WabWhi20080112_022_ASC.TXT file. The ASCII file shows this ensemble has different bin depths than the rest of the ensembles (first bin at 0.49 m vs. 0.61 for the rest). Removing the offending ensemble allowed it to run. 05418570_5_000_ASC.TXT has a mix of ensembles with 0.49 and 0.59 as the depth of the first bin (I think this is RiverPro data, but I have not confirmed that yet--I only have the ASCII).

NOTE: The fix for Issue #7 should also fix this. It does not appear Issue #7 has been resolved to date.

WabWhi20080112_022_ASC.TXT 05418570_5_000_ASC.TXT

RodrigoCXO commented 2 years ago

I'm still having this error in the 9.0 version. The company that coleted the datas was using a ADCP Rowe 600 kHz 4 Beams equipament with the software PULSE. After, they convert the datas from ".bin" to ".PD0", open the result in Winriver II and create a ASCII file. The mesange that is written when the error apear is: "An unexpected error occurred. Error code: MATLAB:interp2:InvalidMeshgrid Error datails are being written to the following file:"

I'm attatching the file that I used and the error txt

errorLog20220830090841.txt

RTI_20210819112538_00747_0_600 kHz 4 beam 20 degree piston_pd0.pd0_ASC.TXT

I'll be glad if someone can help! thanks a lot guys!