~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to raster/r.in.mat/description.html

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<h2>DESCRIPTION</h2>
2
 
 
3
 
<em>r.in.mat</em> will import a GRASS raster map from a Version 4 MAT-File 
4
 
which was created with Matlab or Octave.
5
 
Attributes such as map title and bounds will also be imported if they exist.
6
 
<br>
7
 
<br>
8
 
Specifically, the following array variables will be read:<br>
9
 
<ul>
10
 
  <li><b> map_data</b>
11
 
  <li><b> map_name</b>
12
 
  <li><b> map_title</b>
13
 
  <li><b> map_northern_edge</b>
14
 
  <li><b> map_southern_edge</b>
15
 
  <li><b> map_eastern_edge</b>
16
 
  <li><b> map_western_edge</b>
17
 
</ul>
18
 
 
19
 
Any other variables in the MAT-file will be simply skipped over.<br>
20
 
<br>
21
 
The '<b>map_name</b>' variable is optional, if it exists, and is valid, the 
22
 
new map will be thus named. If it doesn't exist or a name is specified with
23
 
the <b>output=</b> option, the raster map's name will be set to 
24
 
"<tt>MatFile</tt>" or the name specified respectively.
25
 
(maximum 64 characters; normal GRASS naming rules apply)
26
 
<br>
27
 
<br>
28
 
The '<b>map_title</b>' variable is optional, the map's title is set if it 
29
 
exists.
30
 
<br>
31
 
<br>
32
 
The '<b>map_northern_edge</b>' and like variables are mandatory unless the 
33
 
user is importing to a "XY" non-georeferenced location
34
 
(e.g. imagery data). Latitude and longitude values should be in decimal form.
35
 
 
36
 
 
37
 
<h2>NOTES</h2>
38
 
 
39
 
<em>r.in.mat</em> imports a Version 4 MAT-File. These files can be 
40
 
successfully created with more modern versions of Matlab and Octave
41
 
(see "EXAMPLES" below).<br><br>
42
 
 
43
 
Everything should be Endian safe, so the file to be imported can be simply 
44
 
copied between different system architectures without binary translation
45
 
(caveat: see "TODO" below).<br><br>
46
 
 
47
 
As there is no IEEE value for <tt>NaN</tt> in integer arrays, GRASS's null 
48
 
value may be used to represent it within these maps. Usually Matlab will save 
49
 
any integer based matrix with <tt>NaN</tt> values as a double-precision 
50
 
floating point array, so this usually isn't an issue. To save space, once the 
51
 
map is loaded into GRASS you can convert it back to an integer map with the 
52
 
following command:
53
 
<div class="code"><pre>
54
 
r.mapcalc int_map="int(MATFile_map)"
55
 
</pre></div>
56
 
 
57
 
<tt>NaN</tt> values in either floating point or double-precision floating point
58
 
matrices should translate into null values as expected.<br><br>
59
 
 
60
 
 
61
 
<em>r.in.mat</em> must load the entire map array into memory before writing,
62
 
therefore it might have problems with <i>huge</i> arrays.
63
 
(a 3000x4000 DCELL map uses about 100mb RAM)<br><br>
64
 
 
65
 
GRASS defines its map bounds at the outer-edge of the bounding cells, not at
66
 
the coordinates of their centroids. Thus, the following Matlab commands may 
67
 
be used to determine and check the map's resolution information will be correct:
68
 
<div class="code"><pre>
69
 
    [rows cols] = size(map_data)
70
 
    x_range = map_eastern_edge - map_western_edge
71
 
    y_range = map_northern_edge - map_southern_edge
72
 
    ns_res = y_range/rows
73
 
    ew_res = x_range/cols
74
 
</pre></div>
75
 
 
76
 
<br>
77
 
Remember Matlab arrays are referenced as <tt>(row,column)</tt>,
78
 
i.e. <tt>(y,x)</tt>.
79
 
<br><br>
80
 
In addition, <em>r.in.mat</em> and <em>r.out.mat</em> make for a nice 
81
 
binary container format for transferring georeferenced maps around, 
82
 
even if you don't use Matlab or Octave. 
83
 
 
84
 
<h2>EXAMPLES</h2>
85
 
 
86
 
In Matlab, save with:
87
 
<div class="code"><pre>
88
 
save filename.mat map_* -v4
89
 
</pre></div>
90
 
 
91
 
In Octave, save with:
92
 
<div class="code"><pre>
93
 
save -mat4-binary filename.mat map_*
94
 
</pre></div>
95
 
 
96
 
<br>
97
 
 
98
 
<h2>TODO</h2>
99
 
 
100
 
Robust support for mixed-Endian importation.
101
 
<i>(This is a work in progress, please help by reporting any failures to the
102
 
<a href="http://trac.osgeo.org/grass/">
103
 
GRASS bug tracking system</a></i>; you will need to login with an OSGeo Userid)
104
 
<br>
105
 
Add support for importing map history, category information, color map, etc.
106
 
if they exist.
107
 
<br>
108
 
Option to import a version 5 MAT-File, with map and support information 
109
 
stored in a single structured array.
110
 
 
111
 
<h2>BUGS</h2>
112
 
 
113
 
If you encounter any problems, please contact the GRASS Development Team.
114
 
 
115
 
<h2>SEE ALSO</h2>
116
 
 
117
 
<i>
118
 
<a href="r.out.mat.html">r.out.mat</a>,
119
 
<a href="r.in.ascii.html">r.in.ascii</a>, 
120
 
<a href="r.in.bin.html">r.in.bin</a>,
121
 
<a href="r.mapcalc.html">r.mapcalc</a>,
122
 
<a href="r.null.html">r.null</a>.<p>
123
 
The <a href="http://www.octave.org">Octave</a> project
124
 
</i>
125
 
 
126
 
 
127
 
<h2>AUTHOR</h2>
128
 
 
129
 
Hamish Bowman<br> <i>
130
 
Department of Marine Science<br>
131
 
University of Otago<br>
132
 
New Zealand</i><br>
133
 
 
134
 
<br>
135
 
<p><i>Last changed: $Date: 2008-05-21 15:04:10 +0200 (Wed, 21 May 2008) $</i>