[GRASS-user] Help using color tables (differences)

Hamish hamish_b at yahoo.com
Fri Aug 7 18:39:41 EDT 2009


Hi Thomas,
> I have been using r.colors -n map=mapname color=differences
> to display soil moisture differences from one day to another
> (to identify areas that have received precipitation and
> areas that are drying); I would like to depict wetting areas
> as shades of blue to white and drying areas as shades of
> white to red — as the the option color=differences tries
> to do. The difficulty I'm running into is that unless there
> is a fairly even proportion of of positive & negative
> values I'll have wetting areas colored a shade of red
> instead of blue, but more often, the reverse where drying
> areas are colored blue, due to the shift of the color scale.
> Ideally, I want values close to -0- to be white and wet
> areas to be a shade of blue and dry areas to be a shade of
> red. How can I do this? Any suggestions?

try the 'r.colors.stdev -z' which was recently moved into the
main source tree from the addons repository. maybe a new option
could be added to do a better differences map.

some examples here:
  http://hamish.bowman.googlepages.com/grass_color_maps


for the color rules $GISBASE/etc/differences does:
0% blue
0 white
100% red

what you really want is to have it evenly scaled like:

peak = the greater of abs($min) and abs($max)
-$peak blue
0 white
$peak red


you could use awk to do that a>b logic in a script if you needed
to.

then use those rules as custom color rules with r.colors.

or for you entire dataset decide some static rules, then inter-
map differences are comparable on the same visual scale.


Hamish



      



More information about the grass-user mailing list