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

Adds year to filename sorting #27

Closed cassandra-elmer closed 2 months ago

cassandra-elmer commented 2 months ago

When using MultiDBD, files were being read in order:

This made for problems with MultiDBD.get_sync, as the times weren't monotonically increasing, so interpolation failed and every field returned nan. Adding the year to the regex and sort key fixed the problem.

smerckel commented 2 months ago

@cassandra-elmer: thank you for the patch. In fact I made a test in dbdreader_test.py (test_sorting()) that sucessfully sorted the filenames, also for files with different years. When constructing my test filenames, I accidentally omitted the day of year the mission started, so the test never failed. Thanks for spotting this! I also update the test_sorting() function.