Closed jr3cermak closed 2 years ago
Thanks jr3cermak for spotting this bug. Now dbdreader returns inf values for all inf values in the binary file.
Also, your script revealed another bug: if all variables are read using the .get() method, then the time vectors got messed up. In your example script you got around that to extract the time vector from the "values" vector of the (times, values) tuple for m_present_time. This is now fixed as well.
I discovered a small edge case using the dbdreader. The problem is confined to a single field: m_time_til_wpt. It may apply to any field where the value is infinite (inf). The result is the read data field is short a few values depending on the number if "inf" values encountered. The existing dbd file can be used to demonstrate the bug (amadeus-2014-204-05-000.dbd).
Using the slocum binary (dbd2asc) the first 24 values are:
Using the reader:
When an "inf" is encountered, the data record is tossed and the next valid data record is put into the time position of the skipped "inf" data record. This will systematically shift the data for this column.
Of all the glider deployment data we have at this point, this is the only field where I encounter this issue.
Here is the python script to reproduce the issue:
dbd_test_3.py