[GRASS-user] Re: Trying python scripts.

Marcello Gorini gorini at gmail.com
Fri May 28 10:28:21 EDT 2010



Nikos Alexandris wrote:
> 
> Marcello Gorini:
>> ...let's go step by step:
>> ls -l myscript.py
> 
>> -rwxr-xr-x 1 marcello marcello 1227 2010-05-28 08:13 myscript.py
> 
> looks fine
> 
>> g.gisenv
> 
>> GISDBASE=/home/marcello/grassdata
>> LOCATION_NAME=Ocean_floor
>> MAPSET=level4
>> MONITOR=x0
>> GRASS_GUI=tcltk
> 
> just out of curiosity (and not that, I think, it makes any differene): are
> you 
> running (grass and) the script via the gui's command line or in text-mode?
> 
>> g.region -p
> 
>> projection: 99 (Mercator)
>> zone:       0
>> datum:      wgs84
>> ellipsoid:  wgs84
>> north:      3947900
>> south:      3633400
>> west:       -7366700
>> east:       -7022600
>> nsres:      3700
>> ewres:      3700
>> rows:       85
>> cols:       93
>> cells:      7905
> 
> looks ok (below also)
>  
>> r.info map1
> ...
>>  |   Range of data:    min = 0.000000  max = 10000.000000
> ...
> 
>> r.info map2
> ...
>>  |   Range of data:    min = 1000.000000  max = 1000.000000
> ...
> 
>> Result of "r.info outmap":
>> ERROR: Raster map <outmap> not found
> 
> Hmmm... I don't know what could be wrong here. I guess running directly
> in-
> grass what the python script is expected to do ( r.mapcalc "outmap = map1
> + 
> map2" ) is ok, isn't it?
> 
> Could you also please copy-paste the exact (python) command you use within
> the 
> grass-session to get the desired "outmap"?
> 
> Nikos
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> 

Ok, so answering your questions:

>>just out of curiosity (and not that, I think, it makes any differene): are
you 
>>running (grass and) the script via the gui's command line or in text-mode?

No gui, everything using the terminal.

>>Hmmm... I don't know what could be wrong here. I guess running directly
in-
>>grass what the python script is expected to do ( r.mapcalc "outmap = map1
+ 
>>map2" ) is ok, isn't it?

Yep!

>>Could you also please copy-paste the exact (python) command you use within
the 
>>grass-session to get the desired "outmap"?

Sure: 
python myscript.py raster1=map1 raster2=map2 output=outmap

Well, I think that eventually we will find out that the problem lies between
my chair and my computer, and you are going to be mad with me :)

But for now, let's keep going.

Cheers,
Marcello.



-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Trying-python-scripts-tp5109105p5113299.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list