Usage

DOLfYN is a library of tools for reading, processing, and analyzing data from oceanographic velocity measurement instruments such as acoustic Doppler velocimeters (ADVs) and acoustic Doppler profilers (ADPs). DOLfYN is organized into subpackages for working with each data type it supports, as well as base packages

This page documents general and basic usage of the DOLfYN package, for detailed information on more specific uses of the package see the [usage-specific] page.

Working with ADV data

Acoustic Doppler velocimeters (ADVs) make measurements of velocity at a point in space (e.g. the Sontek Argonaut-ADV, and the Nortek Vector).

Reading ADV data

Currently DOLfYN supports reading of binary Nortek Vector, .vec, files. Assuming you are working from an interactive prompt, you can read a Vector file like this:

>>> from dolfyn.adv import api as adv
>>> dat = adv.read_nortek(<path/to/my_vector_file.vec>)

This returns a ADVraw object, which contains the data loaded from the file:

>>> dat.u
array([-0.92200005, -0.87800002, -0.85400003, ..., -0.88900006,
       -0.85600007, -0.98100007], dtype=float32)

>>> dat.mpltime
time_array([ 734666.50003103,  734666.50003139,  734666.50003175, ...,
        734666.50973251,  734666.50973287,  734666.50973323])

Working with ADV data

DOLfYN has several tools for performing useful and common operations on ADV data. Most of these are available via the ADV api. For example:

# To use this module, import it:
from dolfyn.adv import api as adv

# Then read a file containing adv data:
dat = adv.read_nortek('../../../data/vector_data01.VEC')

# Then clean the file using the Goring+Nikora method:
adv.clean.GN2002(dat)

# Then rotate that data from the instrument to earth frame:
adv.rotate.inst2earth(dat)

# Then rotate it into a 'principal axes frame':
adv.rotate.earth2principal(dat)

# Define an averaging object, and create an 'averaged' data set:
binner = adv.TurbBinner(n_bin=40000, fs=dat.fs, n_fft=4096)
dat_bin = binner(dat)

# At any point you can save the data:
dat_bin.save('adv_data_rotated2principal.h5')

# And reload the data:
dat_bin_copy = adv.load('adv_data_rotated2principal.h5')