<?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: arcpy, Spatial Analyst, and Exp in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191754#M14737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First of all, I'm glad that things work for you, but somehow there is something that doesn't make sense to me. The IDW interpolation is available in Spatial Analyst, 3D Analyst and Geostatistical Analyst. The IWD in ga is different, since it also requires a layer, so let's take this one out of the equation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you manually start the tool (in 10.2) and copy the Python snippet after a successful run, you can see the code generated. In case of 3D Analyst it call the tool from;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Idw_3d&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In case of Spatial Analyst it does this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.&lt;STRONG&gt;gp&lt;/STRONG&gt;.Idw_sa&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparently it calls it from the old (?) gp module. That's odd... If you go the the Help page on Idw in Spatial Analyst and scroll down to the code sample you see they are using;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.sa.Idw&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 3D Analyst IDW code sample in the Help is using the same arcpy.Idw_3d. You are using arcpy.Idw_sa. In Python you can print the help from any function like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;help(arcpy.sa.Idw)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It prints the Help on the function. Just have a closer look at what happens:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.Idw_3d&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function Idw in module arcpy.ddd:&lt;BR /&gt;Idw(in_point_features=None, z_field=None, &lt;STRONG&gt;out_raster=None&lt;/STRONG&gt;, cell_size=None, power=None, search_radius=None, in_barrier_polyline_features=None&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.ddd.Idw&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function Idw in module arcpy.ddd:&lt;BR /&gt;Idw(in_point_features=None, z_field=None, &lt;STRONG&gt;out_raster=None&lt;/STRONG&gt;, cell_size=None, power=None, search_radius=None, in_barrier_polyline_features=None)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.sa.Idw&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function Idw in module arcpy.sa.Functions:&lt;BR /&gt;Idw(in_point_features, z_field, cell_size='#', power='#', search_radius='#', in_barrier_polyline_features='#')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.gp.Idw_sa&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function &amp;lt;lambda&amp;gt; in module arcpy.geoprocessing._base:&lt;BR /&gt;&amp;lt;lambda&amp;gt; lambda *args&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.Idw_sa&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new;"&gt;AttributeError: 'module' object has no attribute 'Idw_sa'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, the 3D IDW does have an output raster parameter. The Idw_sa (inside gp or in directly from arcpy) do not show any help. However from the python snippet obtained from manually executing the Spatial Analyst IDW we know this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.gp.Idw_sa("myPointFeatureClass","FieldName",&lt;STRONG&gt;"myOutputRaster"&lt;/STRONG&gt;,"cellSize","power","some other parameters","#")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does have an output raster parameter. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many tools have different ways to execute them:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#this:
arcpy.management.AddField
# is the same as:
arcpy.AddField_management&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you should take into account for future development is that within Spatial Analyst there is a trend to use the structure:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;outputraster = tool(parameters)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This creates a temporal raster object which can be saved by calling the save methode on the object;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;outputraster.save(outPathAndName)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So use arcpy.sa.Exp and arcpy.sa.Idw (instead of arcpy.Exp_sa and arcpy.Idw_sa).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be nice if Jason Scheirer (from the Python development team at Esri) could jump in the conversation and shed his light on this, but I suppose he is too busy with the DevSummit preps which is starting today...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:38:29 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2021-12-11T09:38:29Z</dc:date>
    <item>
      <title>arcpy, Spatial Analyst, and Exp</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191751#M14734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to convert some 9.3 python scripts that use the geoprocessor object gp to use arcpy instead. I am struggling with the conversion of Single Output Map Algebra (SOMA) that uses exp. Also, the script first calculated IDW on a set of points and that alone was quite a struggle to figure out since the 10.2 help for Spatial Analyst IDW does not show the correct input parameters! Add to the confusion the decision of when to use arcpy.Raster and when not to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I am very close, but for some reason when I run arcpy.Exp_sa on my raster as such:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ExpOut = arcpy.Exp_sa(IDWOut)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;another raster is automatically output by Exp with the same name as IDWOut, but with Exp_ at the beginning and _1 at the end. For example, if IDWOut is "IDW_PAH_filtered", then a raster called "Exp_IDW_PAH_filtered_1" is automatically created. According to the help page &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000008s000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000008s000000&lt;/A&gt;&lt;SPAN&gt; the output should be saved to ExpOut, but when I look at the values of that raster, I can see that they have not had the exponential applied.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So confused!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are the actual code snippets:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;geoDB = sys.argv[1]
