[GRASS-user] gstat in a latlon location / exit+reenter grass from a script

John Stevenson john.stevenson at manchester.ac.uk
Wed Oct 22 12:49:08 EDT 2008


Hi,

I am using gstat within grass to calculate variograms.  It works very 
well in UTM locations, but now I need to use it in a lat-long location, 
which it doesn't support.  I am trying to think of a way round this and 
decided on the following strategy:

1- export the data to a text file (r.stats -1g)
2 - reproject the data in the text file to UTM (cs2cs)
3 - use gstat to calculate the variogram of the text file

This method works, provided that I run gstat outside of GRASS.  However, 
I would now like to run these calculations from a batch file.  I can 
imagine two ways of doing this, and these are my questions:

Option 1:  Trick gstat so that it thinks that it is running outside of 
GRASS so that it will let me input my data from a text file.  I tried 
unsetting some of the GRASS variables but this didn't work.  Is there a 
way that I can do this?

Option 2:  Get my shell script to exit from GRASS, run the gstat 
commands, then return to GRASS where it left off.  Is this way 
possible?  Alternatively, if I could get GRASS to run commands as if 
from another shell then that may work, too.

Cheers

John

-- 


Dr John Stevenson
Postdoctoral Research Associate
School of Earth, Atmospheric and Environmental Sciences
Williamson Building (Room 2.42)
University of Manchester
Manchester M13 9PL, UK
tel. +44(0)161 306 6585; fax. +44(0)161 306 9361;
john.stevenson at manchester.ac.uk 



More information about the grass-user mailing list