MHKiT-Software / MHKiT-Python

MHKiT-Python provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
47 stars 45 forks source link

Dolfyn reader estimates the number of pings in the file based on the length in bytes of the first ping #206

Closed browniea closed 1 year ago

browniea commented 1 year ago

Describe the bug:

Comparing data from a Teledyne river pro ADCP processed by Teledyne software WinRiver to processing it in dolfyn. The data had 9020 points in WinRiver and only 6507 points in dolfyn.

Problem:

The found issue is that the Dolfyn reader estimates the number of pings in the file based on the length in bytes of the first ping. For this file the first data point is 1700 bytes and the others are 1200 bytes.

*Referencing data collected on 7/1/2022 on the Tanana River near Nenana Alaska.

jmcvey3 commented 1 year ago

I copied over a function from the nortek.py reader that estimates the length of the file based on the average of the first 50 pings, instead of the first. This should make the reader more robust to filesize changes from WinRiver and VMDAS.