DESCRIPTION

r.boxcountAllows the user to study how the boxcounting fractal dimension varies across a raster map.
boxcount.sh is a shell script which allows the user to study how the
boxcounting fractal dimension varies across a raster map. To to do
this it repeatedly calls r.boxcount in a moving window. The moving
window is a square region of a size specified by the user. The centre
of this window is repeatedly moved by an increment also specified by
the user. The region used for analysis is the current region. The
region covered by output data is smaller by whatever distance is
required to prevent an edge effect given the specified window
size. Note that since the script changes the GRASS region other
concurrent GRASS processes could be adversely affected.  boxcount.sh
does, however, restore the starting region once analysis is complete.

boxcount.sh produces an ascii text file listing the fractal dimension
for each location over which the moving window was centred. This
output can be converted into a raster map as follows:
1) Process the output using awk to remove blank lines and
   extraneous text, e.g.
        awk '/D/ { print $12}' outputfile > newfile
2) Copy the header information and paste it at the
   start of newfile
3) Import the ascii raster data using r.in.ascii, e.g.
        r.in.ascii input=newfile output=rastermap mult=1000

INSTALLATION

boxcount.sh is useless unless you have already installed r.boxcount.

1) Copy the source file (this file) into the scripts directory:

cp boxcount.sh $GISBASE/scripts

2) Make the source file executable:

chmod ugo+x $GISBASE/scripts/boxcount.sh

3) Have fun!
   boxcount.sh mapname
  
ACKNOWLEDGEMENTS

This program was written during the author's tenure of a
Leverhulme Special Research Fellowhip.

AUTHOR

Mark Lake, 1/9/99 adaptations for GRASS GIS 6.3: Florian Kindl, 2006-10-04

Last changed: $Date$