<?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 RasterToNumpyArray not 64 bit even in background? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/rastertonumpyarray-not-64-bit-even-in-background/m-p/611690#M47743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In order to process some very large (16 billion cell) raster datasets, I'm attempting to use numpy to speed things up a bit. When I use&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000023000000" rel="nofollow noopener noreferrer" target="_blank"&gt; raster to numpy array&lt;/A&gt;&lt;SPAN&gt;, I get either following message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Traceback (most recent call last):
&amp;nbsp; File "C:\Users\i52974\ESRI_to_AIRGrid\py\ESRIGridToCSVv2_3.py", line 167, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; windowedData = raster.getNext()
&amp;nbsp; File "C:\Users\i52974\ESRI_to_AIRGrid\py\ESRIGridToCSVv2_3.py", line 110, in getNext
&amp;nbsp;&amp;nbsp;&amp;nbsp; return arcpy.RasterToNumPyArray(self.source, ll, ccount, self.yrows)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\__init__.py", line 1688, in RasterToNumPyArray
&amp;nbsp;&amp;nbsp;&amp;nbsp; return _RasterToNumPyArray(*args, **kwargs)
RuntimeError: ERROR 999998: Unexpected Error.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or a message telling me that 'python.exe has stopped working' depending on whether I run from within a script (error message) or the interactive window (python crash). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know that the first suggestion here is going to be that I'm out of memory. However I do not think that this is the case. I'm running this with on a 64 bit machine with the 64 bit background processing turned on. The information I have found doesn't seem to suggest that this would be an &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Background_Geoprocessing_64_bit/002100000040000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;unsupported tool&lt;/A&gt;&lt;SPAN&gt;. The environment I'm running in has 75 GB of memory available, and when I print sys.version from within the script I can see that 64 bit python running. Everything is specifically set up to test whether or not this is a viable option to speed up a task that is currently 8 + hours.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From testing, I know that the output type is numpy.int32 (determined by extracting just a few thousand rows and testing the type). In IDLE I can create arrays up to 135,000 x 135,000 using int32 (roughly 18 billion cells) before I get a MemoryError from numpy. That is, I can execute:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
x = numpy.ones((135000, 135000), numpy.int32)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;without any errors. I can't do anything particularly intense with it (uses up 96% of my available RAM), but I can put the data in memory without issue. The thing that is particularly curious is that even if I extract only a subset of the source dataset, I encounter the same error once I try and extract things in that are above 20,000 x 20,000 in size when I can see in the resource monitor that the resulting datasets before failure are taking up less than 5% of the available memory. This adds to my suspicion that RasterToNumPyArray() isn't running at 64 bit, partially because 5% of my memory would be the 4GB limit for memory in 32 bit Windows. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:10:15 GMT</pubDate>
    <dc:creator>DouglasSands</dc:creator>
    <dc:date>2021-12-12T02:10:15Z</dc:date>
    <item>
      <title>RasterToNumpyArray not 64 bit even in background?</title>
      <link>https://community.esri.com/t5/python-questions/rastertonumpyarray-not-64-bit-even-in-background/m-p/611690#M47743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In order to process some very large (16 billion cell) raster datasets, I'm attempting to use numpy to speed things up a bit. When I use&lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000023000000" rel="nofollow noopener noreferrer" target="_blank"&gt; raster to numpy array&lt;/A&gt;&lt;SPAN&gt;, I get either following message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Traceback (most recent call last):
&amp;nbsp; File "C:\Users\i52974\ESRI_to_AIRGrid\py\ESRIGridToCSVv2_3.py", line 167, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; windowedData = raster.getNext()
&amp;nbsp; File "C:\Users\i52974\ESRI_to_AIRGrid\py\ESRIGridToCSVv2_3.py", line 110, in getNext
&amp;nbsp;&amp;nbsp;&amp;nbsp; return arcpy.RasterToNumPyArray(self.source, ll, ccount, self.yrows)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\__init__.py", line 1688, in RasterToNumPyArray
&amp;nbsp;&amp;nbsp;&amp;nbsp; return _RasterToNumPyArray(*args, **kwargs)
RuntimeError: ERROR 999998: Unexpected Error.
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or a message telling me that 'python.exe has stopped working' depending on whether I run from within a script (error message) or the interactive window (python crash). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know that the first suggestion here is going to be that I'm out of memory. However I do not think that this is the case. I'm running this with on a 64 bit machine with the 64 bit background processing turned on. The information I have found doesn't seem to suggest that this would be an &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Background_Geoprocessing_64_bit/002100000040000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;unsupported tool&lt;/A&gt;&lt;SPAN&gt;. The environment I'm running in has 75 GB of memory available, and when I print sys.version from within the script I can see that 64 bit python running. Everything is specifically set up to test whether or not this is a viable option to speed up a task that is currently 8 + hours.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From testing, I know that the output type is numpy.int32 (determined by extracting just a few thousand rows and testing the type). In IDLE I can create arrays up to 135,000 x 135,000 using int32 (roughly 18 billion cells) before I get a MemoryError from numpy. That is, I can execute:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
x = numpy.ones((135000, 135000), numpy.int32)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;without any errors. I can't do anything particularly intense with it (uses up 96% of my available RAM), but I can put the data in memory without issue. The thing that is particularly curious is that even if I extract only a subset of the source dataset, I encounter the same error once I try and extract things in that are above 20,000 x 20,000 in size when I can see in the resource monitor that the resulting datasets before failure are taking up less than 5% of the available memory. This adds to my suspicion that RasterToNumPyArray() isn't running at 64 bit, partially because 5% of my memory would be the 4GB limit for memory in 32 bit Windows. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rastertonumpyarray-not-64-bit-even-in-background/m-p/611690#M47743</guid>
      <dc:creator>DouglasSands</dc:creator>
      <dc:date>2021-12-12T02:10:15Z</dc:date>
    </item>
  </channel>
</rss>

