Skip to main content

PyPI version Docs badge License

DBDREADER

Synopsis

Slocum ocean gliders are autonomous underwater vehicles, used for making oceanographic measurements. The data that these devices and their sensors collect, are stored in binary data files. The python module dbdreader provides the utilities to extract the data from the binary files, so that they can be further analysed.

Change log

Version 0.6.2

  • Builds wheels for python versions 3.10 -- 3.14, including macos
  • Removes the get_list() method from the DBD class
  • Adds CI tests for all platforms (contributed by jklymak).
  • Typehinting introduced

Version 0.6.1

  • Drops dependency on scipy.

Version 0.6.0

  • Offers a python-only implementation, alongside the C-extension to read the binary files. At the expense of processing speed, no compiler is required to use this package. Python-only code contributed by jklymak.

  • A github workflow is implemented that generates pre-compiled wheels for linux and windows platforms for python version 3.10, 3.11, 3.12 and 3.13.

  • Some speed improvements of the C-extenstion

version 0.5.9

  • Handles reading errors that can occur when a compressed file turns out to be corrupted.

version 0.5.8

  • Changes default location for cache files on linux from $HOME/.dbdreader to $HOME/.local/share/dbdreader

  • Introduces new class DBDCache to manage the location where cache files are looked up. Constructing an object with an arguments (re-)sets a default path, avoiding the need to use the keyword cacheDir when creating objects of DBD and MultiDBD classes.

  • Fixes an issue with MultiDBD when a parameter is requested that is not present in all files, but in at least one. The get() method returns just those data that are present. In case of get_sync and friends, data are interpolated if possible, or padded with nans.

Version 0.5.7

  • Drops dependency on python 3.10+, introduced in 0.5.6, and should work still with python 3.9.

Version 0.5.6

  • Moves data directory under dbdreader, making these files accessible after an pip install

Version 0.5.5

  • Makes MultiDBD's get_CTD_sync method compatible with RBR CTD data.

Version 0.5.4

  • Adds support for reading compressed data files for windows platform.
  • Improved building environment

Version 0.5.1

  • Adds support for reading compressed data files
  • dbdrename now accepts -x and -X options to rename compressed data files as uncompressed data files

Version 0.4.15

  • Modifies sorting key algorithm to the DBDList class. This fixes a bug when glider data filenames are composed of a glider name that contains a dash. For example, filenames such as hereon-amadeus-2019-3-1.sbd would fail, but are valid now.

Version 0.4.14

  • Adds a new option to the get() method of the MultiDBD class, where if the keyword include_sources=True, for each parameter an additional list is returned that has for each data point a reference to the DBD instance that produced the data point. This allows to query the source of a specific data point.

    This merges the (modified) pull request #14 by MCazaly.

Version 0.4.13

  • Modifies behaviour when the user requests a parameter that has no data. If the requested parameter is not a valid glider sensor name, assume a user-error and raise an exception, otherwise return an empty array.

    This behaviour fixes a bug for MultiDBD: each file opened with MultiDBD would fail to produce any data if one or more parameters that are asked for, are not present in the file.

    New behaviour returns data for the exisiting parameters (only); empty array for the missing parameters (or nans if return_nans=True)

    Concludes pull request #16 by jklymak.

Version 0.4.12

  • PatternSelect now accepts the option of a non-standard cache directory. Thanks to hawesie.

  • MultiDBD's get_sync() now returns nan's for those parameters for which no data exist, provided that at least one of the requested parameters contains data.

Version 0.4.11

  • Version 0.4.9 introduced a bug that in some rare circumstances caused segmentation faults. This has been fixed.

  • Merged pull request by roje-bodc with improved error handling in case of missing cache files. If a DbdError occurs due to a missing cache file, detailed information can be obtained from the .data property of the exception instance.

Version 0.4.10

  • Includes pull request by jklymak, which allows dbdreader to deal with empty files, and files capitalised file extensions, as well as a check on the encoding version.

  • Includes a bug fix when raising an exception when handling a prior exception in case of reading problematic files.

  • Assumes that if the first parameter given to MultiDBD is a string, the user did not mean to provide a list of filename strings, but a pattern. An error is raised if pattern is specified explicitly when filenames is given as a string.

