<?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: Finding sum of values in floating point raster in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288167#M16529</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bill,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any reason to expect that the zonal statistics function (using a "zone" raster mask where all zone values are the same) will use single precision?&amp;nbsp; When I do it that way (use a raster layer that simply has values of "1" for all cells overlaying my original raster), the "sum" I get seems reasonable.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 May 2010 21:06:55 GMT</pubDate>
    <dc:creator>MarkAndersen1</dc:creator>
    <dc:date>2010-05-11T21:06:55Z</dc:date>
    <item>
      <title>Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288161#M16523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to find the quickest way (in terms of processing speed) to find the total (sum) of all values in a raster.&amp;nbsp; In other words, I am looking for a tool that will add the value for all cells within a particular raster, and just give me that value as a number.&amp;nbsp; Ideally, this would spit out a table with just one row, as the "Get Raster Properties" tool does.&amp;nbsp; The "Get Raster Properties" tool in the "Raster Properties" toolbox in ArcToolbox looks like it is very close, in that it provides summary statistics for a raster, but there are two problems: 1) there is not an option for "sum"; and 2) it appears to round-off the answer to 6 decimal places, and I need much greater precision than that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only way I've found to do this is to use the "Zonal Statistics As Table" tool and set a dummy "zone" raster that has a single value ("1") for all pixels covering my study area, so that it is finding the statistics (including sum) for all cells in the raster.&amp;nbsp; However, this is pretty slow--mostly because I think it's comparing each pixel to see which zone it's in.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems that there should be a built-in way to get a sum of all cell values in a raster.&amp;nbsp; Help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 19:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288161#M16523</guid>
      <dc:creator>MarkAndersen1</dc:creator>
      <dc:date>2010-05-10T19:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288162#M16524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I should also mention that I need to do this with over 2,000 grids, so I'm hoping for something that's easy to batch either in Model Builder or simply by using the batch functionality of ArcToolbox.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 19:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288162#M16524</guid>
      <dc:creator>MarkAndersen1</dc:creator>
      <dc:date>2010-05-10T19:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288163#M16525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;presuming that the mean in Get Raster Properties is determined from the sum divideded by the number of cells (avg = sum/N), then perhaps you could exploit COLUMNCOUNT * ROWCOUNT to determine N.&amp;nbsp; This would not of course work if there are nodata cells in the raster, and I would suggest that you explore this since there is no indication in the help whether nodata values are accounted for when calculating the statistical properties&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 20:15:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288163#M16525</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2010-05-10T20:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288164#M16526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dan--I thought of that. The problem is that the mean that is given by the "Get Raster Properties" is rounded to 6 decimal places. My grids contain very small values, and over 400,000,000 cells, so any rounding error at all means that such a multiplication would produce erroneous results.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 May 2010 20:28:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288164#M16526</guid>
      <dc:creator>MarkAndersen1</dc:creator>
      <dc:date>2010-05-10T20:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288165#M16527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, large grid...presuming that the output is a table, perhaps, the display is just set to 6 decimal points.&amp;nbsp; If you had any capabilities to get the raster out to a numpy array, then the summation is simple (raster shown as a list of lists)&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; import numpy
&amp;gt;&amp;gt;&amp;gt; a = numpy.array([[1,1],[2,2]])
&amp;gt;&amp;gt;&amp;gt; a.sum()
6
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;and all your conversion could be done to arrays using Python as your programming platform&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:55:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288165#M16527</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T13:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288166#M16528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bill,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The number of significant digits far exceeds the number of decimal places being shown.&amp;nbsp; For example, a value of 0.000000045821&amp;nbsp; is a valid value (a probability density function, where the probability for all cells across the study area sum to 1), but would be rounded to 0.000000 as it's being displayed when I use the Get Raster Properties.&amp;nbsp; When I sum the grid values, if there is this much rounding in the calculations, they will sum to much less than 1.&amp;nbsp; That's what I mean by erroneous.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do most of my scripting with VBA. Is this something that might be better done with Python?&amp;nbsp; I haven't done much scripting with rasters, so I'm not sure how to access the values for individual cells. Any samples you have handy for something like this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 13:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288166#M16528</guid>
      <dc:creator>MarkAndersen1</dc:creator>
      <dc:date>2010-05-11T13:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Finding sum of values in floating point raster</title>
      <link>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288167#M16529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bill,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any reason to expect that the zonal statistics function (using a "zone" raster mask where all zone values are the same) will use single precision?&amp;nbsp; When I do it that way (use a raster layer that simply has values of "1" for all cells overlaying my original raster), the "sum" I get seems reasonable.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 May 2010 21:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/finding-sum-of-values-in-floating-point-raster/m-p/288167#M16529</guid>
      <dc:creator>MarkAndersen1</dc:creator>
      <dc:date>2010-05-11T21:06:55Z</dc:date>
    </item>
  </channel>
</rss>

