<?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 Raster calculator power function error in python in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1312624#M26939</link>
    <description>&lt;P&gt;I have a lengthy raster calculator expression I'm running in a python script tool that keep throwing the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RuntimeError: Failed to apply Raster Function: 'RasterCalculator' (The parameter is incorrect. &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Bind failed in function 'Raster Calculator Function' [Raster Calculator Function].)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I narrowed it down to the Power() function. The calculation in the script works fine if I remove it&lt;/P&gt;&lt;P&gt;I simplified everything down to troubleshoot:&lt;/P&gt;&lt;P&gt;If I run the expression&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Power("x", 2)&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;in the raster calculator everything works as advertised&lt;/P&gt;&lt;P&gt;If I run the script&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;y = RasterCalculator([x], ["x"], "Power(x, 2)")&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;I get the above error. (If I change Power() to another function like Sin(x) the script will run without error)&lt;/P&gt;&lt;P&gt;Is this a bug or am I just missing something simple?&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2023 16:46:28 GMT</pubDate>
    <dc:creator>LukeFloch</dc:creator>
    <dc:date>2023-07-27T16:46:28Z</dc:date>
    <item>
      <title>Raster calculator power function error in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1312624#M26939</link>
      <description>&lt;P&gt;I have a lengthy raster calculator expression I'm running in a python script tool that keep throwing the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;RuntimeError: Failed to apply Raster Function: 'RasterCalculator' (The parameter is incorrect. &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Bind failed in function 'Raster Calculator Function' [Raster Calculator Function].)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I narrowed it down to the Power() function. The calculation in the script works fine if I remove it&lt;/P&gt;&lt;P&gt;I simplified everything down to troubleshoot:&lt;/P&gt;&lt;P&gt;If I run the expression&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Power("x", 2)&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;in the raster calculator everything works as advertised&lt;/P&gt;&lt;P&gt;If I run the script&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;y = RasterCalculator([x], ["x"], "Power(x, 2)")&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;I get the above error. (If I change Power() to another function like Sin(x) the script will run without error)&lt;/P&gt;&lt;P&gt;Is this a bug or am I just missing something simple?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 16:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1312624#M26939</guid>
      <dc:creator>LukeFloch</dc:creator>
      <dc:date>2023-07-27T16:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator power function error in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1312668#M26940</link>
      <description>&lt;P&gt;I actually figured out the problem, which was an incorrect use of the ^ operator. Turns out that ^ is an xOR boolean operator, and not an exponent, and I should be using the Exp () function in its place. I'm glad someone caught it for me, otherwise I would've wasted days of frustration&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://1921681254.mx/" target="_blank" rel="noopener"&gt;https://1921681254.mx/&lt;/A&gt;&lt;/SPAN&gt;. Lol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 16:56:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1312668#M26940</guid>
      <dc:creator>jeff9870</dc:creator>
      <dc:date>2023-07-31T16:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Raster calculator power function error in python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1324376#M26964</link>
      <description>&lt;P&gt;Unless I've missed some point, seems like overkill the way you are doing it, why not simply call the power tool directly, see python code sample &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/power.htm" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 14:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-calculator-power-function-error-in-python/m-p/1324376#M26964</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2023-08-31T14:56:21Z</dc:date>
    </item>
  </channel>
</rss>

