[GRASS-dev] syntax error for r.rescale

Michael Barton Michael.Barton at asu.edu
Thu Mar 7 03:25:55 PST 2019


Found it. Need to use from_ (with underscore) instead of "from"

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu















On Mar 7, 2019, at 12:18 PM, Michael Barton <michael.barton at asu.edu<mailto:michael.barton at asu.edu>> wrote:

I think this is because "from" is a Python keyword. But how to get around this when trying to include r.rescale in a script?

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu<http://csdc.asu.edu/>















On Mar 7, 2019, at 12:10 PM, Michael Barton <michael.barton at asu.edu<mailto:michael.barton at asu.edu>> wrote:

Can anyone tell me why this raises a syntax error at the from argument?

grass.run_command('r.rescale', input=mis1, output=mis1_8bit, from='0,2048', to='0,255')

when

 r.rescale input=name [from=min,max] output=name to=min,max
   [title=phrase] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

(GRASS 7.6.0)

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu<http://csdc.asu.edu/>

















-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20190307/ecffa835/attachment-0001.html>


More information about the grass-dev mailing list