<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi grass experts,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to create a python script to get an image file as below:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#get_img.py<o:p></o:p></p>
<p class="MsoNormal">import os.path<o:p></o:p></p>
<p class="MsoNormal">import sys # the sys module [2]<o:p></o:p></p>
<p class="MsoNormal">from grass.script import core as grass # the core module [3]<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">def main():<o:p></o:p></p>
<p class="MsoNormal"> grass.run_command('d.his i=elevation_shade h=elevation')<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">if __name__ == "__main__": # this allows the script to be used as a module in other scripts or as a standalone script<o:p></o:p></p>
<p class="MsoNormal"> #options, flags = grass.parser() #<o:p></o:p></p>
<p class="MsoNormal"> sys.exit(main()) <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But I got the default image file name, map.png with GRASS_WIDTH=640 and GRASS_HEIGHT=480.<o:p></o:p></p>
<p class="MsoNormal">Is there any way for me to setup width and height and my image file name in grass.run_command?<o:p></o:p></p>
<p class="MsoNormal">I searched the doc for a while but I still can not get a correct syntax.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for an advance!<o:p></o:p></p>
<p class="MsoNormal">Willie<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p></p>
<p>The information contained in this communication is intended for the use<br>
of the designated recipients named above. If the reader of this <br>
communication is not the intended recipient, you are hereby notified<br>
that you have received this communication in error, and that any review,<br>
dissemination, distribution or copying of this communication is strictly<br>
prohibited. If you have received this communication in error, please <br>
notify The Associated Press immediately by telephone at +1-212-621-1898 <br>
and delete this email. Thank you.<br>
[IP_US_DISC]</p><br>
<p>msk dccc60c6d2c3a6438f0cf467d9a4938</p></body>
</html>