[GRASS-user] Re: [GRASSLIST:1184] how to keep same color table for a bunch of rasters?

Hamish hamish_nospam at yahoo.com
Wed Sep 6 21:00:31 EDT 2006


> Vishal Mehta wrote:
> > I am wondering how to maintain the same colors for display of many
> > rasters. More specifically, i have some100 rainfall maps, and want
> > to make sure that the colors used for display are the same for each.
> > They are at present automically scaling using some green-yellow-red
> > ramp between the range of data for each map. If i make a movie of
> > the 100 maps, it does not do a good job because the color scales and
> > legend changes each time...i want both the colors and legend to be
> > same for all..

Markus wrote:
> that's very easy: use the rast= parameter of r.colors to copy over a
> color table from another raster map. So you define the colors for one
> map, then copy it to all other maps.


also, you will probably want to use the "d.legend range=" command to
keep the legend steady. Use r.colors to make a custom colormap covering
the full range of data in your series. to find the full range,

for MAP in `g.mlist type=rast pat=rain*` ; do
  r.info -r $MAP
done


for constructing animations of less than ~ 256 frames, you might
consider creating an animated GIF or PNG (MNG). A nice program for
creating animated GIFs is "Gifsicle", to create animated MNGs, use
Imagemagick's "convert" program.

For presentaions make a simple html page with your image centered on the
page, then (with toolbars all turned off) put Firefox in fullscreen mode
(F11). Presentation software usually breaks with large embedded animations.


If anyone has tips on constructing high-quality MPEG-4 movies from a
series of still frames, I'd be interested in hearing them.



Hamish




More information about the grass-user mailing list