Version 0.4.9

  • Bug fix for handling inf values correctly (issue #8). Thanks to jr3cermak for spotting this bug.
  • Bug fix for incorrect behaviour when reading the time parameter explicitly for example xxx.get("m_present_time").

Version 0.4.8

  • Support for reading {demnst}bd files from G3S gliders (issue #6). (Thanks to Owain Jones)

  • Bug fix for correctly throwing an exception when cache file is missing(issue #5)

Version 0.4.7

  • Bug fix for reading dbd files on Windows.

  • a wheel provided for CPython 3.9 on Windows 64 bit.

Version 0.4.6

  • Added get_CTD_sync, a convenience method to retrieve CTD data, and other parameters mapped on the CTD time stamps. Also ensures time stamps are monotonically increasing.

  • Adds bounds to what values of latitude and longitude are considered valid.

Version 0.4.5

  • dbdreader now ignores the first line of data in each binary file

  • dbdreader checks whether the value of the parameters read are finite, ignoring them if they are not.

Installation (linux)

The python module dbdreader can be installed from source, using the standard method to install python code. Note that this method requires an C-extension to be build. (The actual reading from files is done in C for speed.) In order to build the extension successfully, you would need a C-compiler. On Linux, this can be gcc, with supporting development/header files for python. On Fedora you would do sudo dnf install python3-devel, or sudo apt-get install python3-dev on Ubuntu.

Furthermore, as of version 0.5, which adds support for reading compressed files, a dependency on the lz4 library is introduced. If available, the system-wide library will be used (recommended approach). Alternatively, the lz4.[ch] files from the original source (https://github.com/lz4/lz4), and included in this package, will be compiled into the C-extension. To install the system-wide lz4 library on Fedora you would do sudo dnf install lz4-devel lz4-libs. On Ubuntu this can be achieved by sudo apt-get install liblz4-dev liblz4-1.

Alternatively, dbdreader can also be installed from PyPi, using pip3 install dbdreader.

Installation on Windows

If you want to install dbdreader from source, you will need a C compiler as well to compile the C-extension. Besides the Python environment you will need to install the Microsoft Visual Studio Compiler. The community edition will do. When installing MVSC, make sure you tick the box python development during the setup. Once installed dbdreader can be installed, and the C-extension should be compiled automatically.

Installiation using pip, for example as in py -m pip install dbdreader also requires the C compiler. For Python version 3.9, however, a wheel is provided, which can be installed adding the option --only-binary :all: to the pip command:

$ pip install --only-binary :all: dbdreader

Documentation

Comprehensive documentation is provided at https://dbdreader.readthedocs.io/en/latest/

Quick-start

For the impatient...

The dbdreader module implements a class DBD() which provides the machinery to read a single dbd file. The most commonly used methods are:

  • get(parametername)
  • get_sync(parametername, *other_parameternames)

The first method returs a tuple with time and values for requested parameter. The second method, returns a tuple with time and values of the first parameter requested, and of all further listed parameters, all interpolated on the time base of the first parameter.

Mostly, it is not one file that is required to be processed, but a number of them. This interface is implemented by the MultiDBD class. Files can either be specified as a list of filenames, or as a pattern using wildcards.

Examples

To read a single file:

>>> dbd = DBD("00010010.dbd")
>>> t, pitch = dbd.get("m_pitch")
>>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")

Or, doing the same, but using both dbd and ebd files:

>>> dbd = DBD(pattern="00010010.[de]bd")
>>> t, pitch = dbd.get("m_pitch")
>>> t, hdg, ptch, roll = dbd.get_sync("m_heading", "m_pitch", "m_roll")
>>> t, p_ctd, p_nav = dbd.get_sync("sci_water_pressure", "m_water_pressure")

Python 2

Python 2.7 is not supported anymore. However, you should be able to make the code able to run on python2.7 using the future package.

  • pip install future
  • pasteurize dbdreader.

For details see http://python-future.org/pasteurize.html.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbdreader-0.6.3.tar.gz (2.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dbdreader-0.6.3-cp313-cp313-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.13Windows x86-64

dbdreader-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

dbdreader-0.6.3-cp313-cp313-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

dbdreader-0.6.3-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

dbdreader-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

dbdreader-0.6.3-cp312-cp312-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dbdreader-0.6.3-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

dbdreader-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

dbdreader-0.6.3-cp311-cp311-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dbdreader-0.6.3-cp310-cp310-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86-64

dbdreader-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dbdreader-0.6.3-cp310-cp310-macosx_11_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file dbdreader-0.6.3.tar.gz.

File metadata

  • Download URL: dbdreader-0.6.3.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbdreader-0.6.3.tar.gz
Algorithm Hash digest
SHA256 3b5a42601d8ce78f60f8a1497e4ffeef41f1d1b9260998b2f3c6df577b9ab3d5
MD5 6ed00143b3c621aea7a81d518166e389
BLAKE2b-256 95f7a7fecfa27af43f3a43812c86f5810e6d4ae18b3f76634b1b0fbf6ca524cb

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: dbdreader-0.6.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbdreader-0.6.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2c5d44fea4b8afddc3cd78df3a8c9f19d09920083863b5432b38ae5714349398
MD5 876e111fce96a37a258f46a7deaf08a7
BLAKE2b-256 d5b147475f2d82ea4410448e32d42781bf212d2160165896e7885ce03ac69e20

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4b841112e0d3036d0c4306fb8525e79e2ce073384b8633c82affdf3e9cbfcb9d
MD5 3cb70334f40675def3bf4b1e021869c7
BLAKE2b-256 342f65cb6ec318ed327e9e05d0c50f3dffa2ed0e11ff7cb9084022deae316f0c

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8204fa73f6a772f5ed4418fe6fff50ca9932ff8fc109837a998c1c63fb64878
MD5 085fcfba0666198c504c837f965cfced
BLAKE2b-256 8332f4e441405d399f26f1ca402ec65431da23a07f7dc39e6b761b1111933ef6

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: dbdreader-0.6.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbdreader-0.6.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 58017bdb9bcf34041667f7a6604d71325e2e59f5c28ffe34ac7ff998ccc74d42
MD5 78d853e8a47d3812af3e7abc808c38aa
BLAKE2b-256 a799d8342c8cd24ab27df85a414a09699c25d1f9f468760855c6d9e2e2609e5c

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e086e0c9e14a67f0d83a5e8f9841245283d7759b9cb0c95b0ede2ac7a367a8d4
MD5 2a890393d01f7898e47d62022b7e5e0d
BLAKE2b-256 c72794bbe8b44c97d8e9c29ec6fdba8807f5c78b84966efdc0f3a8fc7bc05eb3

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a8371ce0cec7c2feb0bcd72baf74d96a4c305be63ba4a816480f9907c7cea019
MD5 53d11cfde405ed09b5922ec65597f3a0
BLAKE2b-256 d0b42826299e92b58a38042d7779280501e1f275331c5ed368d077f2e7daae34

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dbdreader-0.6.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbdreader-0.6.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e3e5af5debb69a89856b755c06d070840024e0ffe4a0193953b5af26cd5416a0
MD5 c36514bfaa96b5b605a42052cb7f5b44
BLAKE2b-256 35eb6b12bcb6fa6c5e170595939c78b1a71896924be4c0f4e4f42770925a7aa7

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1817c3b5b326488a9d39cf6812d14122509211343c9f8fb5f59c7f9c63a5f33a
MD5 bc511f070cdd8875f020f7baeabea46f
BLAKE2b-256 2c784c965d73c15a5bddb2396bd359203e7ba082cce15ae0fcc0fd0088749627

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d6e33aa238382f4d992af0a68a743b369d1d18dce123ea8ca2b74c2630964dc
MD5 fd0dad764c57d17419a8c80c4ce34d6d
BLAKE2b-256 ec4b1d48ee6de1c681b42ea58e1a9826f40b851ead0811a3e23b53e6a8c6070b

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: dbdreader-0.6.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbdreader-0.6.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e594d94fcda86794f4dffceaba1ff71464b2391da012425233098e9c469bc4a7
MD5 823683e3e5951deca2eafd36a91aced6
BLAKE2b-256 21523356383191fcfe3736e9c2b287143e63084f2c9f817f358f9cb3f594cf6c

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 023eca77d269cdc2ff8c4b62e3e2d7ed665f157803712223cbacc94d4198a5d0
MD5 62df6fbc6e6f870e3872149ab4775099
BLAKE2b-256 de0ba4e609c13a0921afcfc27d15440285168bd06ea39c5c7b618fcc26abc73e

See more details on using hashes here.

File details

Details for the file dbdreader-0.6.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dbdreader-0.6.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 89d193a5653fd84d20bd43139b31e07383f0c2b2585f3bc01d105a49788ea971
MD5 aba9cdc25c5ebc1043ef238e49691412
BLAKE2b-256 4bf17c5217b4c6ca2b16cab67acb9b44ac355e934fec5439d1f74a7b70846a35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page