[netcdf-java] Matlab .mat file IOSP

I am currently working on a general-purpose IOSP for Matlab files, based upon 
the JMatIO package (http://sourceforge.net/projects/jmatio/) which can handle 
Matlab file version 5 files rather well.  With some modifications JMatIO can 
handle Matlab file version 4 as well. 

 

Currently, the approach for mapping between Matlab and the CDM is:

 

Represent all 1xN char arrays as global attributes

Represent other 1x1 arrays as global attributes
Represent all other Matlab arrays as ucar.ma2.Array.

Most numerical types map directly, except:

   UINT8 maps to SHORT

   UINT16 maps to INT

   UINT32 maps to LONG

   UINT64 maps to LONG (may cause overflow).

Matlab Structures map to ucar.nc2.Structure

Matlab Cell arrays are handled in one of three ways:

-          If all the data is the same type, it is represented as a regular 
ucar.ma2.Array.

-          If all the data is identical within each column of the array, it is 
represented as a ucar.nc2.Structure with a member corresponding to each column 
named "[name]_[col#]".

-          Otherwise the cell array is represented as a ucar.nc2.Structure, 
where each cell is named "[name]_[row#]_[col#]" for MxN cell arrays, 
"[name]_[row#]" for Mx1 cell arrays, or "[name]_[col#]" for 1xN cell arrays.

 

Open questions:

Is anyone else interested in a general purpose Matlab IOSP?

Does my approach make sense?

How to represent imaginary components of arrays?  Perhaps represent as a 2nd 
matrix with a prefix like "_i_" or a suffix such as "_imag"?

Is there a better way to name the members of Structures that result from 
handling Matlab Cell arrays?

This will need ongoing effort.  Is there a "best" place to host IOSP 
development projects (SourceForge, Google Code, etc?)

 

Thanks , Mike

 

_____________________________________________

Michael A. Godin

Software Engineer

Monterey Bay Aquarium Research Institute

Phone: 831-775-2063  http://www.mbari.org <http://www.mbari.org> 

 

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