syntax error for r.rescale

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

syntax error for r.rescale

Michael Barton
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)
















_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: syntax error for r.rescale

Michael Barton
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)















On Mar 7, 2019, at 12:10 PM, Michael Barton <[hidden email]> 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)

















_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: syntax error for r.rescale

Michael Barton
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)















On Mar 7, 2019, at 12:18 PM, Michael Barton <[hidden email]> 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)















On Mar 7, 2019, at 12:10 PM, Michael Barton <[hidden email]> 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)


















_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
SBL
Reply | Threaded
Open this post in threaded view
|

Re: syntax error for r.rescale

SBL
In reply to this post by Michael Barton

> 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?

 

Did you try from_ ?

 


_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev