smerckel / dbdreader

A reader for binary data files created by Slocum ocean gliders (AUVs)
GNU General Public License v3.0
16 stars 14 forks source link

MNT: more error checking for get_sync #15

Closed jklymak closed 1 year ago

jklymak commented 1 year ago

This checks if any data exists in the variable before trying to interpolate, avoiding errors in np.interp if there is no data.

Ummm, looks like my editor also removed trailing spaces - happy to try and back that out if needed.

jklymak commented 1 year ago

@hvdosser, please pull and test this branch on the bad data set we had - should work, at least with the small subset you gave me.

smerckel commented 1 year ago

Thank you for this pull request. I modified the approach slightly, and also applied it to the DBD class, not only MultiDBD. Also fixed the cascaded problem in get_CTD_sync.

jklymak commented 1 year ago

Thanks, looks good. I never think to let errors fall through because I'm never quite sure how expensive that is. However, I think in this case its the right thing as interp catches this error right away.