Matlab/netcdf interface

I sent the list a message asking for a SAS/netcdf interface similar to the 
Matlab/netcdf interface.  I have not yet had a positive response to my 
request for a SAS interface, but I have had two people ask about the matlab 
interface.  I take no credit for the matlab interface;  I am only a 
satisfied user.  I responded personally to the people asking about the 
matlab interface, but the mail to Brad Beattie was undeliverable.  Since I 
do not know how to contact Brad and this may be of general interest to the 
list, I am posting the README file from the Matlab mexcdf distribution.

I am still hopeful some kind person out there will share their SAS/netcdf 
interface.

Phil Miller
philip.miller@xxxxxxxxxx

 --------------------------------------------

/pub/mexcdf/README
available via anonymous ftp from crusty.er.usgs.gov (128.128.19.19)


  MEXCDF is a mex-file interface between netCDF and MATLAB 3.5
  and 4.1 (for UNIX machines)
  that invokes the complete C-Language netCDF interface,
  as described in the NetCDF Users Guide.   This allows MATLAB
  users to read, write, and manipulate netCDF data files in an
  efficient manner.

  What you should do:

1. Get the mexcdf mex-file.

   If you have a SUN 4, DECstation, Mac, or 386PC running Matlab 3.5,
   you should be able to grab the appropriate mexcdf binary from

   /pub/mexcdf/bin/v35:
      mexcdf.mexds     DECstation  (works with Matlab version 3.5)
      mexcdf.mex4      Sun 4       (works with Matlab version 3.5)
      mexcdf.mex       Mac (macbinary) (works with Matlab version 3.5)
      mexcdf.sit.hqx   Mac (ASCII)     (works with Matlab version 3.5)
      mexcdf.mx3       IBM PC 386  (works with Matlab version 3.5, j or 
later)

   If you have a SUN 4, DECstation, or PC running MATLAB for WINDOWS,
   you should be able to grab the appropriate mexcdf binary from

   /pub/mexcdf/bin/v41:
      mexcdf.mexds     DECstation  (works with Matlab version 4.1)
      mexcdf.mex       IBM PC  (works with Matlab for Windows)
      mexcdf.mex4      Sun 4       (works with Matlab version 4.1)

   Use binary mode when you get these files, EXCEPT for
   mexcdf.sit.hqx, which should be transfered as ASCII.  mexcdf.sit.hqx
   should be un-binhexed using binhex4.0 or higher and then unstuffed
   using un-stuffit.


   NOTE: DON'T rename the mexcdf binary.  MATLAB expects MEX files to have
   platform-specific file extentions (mex4 on Sun4, mexds on DEC, etc.)

   Also get mexcdf.m, which describes the usage of mexcdf and
   will allow you to use "help mexcdf" from within matlab.

   If you need to compile the source code for mexcdf, grab
   the files in /pub/mexcdf/src.  Note that mexcdf.c must
   be compiled with an ANSI C compiler (e.g. gcc).

2. Get the usage of mexcdf by typing "mexcdf" in Matlab, or check
   out the file mexcdf.m.

3. mget everything in the /pub/mexcdf/tools directory (all the m-files
   and flux.dat) and check out
   some applications that use mexcdf.   Note to DOS-Users:
   Some of the m-files have file names that are longer than 8 characters,
   but they are all uniquely specified by the first 8 characters.  Thus
   the tools work fine under Matlab on the PC.

   The function getcdf.m is an interactive routine written by Jim Mansbridge
   that leads you through the extraction of data from netCDF files.

   The function mcvgt.m is a noninteractive routine that returns netCDF data
   when you already know the name of the variable you want and the
   indices of the data slab you wish to return.

   The function create_ts.m creates a netCDF time series file using file 
using
   NOAA PMEL's EPIC conventions.  This allows the created file to
   be interfaced directly to Don Denbo's PlotPlus program.

   The function getts.m gets time series data from netCDF files using
   EPIC conventions (e.g. files written by create_ts.m).  The user specifies 

   the variable and the start and stop time and is returned the data
   variable and a Julian time variable.

   The script cdf_demo.m demonstrates the use of create_ts.m and getts.m by
   creating a netcdf time series file of heat flux from Matlab, then
   reading selected data back into Matlab.

   The function read_gmt.m reads GMT style netCDF grid files (GMT is
   Paul Wessel and Walter Smith's freely available plotting and
   analysis package).

History of mexcdf: Chuck Denham (cdenham@xxxxxxxxxxxxxxxxxx)
  wrote the first netCDF/Matlab interface using m-files
  that called stand-alone C-programs to implement the interface.  For each
  netCDF operation, netCDF files were opened and closed, and netCDF data
  were written to matlab .mat files which were then "loaded" into Matlab.
  The result was useful, but inefficient.   To increase the efficiency,
  Jim Mansbridge of CSIRO (mansbrid@xxxxxxxxxxxxxxxxx) combined many 
operations
  into a single FORTRAN mex-file, called xnetcdf.f.  Realizing the utility
  of this method, Julie Allen of WHOI (jallen@xxxxxxxx) rewrote xnetcdf.f
  in C, implemented additional operations (including operations relating to
  creation of netCDF files from Matlab), and named the mexfile mexcdf.c.
  The mexcdf.c code was rewritten by Chuck Denham to allow more flexibility
  in the way the netCDF operations are invoked, and to streamline the code
  to work on Macintosh and IBM PCs.


EXAMPLE ftp session:
   ftp crusty.er.usgs.gov
   user anonymous
   cd pub/mexcdf/bin
   binary
   get mexcdf.mex4    (for sun4)
   ascii
   cd pub/mexcdf/tools
   mget *
   bye


  • 1994 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: