How to use the OPeNDAP / DODS Server in MATLAB.

The following explains the steps of loading data servered by OPeNDAP using MATLAB.

Select a dataset on a OPeNDAP server:

Get the URL by clicking on "info" for the dataset of your interest, say NLOM on the "Public data" server, which looks like this:

The OPeNDAP URL is near the top of the "info" page and looks like:

      DODS URL: http://apdrc.soest.hawaii.edu/dods/public_data/NLOM_32/nlom_ssh_32
      Authenticated: http://username:passwd@apdrc.soest.hawaii.edu/dods/public_data/NLOM_32/nlom_ssh_32

Download and install the MATLAB OPeNDAP Command Line tool (or Structs tool) client:

Load data using loaddods / loaddap (loaddap replaces loaddods on newer installations) and proceed as you normally would:

      x=loaddods( 'http://apdrc.soest.hawaii.edu/dods/public_data/NLOM_32/nlom_ssh_32?ssh[523:523][0:0][2880:3072][3618:3891]');
      Loads the NRL NLOM sea surface height for Oct 3, 2006, 165W-153W, 18N-24N. Note indices start from 0.

      help loaddods
      Information on how to use loaddods

      m=find(x<-1.0e33); x(m)=ones(size(m))+NaN;
      Fill missing data with NaN

      lat=18:1/32:24;
      lon=36:360/8192:395.9122; lon=lon(3618:3891)-360;
      contourf(lon,lat',x)
      colorbar
      Contour sea surface height

Instructions for IPRC "Theme" linux computers

      addpath /usr/local/share/loaddap
      addpath /usr/local/bin

      After starting Matlab (or add to Matlab startup), directories need to be added to the search path.

      whodap('http://apdrc.soest.hawaii.edu:80/dods/public_data/NLOM_32/nlom_sst_32')
      Returns grid information of dataset

      x=loaddap('http://apdrc.soest.hawaii.edu:80/dods/public_data/NLOM_32/nlom_sst_32?sst[852:852][0:0][2829:3554][3500:5000]')
      Puts the requested subset of data into structure x.

      sst=x.sst.sst;
      m=find(sst<-1.0e33); sst(m)=ones(size(m))+NaN;
      contourf(x.sst.lon,x.sst.lat',sst)
      Contour sea surface temperature

For more information visit the MATLAB/DODS handbook

  International Pacific Research Center (http://iprc.soest.hawaii.edu)