<div dir="ltr">Ok, I put the file (r.colors.sttdev) on C:\GRASS\scripts.<br><br>On the output windowm, if I enter with r.colors.sttdev and Run, seems GRASS recognize the command. But how in the syntax to inform the input and other parametres?<br>
<br>Can I found this in the code?<br><br>1&nbsp;&nbsp;&nbsp;&nbsp; #!/bin/sh<br>2 &nbsp;&nbsp;&nbsp; ############################################################################<br>3 &nbsp;&nbsp;&nbsp; #<br>4 &nbsp;&nbsp;&nbsp; # MODULE:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r.colors.stddev<br>5 &nbsp;&nbsp;&nbsp; # AUTHOR:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; M. Hamish Bowman, Dept. Marine Science, Otago Univeristy,<br>
6 &nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; New Zealand<br>7 &nbsp;&nbsp;&nbsp; # PURPOSE:&nbsp;&nbsp;&nbsp;&nbsp; <br>8 &nbsp;&nbsp;&nbsp; #<br>9 &nbsp;&nbsp;&nbsp; # COPYRIGHT:&nbsp;&nbsp;&nbsp; (c) 2007 Hamish Bowman, and the GRASS Development Team<br>10 &nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This program is free software under the GNU General Public<br>
11 &nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; License (&gt;=v2). Read the file COPYING that comes with GRASS<br>12 &nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for details.<br>13 &nbsp;&nbsp;&nbsp; #<br>14 &nbsp;&nbsp;&nbsp; #############################################################################<br>
15 &nbsp;&nbsp;&nbsp; <br>16 &nbsp;&nbsp;&nbsp; #%Module<br>17 &nbsp;&nbsp;&nbsp; #% description: Set color rules based on stddev from a map&#39;s mean value.<br>18 &nbsp;&nbsp;&nbsp; #% keywords: raster<br>19 &nbsp;&nbsp;&nbsp; #%End<br>20 &nbsp;&nbsp;&nbsp; #% option<br>21 &nbsp;&nbsp;&nbsp; #% key: input<br>22 &nbsp;&nbsp;&nbsp; #% type: string<br>
23 &nbsp;&nbsp;&nbsp; #% gisprompt: old,cell,raster<br>24 &nbsp;&nbsp;&nbsp; #% key_desc: name<br>25 &nbsp;&nbsp;&nbsp; #% description: Name of input raster map<br>26 &nbsp;&nbsp;&nbsp; #% required: yes<br>27 &nbsp;&nbsp;&nbsp; #%end<br>28 &nbsp;&nbsp;&nbsp; #%flag<br>29 &nbsp;&nbsp;&nbsp; #% key: b<br>30 &nbsp;&nbsp;&nbsp; #% description: Color using standard deviation bands<br>
31 &nbsp;&nbsp;&nbsp; #%end<br>32 &nbsp;&nbsp;&nbsp; #%flag<br>33 &nbsp;&nbsp;&nbsp; #% key: z<br>34 &nbsp;&nbsp;&nbsp; #% description: Force center at zero<br>35 &nbsp;&nbsp;&nbsp; #%end<br>36 &nbsp;&nbsp;&nbsp; <br>37 &nbsp;&nbsp;&nbsp; <br>38 &nbsp;&nbsp;&nbsp; if&nbsp; [ -z &quot;$GISBASE&quot; ] ; then<br>39 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;You must be in GRASS GIS to run this program.&quot; 1&gt;&amp;2<br>
40 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit 1<br>41 &nbsp;&nbsp;&nbsp; fi<br>42 &nbsp;&nbsp;&nbsp; <br>43 &nbsp;&nbsp;&nbsp; if [ &quot;$1&quot; != &quot;@ARGS_PARSED@&quot; ] ; then<br>44 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exec g.parser &quot;$0&quot; &quot;$@&quot;<br>45 &nbsp;&nbsp;&nbsp; fi<br>46 &nbsp;&nbsp;&nbsp; <br>47 &nbsp;&nbsp;&nbsp; <br>48 &nbsp;&nbsp;&nbsp; eval `r.univar -g &quot;$GIS_OPT_INPUT&quot;`<br>
49 &nbsp;&nbsp;&nbsp; # $? is result of the eval not r.univar (???)<br>50 &nbsp;&nbsp;&nbsp; #if [ $? -ne 0 ] ; then<br>51 &nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; echo &quot;ERROR: Problem running r.univar&quot; 1&gt;&amp;2<br>52 &nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; exit 1<br>53 &nbsp;&nbsp;&nbsp; #fi<br>54 &nbsp;&nbsp;&nbsp; <br>55 &nbsp;&nbsp;&nbsp; <br>
56 &nbsp;&nbsp;&nbsp; if [ $GIS_FLAG_Z -eq 0 ] ; then<br>57 &nbsp;&nbsp;&nbsp; <br>58 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; MEAN_MINUS_2STDEV=`echo &quot;$mean $stddev&quot; | awk &#39;{print $1 - 2*$2}&#39;`<br>59 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; MEAN_PLUS_2STDEV=`echo &quot;$mean $stddev&quot; | awk &#39;{print $1 + 2*$2}&#39;`<br>
60 &nbsp;&nbsp;&nbsp; <br>61 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; if [ $GIS_FLAG_B -eq 0 ] ; then<br>62 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # smooth free floating blue/white/red<br>63 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; r.colors &quot;$GIS_OPT_INPUT&quot; color=rules &lt;&lt; EOF<br>64 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0% blue<br>65 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_2STDEV blue<br>
66 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $mean white<br>67 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_2STDEV red<br>68 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100% red<br>69 &nbsp;&nbsp;&nbsp; EOF<br>70 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; else<br>71 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # banded free floating&nbsp; black/red/yellow/green/yellow/red/black<br>72 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MEAN_MINUS_1STDEV=`echo &quot;$mean $stddev&quot; | awk &#39;{print $1 - $2}&#39;`<br>
73 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MEAN_MINUS_3STDEV=`echo &quot;$mean $stddev&quot; | awk &#39;{print $1 - 3*$2}&#39;`<br>74 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MEAN_PLUS_1STDEV=`echo &quot;$mean $stddev&quot; | awk &#39;{print $1 + $2}&#39;`<br>75 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; MEAN_PLUS_3STDEV=`echo &quot;$mean $stddev&quot; | awk &#39;{print $1 + 3*$2}&#39;`<br>
76 &nbsp;&nbsp;&nbsp; <br>77 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # reclass with labels only works for category (integer) based maps<br>78 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; #r.reclass input=&quot;$GIS_OPT_INPUT&quot; output=&quot;${GIS_OPT_INPUT}.stdevs&quot; &lt;&lt; EOF<br>79 &nbsp;&nbsp;&nbsp; <br>80 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # &gt;3 S.D. outliers colored black so they show up in d.histogram w/ white background<br>
81 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; r.colors &quot;$GIS_OPT_INPUT&quot; color=rules &lt;&lt; EOF<br>82 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0% black<br>83 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_3STDEV black<br>84 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_3STDEV red<br>85 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_2STDEV red<br>
86 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_2STDEV yellow<br>87 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_1STDEV yellow<br>88 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_MINUS_1STDEV green<br>89 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_1STDEV green<br>90 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_1STDEV yellow<br>91 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_2STDEV yellow<br>
92 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_2STDEV red<br>93 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_3STDEV red<br>94 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $MEAN_PLUS_3STDEV black<br>95 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100% black<br>96 &nbsp;&nbsp;&nbsp; EOF<br>97 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; fi<br>98 &nbsp;&nbsp;&nbsp; <br>99 &nbsp;&nbsp;&nbsp; <br>100 &nbsp;&nbsp;&nbsp; else <br>101 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; # data centered on 0&nbsp; (e.g. map of deviations)<br>
102 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; r.mapcalc &quot;r_col_stdev_abs_$$ = abs($GIS_OPT_INPUT)&quot;<br>103 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; eval `<a href="http://r.info">r.info</a> -r &quot;r_col_stdev_abs_$$&quot;`<br>104 &nbsp;&nbsp;&nbsp; <br>105 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; # current r.univar truncates percentage to the base integer<br>
106 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; STDDEV2=`r.univar -eg &quot;r_col_stdev_abs_$$&quot; perc=95.4500 | grep ^percentile | cut -f2 -d=`<br>107 &nbsp;&nbsp;&nbsp; <br>108 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; if [ $GIS_FLAG_B -eq 0 ] ; then<br>109 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # zero centered smooth blue/white/red<br>
110 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; r.colors &quot;$GIS_OPT_INPUT&quot; color=rules &lt;&lt; EOF<br>111 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$max blue<br>112 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV2 blue<br>113 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 white<br>114 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV2 red<br>115 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $max red<br>
116 &nbsp;&nbsp;&nbsp; EOF<br>117 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; else<br>118 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # zero centered banded&nbsp; black/red/yellow/green/yellow/red/black<br>119 &nbsp;&nbsp;&nbsp; <br>120 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # current r.univar truncates percentage to the base integer<br>121 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; STDDEV1=`r.univar -eg &quot;r_col_stdev_abs_$$&quot; perc=68.2689 | grep ^percentile | cut -f2 -d=`<br>
122 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; STDDEV3=`r.univar -eg &quot;r_col_stdev_abs_$$&quot; perc=99.7300 | grep ^percentile | cut -f2 -d=`<br>123 &nbsp;&nbsp;&nbsp; <br>124 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; # &gt;3 S.D. outliers colored black so they show up in d.histogram w/ white background<br>
125 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; r.colors &quot;$GIS_OPT_INPUT&quot; color=rules &lt;&lt; EOF<br>126 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$max black<br>127 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV3 black<br>128 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV3 red<br>129 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV2 red<br>130 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV2 yellow<br>
131 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV1 yellow<br>132 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -$STDDEV1 green<br>133 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV1 green<br>134 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV1 yellow<br>135 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV2 yellow<br>136 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV2 red<br>137 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV3 red<br>
138 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $STDDEV3 black<br>139 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $max black<br>140 &nbsp;&nbsp;&nbsp; EOF<br>141 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; fi<br>142 &nbsp;&nbsp;&nbsp; <br>143 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; g.remove rast=&quot;r_col_stdev_abs_$$&quot; --quiet<br>144 &nbsp;&nbsp;&nbsp; fi<br><br><br><div class="gmail_quote">On Tue, Aug 12, 2008 at 11:50 AM, Martin Wegmann <span dir="ltr">&lt;<a href="mailto:wegmann@biozentrum.uni-wuerzburg.de">wegmann@biozentrum.uni-wuerzburg.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Raphael,<br>
<br>
just download it and call the script within the GRASS shell<br>
<br>
sh r.colors.stddev<br>
<br>
you have to define the input on the command line. The GUI won&#39;t work with this<br>
method.<br>
<br>
regards, Martin<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<br>
On Dienstag, 12. August 2008 16:03:16 Raphael Saldanha wrote:<br>
&gt; Hi!<br>
&gt;<br>
&gt; Where can I download GEM? &nbsp;I&#39;m a newbie and need to use an add-onn<br>
&gt; (r.colors.stddev), can someone give some instructions?<br>
&gt;<br>
&gt; GRASS 6.3.0 running on Windows :-(<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Raphael Saldanha<br>
&gt; <a href="mailto:saldanha.plangeo@gmail.com">saldanha.plangeo@gmail.com</a><br>
&gt;<br>
&gt; BRAZIL<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Atenciosamente,<br><br>Raphael Saldanha<br><a href="mailto:saldanha.plangeo@gmail.com">saldanha.plangeo@gmail.com</a><br>Lucille Ball &nbsp;- &quot;The secret of staying young is to live honestly, eat slowly, and lie about your age.&quot;
</div>