[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NETCDF-MATLAB interface



>From: Susan Mniszewski <address@hidden>
>Organization: LANL
>Keywords: 199402182319.AA14313

Sue,

>Is there NETCDF-MATLAB interface software? 

Here is what we know about the MATLAB interface (extracted from the 
utilities.txt file in the pub/netcdf directory of anonymous FTP on our
server, unidata.ucar.edu):

MATLAB interface:
 
    Researchers at the US Geological Survey in Woods Hole have developed
    an interface between Matlab and NetCDF called MEXCDF.
 
    MATLAB is a software package that integrates numerical analysis,
    matrix computation, signal processing and graphical display.
 
    MEXCDF is a interface between netCDF 2.0 and MATLAB 3.5
    that invokes the complete C language netCDF interface,
    as described in the NetCDF Users Guide.   This single MEX file
    allows MATLAB users to read, write, and manipulate netCDF data files
    in an efficient and compact manner without writing C or FORTRAN code.
 
    In addition, the interface has been enhanced in several ways:
 
    1.      Dimensions and variables accessible by number or name.
    2.      Attributes accessible by number or name.
    3.      Parameters accessible by number or name.
    4.      Prepended "nc" not necessary for operation names.
    5.      Prepended "NC_" not necessary for specifying parameters.
    6.      Parameter names not case-sensitive.
    7.      Required lengths default to actual lengths via -1.
    8.      AutoScaling via "scale_factor" and "add_offset" attributes.
 
    As an example, to read the following 2D array 'elev' in file 'foo.cdf',
 
          short elev(lat, lon)
         elev:scale_factor=100.
         elev:add_offset=0.,
 
    the required MATLAB commands using mexcdf are simply:
 
    mexcdf('open','foo.cdf','nowrite');
    elev=mexcdf('varget',cdfid,'elev',[0 0],[-1 -1]);
    mexcdf('close');
 
    The edges values "-1" means get all the values in this dimension,
    and scale_factor and add_offset are handled automagically by varget.
 
    For more information regarding this software, get the file
    /pub/mexcdf/README via anonymous ftp from crusty.er.usgs.gov
    (128.128.19.19) or contact Rich Signell at address@hidden.

We made this information available as an example of what people are doing
with the netCDF.  We did not develop this interface nor do we support it
here at Unidata.  Since you were having problems compiling the MATLAB
interface, I suggest you contact Rich Signell at his address listed above.
It could be that the problem(s) you were running into has something to do
with an incompatibility between the current release of the netCDF and the
MATLAB interface, but we have no way of knowing if this is, in fact, the
case.

Tom Yoksas