<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Raster Calculator ArcMap Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369504#M29198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've changed this to arcpy.Raster&lt;/P&gt;&lt;P&gt;if that doesn't work try&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN style="border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;Raster&lt;/SPAN&gt;(raster)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Mar 2020 10:11:35 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2020-03-18T10:11:35Z</dc:date>
    <item>
      <title>Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369488#M29182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;BR /&gt;I am trying to do some calculation on Raster using raster calculator in python. I have several restaer and I implemented the calculation using loop. I was working well when I was using ArcMap 9, and now I am using version 10.7. but it gives some errors. The code is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; string&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcgisscripting&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
gp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcgisscripting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;create&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OverWriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddToolbox&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:/Program Files (x86)/ArcGIS/Desktop10.7/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"E:/JASTTpaperWork/Data/Processed/TIFF/"&lt;/SPAN&gt;
out_workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"E:/JASTTpaperWork/Data/Processed/TIFF/ArcGIS02"&lt;/SPAN&gt;
InMask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"E:/JASTTpaperWork/Data/Shapefile/KRG.shp"&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# Get a list of grids in the workspace.&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TIF"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; raster&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; raster
    raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
rasters&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;reset&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetMessages&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; raster&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# Set local variables&lt;/SPAN&gt;
    InRaster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;  raster
    &lt;SPAN class="comment token"&gt;# Set the outputname for each output to be the same as the input.&lt;/SPAN&gt;
    OutRaster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; out_workspace &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; raster
    InExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Con("&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; InRaster &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;" &amp;lt;=  - 1,0,"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; InRaster &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;")"&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RasterCalculator_sa&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;InExpression&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; OutRaster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; raster
    &lt;SPAN class="comment token"&gt;#print InExpression&lt;/SPAN&gt;
    raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;next&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# If an error occurred while running a tool, then print the messages.&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; gp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetMessages&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;Any help would be highly appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:07:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369488#M29182</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2021-12-11T17:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369489#M29183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The errors?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 11:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369489#M29183</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-17T11:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369490#M29184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry the errors are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "E:/JASTTpaperWork/Data/testetstetstetstsCON.py", line 27, in &amp;lt;module&amp;gt;&lt;BR /&gt; arcpy.gp.RasterCalculator_sa(InExpression, OutRaster)&lt;BR /&gt; File "C:\Program Files (x86)\ArcGIS\Desktop10.7\ArcPy\arcpy\geoprocessing\_base.py", line 510, in &amp;lt;lambda&amp;gt;&lt;BR /&gt; return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000989: Python syntax error: Parsing error SyntaxError: invalid syntax (line 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 11:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369490#M29184</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2020-03-17T11:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369491#M29185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like its the '/'.&amp;nbsp; Place an 'r' in the beginning to declare it a raw string and change slashes to be backslashes throughout the code-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;gp.workspace = r"E:\JASTTpaperWork\Data\Processed\TIFF"
