OSOceanAcoustics / echopype

Enabling interoperability and scalability in ocean sonar data analysis
https://echopype.readthedocs.io/
Apache License 2.0
95 stars 73 forks source link

Handle missing GPS and/or MRU data #185

Closed ngkavin closed 4 years ago

ngkavin commented 4 years ago

For some EK80 data files, pitch, roll, heave, and NMEA data are not recorded, so they are saved as empty lists. When creating an xarray dataset, pitch, roll, heave, lat, and lon are assumed to have coordinates of time, so an error is raised when these values are empty.

The best solution is likely to fill empty pitch, roll, heave, lat, and lon values with NaNs with length of ping_time so that it can be saved to the xarray dataset.

leewujung commented 4 years ago

Ugh, upon digging into the code some more, I found a bug 😎

Under the MRU datagram (here) self.mru_data['timestamp'] records the actual MRU timestamp but when saving to platform group, we currently have out_dict['ping_time'] = self.ping_time which is the ping time from the RAW datagram (echo data) (here).

Lat/lon have another time base from the NME datagram and that timestamp is now correctly saved into the Platform group.