<?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: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78131#M6300</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From my previous persona, I have a number of blogs relating to raster/numpy stuff&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/blogs/dan_patterson/tags#/?tags=rastertonumpyarray" title="https://community.esri.com/blogs/dan_patterson/tags#/?tags=rastertonumpyarray"&gt;https://community.esri.com/blogs/dan_patterson/tags#/?tags=rastertonumpyarray&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Aug 2020 21:48:03 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-08-24T21:48:03Z</dc:date>
    <item>
      <title>Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78125#M6294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello community,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I have a python script which runs smoothly in ArcMap, however, when I try to run it in ArcGIS Pro (2.5.1 version) it slows down greatly.&amp;nbsp; I have run the code step by step and for some reason the tasks take considerably longer in Pro.&amp;nbsp; The code basically performs mathematical operations (e.g. multiple multiplication, Ln) over satellite images (rasters) and other calculations such as NDVI. I've tried using in-memory workspace, and managing the rasters in memory. I try to avoid that the rasters get saved on disk, but it still does not speed up the performance.&amp;nbsp; For example:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Zom = Raster(Exp ( -5.5 + 5.8 * NDVI ),&amp;nbsp; r"memory\Zom")&lt;BR /&gt;canopy = Raster(Zom / 0.136, r"memory\canopy")&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;But this code still runs very slow in Pro.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I will appreciate any clue about this issue. Thank you in advance for sharing any experience or feedback&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 05:37:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78125#M6294</guid>
      <dc:creator>JoseIgnacio</dc:creator>
      <dc:date>2020-08-17T05:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78126#M6295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/get-started/arcgis-pro-system-requirements.htm" title="https://pro.arcgis.com/en/pro-app/get-started/arcgis-pro-system-requirements.htm"&gt;ArcGIS Pro 2.6 system requirements—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you run the link to check your computer's ability to run ArcGIS Pro?&amp;nbsp; (You can check older versions of Pro as well)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Recommended" would be considered the minimum.&amp;nbsp; The amount by which your computer exceeds this would be important.&amp;nbsp; Ram and GPU are important.&lt;/P&gt;&lt;P&gt;Also, clear Pro's 'cache' from the project backstage.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 07:40:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78126#M6295</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-08-17T07:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78127#M6296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply...&amp;nbsp; Yes... the computer meets all the requirements...&amp;nbsp; and I still have the same issue... any other ideas?...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clearing the Pro's 'cache' from the project backstage helped just a bit with the execution time, and it is still very slow compared with the ArcGIS Map performance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 18:56:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78127#M6296</guid>
      <dc:creator>JoseIgnacio</dc:creator>
      <dc:date>2020-08-24T18:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78128#M6297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/418102"&gt;Jose Ignacio&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;It was marked as Assumed Answered, so I thought you were done with the issue.&lt;/P&gt;&lt;P&gt;You also don't indicate how "slow" the operation takes.&amp;nbsp; Anything more than a minute is related to your system and comparing to arcmap doesn't help.&amp;nbsp; Pro 2.6 is quite speedy, so that might be a suggestion then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a final note, I normally do such simple calculations in numpy (using RasterToNumPyArray) since it is blazingly fast and return the resultant to arcpy using NumPyArrayToRaster.&amp;nbsp; You can account for nodata values quite simply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 19:20:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78128#M6297</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-08-24T19:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78129#M6298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan for your quick help... I marked it as answered by mistake.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My python script has approximately 271 lines of codes. Many operations over raster are computed really fast like 1-2 minutes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, other parts are very slow taking like 1 hour long to execute only 4 lines of code, for example: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;t26 = time.time()&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;U = Raster(( 0.41 * var) / ( Ln (( Z_Blend - Dis_Ht ) / Zom ) - var1 + var2 ), r"memory\Ustar_2")&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;ReStar_2 = Raster(0.009 * U / var3, r"memory\ReStar_2")&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;Ct_star_2 =&amp;nbsp; Raster(( 0.71 ** ( - 2 / 3 )) *&amp;nbsp; ( ReStar_2 ** -0.5 ), r"memory\Ct_star_2")&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;term2_2 = Raster(Con ( Zom == 0, 0, (( 2 * Conopy_cov * fs * 0.41 * U_Uh * ( Zom / Ht_Canopy )) / Ct_star_2 )), r"memory\term2_2")&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12px;"&gt;&lt;EM&gt;print("execution time: ", round((time.time()-t26)/60, 2)) #&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;All the variables are raster. Maybe, are the conditionals (Con) time consuming?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Thank you &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 20:56:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78129#M6298</guid>
      <dc:creator>JoseIgnacio</dc:creator>
      <dc:date>2020-08-24T20:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78130#M6299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Btw... I am gonna try RasterToNumPyArray&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 20:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78130#M6299</guid>
      <dc:creator>JoseIgnacio</dc:creator>
      <dc:date>2020-08-24T20:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78131#M6300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From my previous persona, I have a number of blogs relating to raster/numpy stuff&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/blogs/dan_patterson/tags#/?tags=rastertonumpyarray" title="https://community.esri.com/blogs/dan_patterson/tags#/?tags=rastertonumpyarray"&gt;https://community.esri.com/blogs/dan_patterson/tags#/?tags=rastertonumpyarray&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Aug 2020 21:48:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78131#M6300</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-08-24T21:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Please help: Python code that runs smoothly in ArcMap gets very slow in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78132#M6301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Dan!... I have still problems with my code... I was not able to run the RasterToNumPyArray option...&amp;nbsp;&amp;nbsp; I am posting a new question with more detailed explanation.. in case you wanna help!.. thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2020 09:54:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/please-help-python-code-that-runs-smoothly-in/m-p/78132#M6301</guid>
      <dc:creator>JoseIgnacio</dc:creator>
      <dc:date>2020-09-07T09:54:24Z</dc:date>
    </item>
  </channel>
</rss>