out_workspace = r"E:\JASTTpaperWork\Data\Processed\TIFF\ArcGIS02"‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also looks like you are checking out 'spatial' twice.&amp;nbsp; A little bit of code to help with checking out licenses:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;if arcpy.CheckExtension("Spatial) == "Available":
    arcpy.AddMessage("Checking out {} licence".format(extlicense))
    # Check out the extension if available
    arcpy.CheckOutExtension(extlicense)
else:
    # If extension is not available
    arcpy.AddMessage("!!!! Failed !: {}".format(arcpy.GetMessages(0)))
    sys.exit(0)


# And then return it when you're done:‍‍‍‍‍‍‍‍‍‍‍
arcpy.CheckInExtension("Spatial")‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:08:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369491#M29185</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T17:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369492#M29186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could be&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/raster-calculator.htm" title="https://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/raster-calculator.htm"&gt;Raster Calculator—Help | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;H5 class="" style="color: #4c4c4c; font-weight: 300; font-size: 1rem; margin: 0px 0px 0rem;"&gt;Note:&lt;/H5&gt;&lt;P style="color: #4c4c4c; margin-bottom: 1.55rem;"&gt;The Raster Calculator tool is not intended to be used in scripting environments and is not available in the standard&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Spatial Analyst&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ArcPy module. To learn more about scripting and Map Algebra, see the help topic&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/help/analysis/spatial-analyst/mapalgebra/what-is-map-algebra.htm" style="color: #0074b8; text-decoration: none;"&gt;What is Map Algebra?&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Spatial Analyst&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;extension help.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #4c4c4c; margin-bottom: 1.55rem;"&gt;You will probably have to implememt 'Con' directly&lt;/P&gt;&lt;P style="color: #4c4c4c; margin-bottom: 1.55rem;"&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/con-.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/con-.htm"&gt;Con—Help | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369492#M29186</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-17T12:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369493#M29187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forward slashes are valid path separators.&amp;nbsp; Raw encoding, double back slashes or single forward slashes will be parsed properly.&amp;nbsp; Folders with spaces or characters other than letters and numbers and the underscore are iffy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:09:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369493#M29187</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-17T12:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369494#M29188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My bad.&amp;nbsp; I'm used to raw encoding and coding backslashes and forget sometimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 8 does have that iffyness ... 'C:\Program Files (x86)\ArcGIS\Desktop10.7\'... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:32:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369494#M29188</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-03-17T12:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369495#M29189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jeffy and Dan, Thanks for the quick response. I have followed your response and double checked each line of the cod. however I got the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369495#M29189</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2020-03-17T12:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369496#M29190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so you replaced the raster calculator and implemented Con directly from the spatial analyst tools (see the Note&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:36:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369496#M29190</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-17T12:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369497#M29191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actully I did not get the point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I exported the python code from module builder and Iater expanded the code through reading and exporting the rasters. So I do not know what do you mean.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 12:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369497#M29191</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2020-03-17T12:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369498#M29192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It means you can't use modelbuilder.&amp;nbsp; The link that I provided is for the Con tool and you can use it directly instead of through a raster calculator expression.&amp;nbsp; See the code example in the link&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 15:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369498#M29192</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-17T15:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369499#M29193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but I cannot see the link that you sent.... Could you please send the link.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 19:14:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369499#M29193</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2020-03-17T19:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369500#M29194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the ArcMap help, search on Con... these are for ArcGIS Pro, but the help topic is the same&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/con-.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/con-.htm"&gt;Con—Help | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/image-analyst/conditional-evaluation-with-con.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/image-analyst/conditional-evaluation-with-con.htm"&gt;Conditional evaluation with Con—Help | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 19:17:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369500#M29194</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-17T19:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369501#M29195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the prompt response&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 19:18:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369501#M29195</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2020-03-17T19:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369502#M29196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:/JASTTpaperWork/Data/Processed/TIFF/"&lt;/SPAN&gt;
out_workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:/JASTTpaperWork/Data/Processed/TIFF/ArcGIS02"&lt;/SPAN&gt;

InMask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:/JASTTpaperWork/Data/Shapefile/KRG.shp"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Get a list of grids in the workspace.&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TIF"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; raster &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# Set the outputname for each output to be the same as the input.&lt;/SPAN&gt;
    output_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;raster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;#create raster object&lt;/SPAN&gt;
    raster_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;raster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    raster_object &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;raster_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;#return conditional raster&lt;/SPAN&gt;
    con_raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Con&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;raster_object &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; raster_object&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    
    &lt;SPAN class="comment token"&gt;#save it&lt;/SPAN&gt;
    con_raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;output_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckInExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Thanks"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

ty&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Dave"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:08:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369502#M29196</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-12-11T17:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369503#M29197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear David,&amp;nbsp;&lt;BR /&gt;Thanks for the your genourus&amp;nbsp;help. I tried to run the cond&amp;nbsp;but I got an error as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "E:\JASTTpaperWork\Data\ExtRasCal - Copy.py", line 23, in &amp;lt;module&amp;gt;&lt;BR /&gt; raster_object = raster(raster_path)&lt;BR /&gt;TypeError: 'unicode' object is not callable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I search online about this error but still I cannot figure out how to solve it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion.....!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2020 07:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369503#M29197</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2020-03-18T07:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369504#M29198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've changed this to arcpy.Raster&lt;/P&gt;&lt;P&gt;if that doesn't work try&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN style="border-image-outset: 0; border-image-repeat: stretch; border-image-slice: 100%; border-image-source: none; border-image-width: 1; color: #999999; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; outline-color: invert; outline-style: none; outline-width: 0px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: baseline; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px; padding: 0px; margin: 0px; border: 0px none currentColor;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #f5f2f0; color: #000000; font-family: monospace; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre; word-spacing: 0px;"&gt;Raster&lt;/SPAN&gt;(raster)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2020 10:11:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369504#M29198</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-03-18T10:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369505#M29199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply. The previous error is gone after I tried your suggestion, and added some library in the top. the code is below:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;importarcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; string&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcgisscripting&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; arcpy
importos
fromarcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
fromarcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sa &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;
gp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcgisscripting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;create&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckOutExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:\\JASTTpaperWork\\Data\\Processed\\TIFF\\"&lt;/SPAN&gt;
out_workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:\\JASTTpaperWork\\Data\\Processed\\TIFF\\ArcGIS02\\"&lt;/SPAN&gt;

InMask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"E:\\JASTTpaperWork\\Data\\Shapefile\\KRG.shp"&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Get a list of grids in the workspace.&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"TIF"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; raster &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# Set the outputname for each output to be the same as the input.&lt;/SPAN&gt;
output_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;raster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#create raster object&lt;/SPAN&gt;
raster_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;raster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
raster_object &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;raster_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; output_path
&lt;SPAN class="comment token"&gt;#return conditional raster&lt;/SPAN&gt;
con_raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Con&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;raster_object &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; raster_object&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#save it&lt;/SPAN&gt;
con_raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;output_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CheckInExtension&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Spatial"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ty&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Thanks"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

ty&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Dave"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this time another error appears which it seems to be a problem with the path of saving the data. The error is:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "E:\JASTTpaperWork\Data\ExtRasCal - Copy.py", line 32, in &amp;lt;module&amp;gt;&lt;BR /&gt; con_raster.save(output_path)&lt;BR /&gt;RuntimeError: ERROR 000875: Output raster: E:\JASTTpaperWork\Data\Processed\TIFF\ArcGIS02\2000_EVI.tif's workspace is an invalid output workspace.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any&amp;nbsp;dvice....!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:08:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369505#M29199</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2021-12-11T17:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369506#M29200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try hardcoding a different path as the out workspace. look at your path formatting and check against examples in the esri help.&lt;/P&gt;&lt;P&gt;There's no need to keep adding those modules - &lt;SPAN style="display: inline !important; float: none; background-color: #f6f6f6; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;sys, string, arcgisscripting, math. it just slows down your process.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2020 18:01:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369506#M29200</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2020-03-18T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator ArcMap Python</title>
      <link>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369507#M29201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fine ....&amp;nbsp;I rechecked the code and I change the path of the out workspace. The error is still there and I an really&amp;nbsp;frustrating. The error message is:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
  File &lt;SPAN class="string token"&gt;"E:\JASTTpaperWork\Data\ExtRasCal - Copy.py"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;35&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    con_raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;output_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
RuntimeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; ERROR &lt;SPAN class="number token"&gt;010240&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; Could &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; save raster dataset to 2000_EVI&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;tif &lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; output format TIFF&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assist please.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/raster-calculator-arcmap-python/m-p/369507#M29201</guid>
      <dc:creator>Yaseen_TahaMustafa</dc:creator>
      <dc:date>2021-12-11T17:08:10Z</dc:date>
    </item>
  </channel>
</rss>

