[GRASS-dev] Adding a suffix for output raster map names

Nikos Alexandris nik at nikosalexandris.net
Fri Nov 14 09:06:00 PST 2014

Nikos Alexandris wrote:

>> Is there a pygrass function to isolate the a raster map's basename 
>> from
>> the Mapset part? Looking for it...

Helmut Kudrnovsky wrote:

> this should work:

> def main():
>     vectorforcalculations = options['vector'].split('@')[0]

Danke Helmut :-)

Since I already do:

from grass.pygrass.raster.abstract import Info
images = {}
     for img in imglst:  # Retrieving Image Info
         images[img] = Info(img, mapset)

I would prefer to do something like:

msx_nam = ("%s.%s" % (images[msx].name, outputsuffix))

and use the "msx_name" where-ever it is needed.  But, the ".name" 
attribute of the Info class does add the @Mapset too. So, no luck :-/


ps- Just a reminder/idea @Pietro: make the Info class independent, it 
might prove to be very useful.

More information about the grass-dev mailing list