Skip USGS links group
USGS - science for a changing world

Woods Hole Science Center

End of USGS links group
WHSC Home Research Technology Publications Data People Basis Summaries Location Contact Us

Sediment Transport Instrumentation Facility - Publications


This version is no longer supported!!!

MATLAB m-files for RDI ADCP data

ADCP Tools Version 3.0
containing RDI2CDF Version 2.0
By: Marinna Martini

ADCP Tools is a set of MATLAB m-files which convert RDI data to netCDF format, load the data into MATLAB, process and display the data. Beam to earth rotations can be computed if data was recorded in beam. Velocity, intensity, % good and correlation data as well as ancillary data such as temperature and sound speed are available on a beam by bin basis, and as a 3D plot.

Why not use RD Instruments' software?

RDI's software suite for processing and displaying ADCP data is terrific if you are doing work in real time or looking at profiles. For those of us using the ADCP for time series work, RDI is working on a windows based viewer. But many of us transfer the data to other software packages for plotting and 'massaging'. What I offer here is a method of transferring the data to and viewing it in MATLAB.

How do I get my data into MATLAB?

In this package is an m-file called rdi2cdf. It is a stand alone function which converts the RDI ADCP broadband or workhorse data format to netCDF. I will not go into the advantages of netCDF here, see for yourself at UNIDATA. Once in netCDF format, data can be ported into MATLAB wholly or in part, using the Mex-file gateway. Rdi2cdf uses to the Mex-file gateway to do the conversion. The NetCDF Toolbox makes useage of the Mex-file gateway more user friendly, and is required to view your data using my scripts.

I have included a listing of a typical ADCP netCDF file header which shows the detail of how ADCP data is stored in netCDF.

How do I view my data in MATLAB?

The m-file adcpmenu.m generates a pushbutton menu. Clicking on the menu buttons allows the user to load netCDF data, do beam to earth conversions, plot data in 2D or 3D and obtain basic statistics. Data are loaded into the main MATLAB workspace and can be further manipulated and displayed via the command line.
A typical work session may involve plotting all the data in two dimensions (which causes it to be loaded into the workspace), taking a quick look at the data, saving the main workspace to matlab.mat, then doing my own thing with the data from the command line prompt. If I change things irretrievably, or so that the variables are no longer compatible with adcpmenu, I can simply reload the workspace and get back to where I started.

The following are example images and plots to give you some idea of how data is displayed by adcpmenu.

  • The main pushbutton menu showing the basic operations available.
  • Plots of variable leader data (temperature and orientation)
  • Two dimensional plot of velocity. The controls at the top of the plot allow the user to display any bin or any beam by ensemble in the axes without rendering a new plot window.
  • Three dimensional color plot of intensity

Prerequisites:

Gory details:

  • View the readme file right now.
  • View the most significant m-files from here.
  • Read the FAQ.

Caveats:

  • Although I know some UNIX, I use PC's almost exclusively. These m-files have been written for MATLAB for windows and I have no means (nor time!) to test them on a UNIX box. The only known problems so far has been byte order inconsistencies involved with my example raw data file. I suggest that UNIX users should supply their own ADCP data or try downloading the unzipped version of the example data file directly here.
  • These files are tailored to our studies here at the Woods Hole Center. As I receive feed back (and find the time) I will add more features, streamline code, improve documentation, etc., but please bear with me, the maintenance of this code is not my primary job function here at USGS.

Before downloading:

Download the ZIP archive which contains all the m-files and example data. In Netscape, click the right mouse button on the link and choose 'save link as...'

Contributions from others:

Rodolphe Rousselet (rous@shom.fr) of EPSHOM - France has contributed a patch that should eliminate fread problems on Sun workstations, download my_fread.m, a new version of fread.m.

ENJOY!


Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USAGov logo U.S. Department of the Interior | U.S. Geological Survey
End of USGS links group
URL: woodshole.er.usgs.gov/operations/stg/pubs/ADCPtools/adcptool30/index30.htm
Page Contact Information: WHSC Webmaster
Page Last Modified: Tuesday, 16-Oct-2007 09:36:49 EDT