Forestry and Grass + scripts for models

Agustin Lobo alobo at ija.csic.es
Tue Oct 26 13:49:50 EDT 1999


Well, I would not say that is "ideal", it is possible.
Actually, writing (i.e. population or metapopulation) models
in C (or C++) is far from ideal, as writing the code tends to
imply too much time devoted to "low level" (not a fair term, but an
usual one) programming and the resulting code uses to be
too obscure for others to read (often it's easier to
write your own program in C than reading it afterwards).

A closer-to-ideal situation would be having an script language, from
which you can call grass programs. I wrote a model
for gap dynamics in a neotropical forest using the c-shell
and calling grass functions. It was better (easier and faster) than 
using C, but the code was almost as cryptic. Another problem
was the very limited power of the c-shell to manage
arrays (only 1-D) and to make computations (only integers), which
had to solve by using awk sometimes. 

Now there are other script languages than could be better, i.e.,
like perl, does anybody have experience at integrating grass
commands within a perl script?

Finally, I explored the possibility of using Splus (R is now a 
free alternative and mostly compatible) programs, as Splus (or R)
can issue OS commands. Therefore, it is possible, from within an 
Splus program, run i.e. r.stats and read in the result into 
an S array and make computations. But the communication is
through files.

In any case, I think that the (near) future of Grass should contemplate
the use of an scripting language for modeling. Is anybody at Baylor
working in this direction?


Agus



Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es
http://pangea.ija.csic.es/alobo


On Tue, 26 Oct 1999, Roy Sanderson wrote:

> Hello
> 
> Colleagues of mine have been using GRASS for several years to model red and
> grey squirrel populations under different forest management regimes, and
> various control measures for grey squirrels.  Grass is ideal for this type
> of work, especially since you can integrate your own process-based
> population models (we write ours in C) into the Grass environment.
> 
> Roy
> 
> At 04:32 pm 26/10/99 +0200, you wrote:
> >Hello (again)
> >
> >I'm wondering if anybody of the grass-community has used Grass combined
> >with forestry --> modelling and planning etc.
> >
> >
> >
> >sincerely Kjell-Olav
> >
> >
> >
> 
> ----------------------------------------------------------------------------
> Roy Sanderson
> Centre for Land Use and Water Resources Research
> Porter Building
> University of Newcastle
> Newcastle upon Tyne
> NE1 7RU
> United Kingdom
> 
> Tel: +44 191 222 7789
> Fax: +44 191 222 6563
> r.a.sanderson at newcastle.ac.uk
> URL: http://www.cluwrr.ncl.ac.uk
> ----------------------------------------------------------------------------
> 



More information about the grass-user mailing list