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

make dbdreader be compatible with RBR CTD? #23

Closed truedichotomy closed 6 months ago

truedichotomy commented 8 months ago

The code appears to only work with Seabird CTD for now as it looks for sci_ctd41cp_timestamp. Can the function be generalized so that it works with RBR CTD as well? Thanks.

smerckel commented 8 months ago

Thanks for the suggestion, @truedichotomy. I am happy to review a pull request :-), or alternatively, provide the functionality myself. In the latter case, I'd need additional information, as I don't have access to a data file with RBR CTD data in it. Could you provide one, including cache file?

truedichotomy commented 8 months ago

@smerckel, as I'm not an experienced python user, I'd be happy to provide the data files. Please find the attached link for the data files for a G3S glider with RBR CTD: SBD/TBD/DBD/EBD. Many thanks!!

smerckel commented 8 months ago

Thanks for those files. That is really helpful. Just to be sure: both the Seabird CTD and the RBR CTD output temperature and conductivity in sci_water_temp and sci_water_cond, respectively; the difference is the time stamp, which have different names for both CTDs. The only method affected is get_CTD_sync, which fails for the RBR CTD as it cannot find the parameter sci_ctd41cp_timestamp. That should be fairly easy to be fixed. The RBR provides also a number of parameters, not available for the Seabird CTD. I consider those for the user to extract them.

truedichotomy commented 8 months ago

I concur with your assessment of the issue. I'm happy to do more in-depth testing of dbdreader with the rest of my dataset once the updated dbdreader is released. Thanks again.

smerckel commented 8 months ago

@truedichotomy, the get_CTD_sync() method is now compatible with RBR CTD data, see the latest merged pull request. You can update your code (master branch) to version 0.5.5, or reinstall from pip, for now linux only. Windows binaries will be created shortly. It may be possible that the automatic CTD type detection mechanism fails when CTD data are from a RBR CTD, and the number of files is substantial (more than 20 or so). I don't have that many files available, so it would be appreciated if you can try the method on the data from a long term mission, both sbd/tbd and dbd/ebd data. Thanks.