In a python script, I am doing g.list to get a certain set of rasters, then r.series to sum the values. I find that g.list adds a newline character at the end of the string, and that causes r.series to fail. I've added the python rstrip('\n') to avoid this.
Is that the expected output from g.list?

Here's the code that works:

rast_list = gscript.read_command('g.list', type='rast', separator='comma', pattern='ims_*')
rast_list = rast_list.rstrip('\n')
gscript.run_command('r.series', input=rast_list, output=ttl_ims_precip, method='sum', overwrite=True)

Without the "rstrip" call, then r.series fails.

This is on Mint 18 with grass 7.0.4
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to