You are on page 1of 2

Time series - GRASS-Wiki

http://grasswiki.osgeo.org/wiki/Time_series

Time series
From GRASS-Wiki

Contents
1 Setting and querying time stamps 2 Raster map time series analysis 3 Common legends for many raster maps 4 Animation 5 Time series in GRASS GIS 7

Setting and querying time stamps


Meta-data: r.timestamp (http://grass.osgeo.org/grass64/manuals/r.timestamp.html) - set and retrieve r.support (http://grass.osgeo.org/grass64/manuals/r.support.html) - add further metadata

Raster map time series analysis


r.series (http://grass.osgeo.org/grass64/manuals/r.series.html) - module to analyse series of raster maps, considering the stack of input maps along the time axis

Common legends for many raster maps


The general idea is to: Calculate the overall min/max covering all maps with "r.info (http://grass.osgeo.org/grass64/manuals /r.info.html) -r" Create a full-scale color table with "r.colors (http://grass.osgeo.org/grass64/manuals/r.colors.html) rules=" on the first map Copy that color table to other maps in the series with "r.colors (http://grass.osgeo.org/grass64/manuals /r.colors.html) rast=" Draw legend to color table extent with "d.legend (http://grass.osgeo.org/grass64/manuals /d.legend.html) range=min,max"

Example using Pathfinder AVHRR SST data:


MAP_PATTERN='*.s0451pfv50-sst*degC.q4' # find overall min/max ALL_MIN=999999 ALL_MAX=-999999 for MAP in `g.mlist rast pattern=$MAP_PATTERN` ; do eval `r.info -r $MAP` ALL_MAX=`echo "$max $ALL_MAX" | awk '{if ($1 > $2) print $1; else print $2}'` ALL_MIN=`echo "$min $ALL_MIN" | awk '{if ($1 < $2) print $1; else print $2}'`

1 de 2

31/07/2013 22:28

Time series - GRASS-Wiki

http://grasswiki.osgeo.org/wiki/Time_series

done echo "all_min=$ALL_MIN all_max=$ALL_MAX" ONETHIRD=`echo $ALL_MIN $ALL_MAX | awk '{print ($2 - $1)/3.0 + $1}'` TWOTHIRD=`echo $ALL_MIN $ALL_MAX | awk '{print 2*($2 - $1)/3.0 + $1}'` # create full-scale color table for first map FIRST_MAP=`g.mlist rast pattern=$MAP_PATTERN | head -n 1` r.colors $FIRST_MAP color=rules << EOF $ALL_MIN blue $ONETHIRD cyan $TWOTHIRD yellow $ALL_MAX red EOF # apply color table to all other maps for MAP in `g.mlist rast pattern=$MAP_PATTERN` ; do r.colors $MAP rast=$FIRST_MAP done # draw for MAP in `g.mlist rast pattern=$MAP_PATTERN` ; do d.rast -o $MAP d.legend $MAP range=$ALL_MIN,$ALL_MAX done

For ps.map (http://grass.osgeo.org/grass64/manuals/ps.map.html) use the colortable instruction's "range" parameter.

Animation
see the Movies wiki page

Time series in GRASS GIS 7


A huge set of new modules is available: http://grass.osgeo.org/grass70/manuals/temporal.html A presentation and support material is available in the attachment section of the lecture: http://www.geostat-course.org/Topic_Gebbert Older brainstorming: SQL database support for a raster map timeseries is discussed in the Time series development wiki page. Retrieved from "http://grasswiki.osgeo.org/grass-wiki/index.php?title=Time_series&oldid=17989" Categories: FAQ Image processing This page was last modified on 3 March 2013, at 03:58. This page has been accessed 4,592 times. Content is available under GNU Free Documentation License 1.2.

2 de 2

31/07/2013 22:28

You might also like