How to use OPeNDAP

From GHER

Jump to: navigation, search

OPeNDAP is a software allowing simple access to remote data. With suitable client software, one can access to remote data distributed through OPeNDAP as easily as data stored locally.

Contents

Client Software

Octave

Use Octave-netcdf compiled with a NetCDF library with OPeNDAP-support.

Matlab

Matlab Structs Tool

The Matlab Structs Tool is available at http://opendap.org/matlab-loaddap

Installation instructions for Linux:

 1/ install libdap, usually a package is readily available. Example for debian: as root, type 
    "apt-get install libdap-dev libdap10 libdap-bin libdap10" . 
    Alternatively, download source tarball, untar it, run "configure", make, make install
 2/ install loaddap: 
   * download from the URL above
   * tar xzvf loaddap-3.X.X.tar.gz
   * cd loaddap-3.X.X
   * configure --with-matlab=/some/path/to/Matlab/R2011a
     if configure fails at matlab version checking, edit conf/matlabver.m4 around line 78 and see if matlab version is in format X.X or XX.X (e.g. add another test for a version format X.XX)
   * make
   * make install (need to be root to install in /usr/... , alternatively use above "configure --prefix=/path/to/install/to" )
 3/ to load remote databases, or parts of them, in matlab:
   * add loaddap to matlab path, 
   * load some remote files, e.g. for HYCOM global forecasts, run in matlab:
    temp=loaddap('http://tds.hycom.org/thredds/dodsC/GLBa0.08/expt_90.9?temp[1:10][1][1][1]');

OpenDAP syntax details are available on http://opendap.org

BE CAREFUL WHAT YOU DO, YOU ARE LOADING REMOTE DATABASES!

MEXNC with OPeNDAP support
instructions are available at http://mexcdf.sourceforge.net/opendap/index.html. If this approach is followed, the octave example code can also be used with the matlab netCDF toolbox.

Fortran

Any Fortran program that can read netCDF files (e.g. ustat, and friends) can use OPeNDAP if it is linked with the netcdf4 library, which itself needs to be compiled with curl support. Hence, install libcurl (package or manually) along with hdf5, zlib (and optional szlib) BEFORE you configure/make/install the netcdf4 library. After installing, use "nc-config --all" and check that DAP support is properly installed.

Regarding ustat and friends (i.e. all programs using ufileformat, including the GHER model, the assimilation kit etc): ufileformat.F90 needs to be modified, as current syntax is only valid for local netcdf files

e.g. : ustat somenetcdffile.nc.gz#temperature

Ufileformat detects the hash (#), identifies a netcdf file, and loads it accordingly Everything following the hash is used as the variable name (and matrix restrictions)

Work in progress: replacing # with "?" , and generalize netcdf support to opendap support,

e.g. : ustat "http://tds.hycom.org/thredds/dodsC/GLBa0.08/expt_90.9?temperature[1:10][1][1][1]"

Data distributed by OPeNDAP

List of other links:

Useful links

Personal tools