COCLayer = sys.argv[2]
COCField = sys.argv[3]
PerfLog = sys.argv[4]
IDWCellSize = sys.argv[5]
IDWPower = sys.argv[6]
IDWRadius = sys.argv[7]
IDWMask = sys.argv[8]
IDWBarrier = sys.argv[9&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IDWOut = geoDB + "\\IDW_" + COCLayer
arcpy.Idw_sa(geoDB + "\\temp_data", COCField, IDWOut, IDWCellSize, IDWPower, IDWRadius, IDWBarrier)
ExpOut = arcpy.Exp_sa(IDWOut)
IDWOut = arcpy.Raster(ExpOut) / 1000&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the temp_data is a temporary point shapefile that is created correctly by the script. I started wondering if Exp has the wrong input parameters on the help page just like Idw and maybe needs an output raster as one of the parameters, like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.Exp_sa(IDWOut, ExpOut)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but when I tried that, I got an error saying "name 'ExpOut' is not defined".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone has any insights, I will welcome them. Yes, I know I can still use the old gp method, but I really want to avoid that. By the way, here is what it used to look like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IDWOut = geoDB + "\\IDW_temp"
outRaster = geoDB + "\\IDW_" + COCLayer


gp.Idw_sa(geoDB + "\\temp_data", COCField, IDWOut, IDWCellSize, IDWPower, IDWRadius, IDWBarrier)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
inExpress = "( exp (" + IDWOut + ") ) / 1000"
gp.SingleOutputMapAlgebra_sa(inExpress, outRaster)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The inputs sys.argv[] were the same. In that case, IDWOut was a temporary raster that was deleted later and the final output was outRaster, but doing something similar with arcpy was creating even more problems.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:38:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191751#M14734</guid>
      <dc:creator>JenniferHorsman</dc:creator>
      <dc:date>2021-12-11T09:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy, Spatial Analyst, and Exp</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191752#M14735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are a few suggestion I have when I look at your second snippet of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;use os.path.join(pathname, filename) to create a valid output (requires "import os")&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;use "IDW_{0}".format(COCLayer) to create the name&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;access the Idw tool through arcpy.sa.Idw&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;note that the output is not a parameter of IDW&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;the result of a arcpy.sa tool is normally a raster object (in memory)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;use the .save methode on the object to save the raster to a location&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os

geoDB = r'C:\Path\to\Folder\With\GeoDB.gdb'
COCLayer = 'aLayerName'
COCField = 'aFieldName'
IDWCellSize = 10
IDWPower = 2
IDWRadius = 100
IDWBarrier = r'C:\Path\to\Folder\With\GeoDB.gdb\myBarriers'

# use os.path.join to combine path and file names and use string.format to format names
idw_out = os.path.join(geoDB, "IDW_{0}".format(COCLayer))

# Idw (in_point_features, z_field, {cell_size}, {power}, {search_radius}, {in_barrier_polyline_features})
fc_points = os.path.join(geoDB, 'temp_data')
myIDWraster = arcpy.sa.Idw(fc_points, COCField, IDWCellSize, IDWPower, IDWRadius, IDWBarrier)
myEXPraster = arcpy.sa.Exp(myIDWraster)
myFinalRaster = myEXPraster / 1000 # arcpy.Raster(myEXPraster) / 1000
myFinalRaster.save(idw_out)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;BTW see samples in Help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000008s000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Exp (Spatial Analyst) &lt;/A&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009z0000006m000000" rel="nofollow noopener noreferrer" target="_blank"&gt;IDW (Spatial Analyst)&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:38:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191752#M14735</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T09:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy, Spatial Analyst, and Exp</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191753#M14736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Jennifer,&lt;BR /&gt;&lt;BR /&gt;There are a few suggestion I have when I look at your second snippet of code:&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;use os.path.join(pathname, filename) to create a valid output (requires "import os")&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;use "IDW_{0}".format(COCLayer) to create the name&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;access the Idw tool through arcpy.sa.Idw&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;note that the output is not a parameter of IDW&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;the result of a arcpy.sa tool is normally a raster object (in memory)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;use the .save methode on the object to save the raster to a location&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your reply. I was persistent yesterday and found a solution. By the way, as I mentioned in my original post, I did follow the suggestions on the help pages for Exp and Idw, and unfortunately, both appear to be incorrect for ArcGIS 10.x versions. Both of them can take an output file name as a parameter. And if an output file name is not supplied, then both will write output to the workspace (in my case, a personal geodatabase) with an automatically generated name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is how I implemented Idw and Exp:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The script arguments (inputs) remain the same. I added another variable back in, a string for the name of the final result output raster, outRaster. I added parameters for the temporary outputs for Exp and Idw which I deleted later. And, I used another raster variable, MARaster, for some math algebra output. This step was probably not necessary, but it helped me sort out the debugging process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IDWOut = geoDB + "\\IDW_temp"
outRaster = geoDB + "\\IDW_" + COCLayerBase


arcpy.Idw_sa(geoDB + "\\temp_data", COCField, IDWOut, IDWCellSize, IDWPower, IDWRadius, IDWBarrier)
arcpy.Exp_sa(IDWOut, ExpOut)
MARaster = arcpy.Raster(ExpOut) / 1000
MARaster.save(outRaster)


arcpy.Delete_management(geoDB + "\\temp_data")
arcpy.Delete_management(IDWOut)
arcpy.Delete_management(ExpOut)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191753#M14736</guid>
      <dc:creator>JenniferHorsman</dc:creator>
      <dc:date>2021-12-11T09:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy, Spatial Analyst, and Exp</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191754#M14737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First of all, I'm glad that things work for you, but somehow there is something that doesn't make sense to me. The IDW interpolation is available in Spatial Analyst, 3D Analyst and Geostatistical Analyst. The IWD in ga is different, since it also requires a layer, so let's take this one out of the equation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you manually start the tool (in 10.2) and copy the Python snippet after a successful run, you can see the code generated. In case of 3D Analyst it call the tool from;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Idw_3d&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In case of Spatial Analyst it does this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.&lt;STRONG&gt;gp&lt;/STRONG&gt;.Idw_sa&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apparently it calls it from the old (?) gp module. That's odd... If you go the the Help page on Idw in Spatial Analyst and scroll down to the code sample you see they are using;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.sa.Idw&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The 3D Analyst IDW code sample in the Help is using the same arcpy.Idw_3d. You are using arcpy.Idw_sa. In Python you can print the help from any function like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;help(arcpy.sa.Idw)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It prints the Help on the function. Just have a closer look at what happens:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.Idw_3d&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function Idw in module arcpy.ddd:&lt;BR /&gt;Idw(in_point_features=None, z_field=None, &lt;STRONG&gt;out_raster=None&lt;/STRONG&gt;, cell_size=None, power=None, search_radius=None, in_barrier_polyline_features=None&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.ddd.Idw&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function Idw in module arcpy.ddd:&lt;BR /&gt;Idw(in_point_features=None, z_field=None, &lt;STRONG&gt;out_raster=None&lt;/STRONG&gt;, cell_size=None, power=None, search_radius=None, in_barrier_polyline_features=None)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.sa.Idw&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function Idw in module arcpy.sa.Functions:&lt;BR /&gt;Idw(in_point_features, z_field, cell_size='#', power='#', search_radius='#', in_barrier_polyline_features='#')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.gp.Idw_sa&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family:courier new;"&gt;Help on function &amp;lt;lambda&amp;gt; in module arcpy.geoprocessing._base:&lt;BR /&gt;&amp;lt;lambda&amp;gt; lambda *args&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;arcpy.Idw_sa&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new;"&gt;AttributeError: 'module' object has no attribute 'Idw_sa'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, the 3D IDW does have an output raster parameter. The Idw_sa (inside gp or in directly from arcpy) do not show any help. However from the python snippet obtained from manually executing the Spatial Analyst IDW we know this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.gp.Idw_sa("myPointFeatureClass","FieldName",&lt;STRONG&gt;"myOutputRaster"&lt;/STRONG&gt;,"cellSize","power","some other parameters","#")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does have an output raster parameter. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many tools have different ways to execute them:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#this:
arcpy.management.AddField
# is the same as:
arcpy.AddField_management&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you should take into account for future development is that within Spatial Analyst there is a trend to use the structure:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;outputraster = tool(parameters)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This creates a temporal raster object which can be saved by calling the save methode on the object;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;outputraster.save(outPathAndName)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So use arcpy.sa.Exp and arcpy.sa.Idw (instead of arcpy.Exp_sa and arcpy.Idw_sa).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be nice if Jason Scheirer (from the Python development team at Esri) could jump in the conversation and shed his light on this, but I suppose he is too busy with the DevSummit preps which is starting today...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xander&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:38:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-spatial-analyst-and-exp/m-p/191754#M14737</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T09:38:29Z</dc:date>
    </item>
  </channel>
</rss>

