GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
python.raster Namespace Reference

Functions

def raster_history
 Set the command history for a raster map to the command used to invoke the script (interface to `r.support'). More...
 
def raster_info
 Return information about a raster map (interface to `r.info'). More...
 
def mapcalc
 Interface to r.mapcalc. More...
 
def mapcalc_start
 Interface to r.mapcalc, doesn't wait for it to finish, returns Popen object. More...
 

Function Documentation

def python.raster.mapcalc (   exp,
  quiet = False,
  verbose = False,
  overwrite = False,
  kwargs 
)

Interface to r.mapcalc.

Parameters
expexpression
kwargs

Definition at line 92 of file raster.py.

References python.core.fatal(), and python.core.write_command().

def python.raster.mapcalc_start (   exp,
  quiet = False,
  verbose = False,
  overwrite = False,
  kwargs 
)

Interface to r.mapcalc, doesn't wait for it to finish, returns Popen object.

1 >>> expr1 = '"%s" = "%s" * 10' % (output, input)
2 >>> expr2 = '...' # etc.
3 >>> # launch the jobs:
4 >>> p1 = grass.mapcalc_start(expr1)
5 >>> p2 = grass.mapcalc_start(expr2) # etc.
6 ...
7 >>> # wait for them to finish:
8 >>> p1.wait()
9 >>> p2.wait() # etc.
Parameters
expexpression
kwargs
Returns
Popen object

Definition at line 113 of file raster.py.

References python.core.feed_command().

def python.raster.raster_history (   map)

Set the command history for a raster map to the command used to invoke the script (interface to `r.support').

Parameters
mapmap name
Returns
True on success
False on failure

Definition at line 36 of file raster.py.

References python.core.gisenv(), python.core.run_command(), and python.core.warning().

def python.raster.raster_info (   map)

Return information about a raster map (interface to `r.info').

Example:

1 >>> grass.raster_info('elevation')
2 {'north': 228500.0, 'timestamp': '"none"', 'min': 55.578792572021499,
3 'datatype': 'FCELL', 'max': 156.32986450195301, 'ewres': 10.0,
4 'vertical_datum': '', 'west': 630000.0, 'units': '',
5 'title': 'South-West Wake county: Elevation NED 10m (elev_ned10m)',
6 'east': 645000.0, 'nsres': 10.0, 'south': 215000.0}
Parameters
mapmap name
Returns
parsed raster info

Definition at line 56 of file raster.py.

References python.core.float_or_dms(), python.core.parse_key_val(), and python.core.read_command().