[GRASS5] new module: r.in.mat

Hamish hamish_nospam at yahoo.com
Mon Mar 29 10:19:28 EST 2004


Hi,

I've just added a new module named r.in.mat for importing maps from
Matlab or Octave. This is the companion module to r.out.mat which I
added last week. Most of the caveats there apply here as well.

see  http://grass.itc.it/pipermail/grass5/2004-March/013937.html
[Correction from that email: use imagesc(map_data) not image(map_data)]



Here's the help & header comments:


Description:
 Import a binary MAT-File(v4) to a GRASS raster.

Usage:
 r.in.mat [-v] input=name [output=name]

Flags:
  -v   Verbose mode

Parameters:
   input   Name of an existing MAT-File(v4)
  output   Name for the output raster map (override)

/*
 *  FILE MUST CONTAIN THE FOLLOWING MATRIX :
 *    map_data     with the map data
 *
 *  AND OPTIONALLY :
 *    map_name     name for new map (max 64 chars, normal rules apply)
 *    map_title    contains map title (max 40 chars)
 *
 *  THESE MUST BE PRESENT UNLESS USING THE "XY" PROJECTION :
 *    map_northern_edge
 *    map_southern_edge    in decimal form (ie not DDD:MM:SS)
 *    map_eastern_edge
 *    map_western_edge
 *
 *  ALL OTHER MATRICES WILL BE PASSED OVER. (cleanly, I hope)
 *
 *   tip: Save a version 4 MAT-File with the command:
 *         "save filename.mat map_* -v4"
 */


The program works for me, but testing would be nice esp. on something
big endian or 64bit.

The speed & ease of matrix algebra in Matlab is pretty extraordinary,
& these two modules make for quick & easy GRASS->Matlab->GRASS trips.

In addition, it makes for a nice binary container format for
transferring maps around that other free software can read, even if 
you don't use Matlab or Octave. 


Shall I add these to 5.7?



enjoy,
Hamish




More information about the grass-dev mailing list