<?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: Skewness of values from 10 raster images in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1042690#M11210</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Hi Deepa,&lt;/P&gt;&lt;P&gt;If I understand your inputs and analysis objective correctly, you can do this easily using the following workflow. You don't need to create numpy arrays or use any other python package.&lt;/P&gt;&lt;P&gt;Please make sure to use the correct formula for calculating skewness in the map algebra expression below.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Noman&lt;/P&gt;&lt;H6&gt;Nawajish Noman, PhD&lt;/H6&gt;&lt;H6&gt;&lt;FONT face="verdana,geneva"&gt;Sr. Principal Product Engineer, Product Engineering Lead&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT face="verdana,geneva"&gt;Esri, Redlands, CA.&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&amp;nbsp;&lt;/H6&gt;&lt;/BLOCKQUOTE&gt;&lt;H4&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Calculating Pearson's second skewness coefficient (median skewness)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Input&lt;/STRONG&gt;&lt;/FONT&gt;: 10 single band rasters or 1 multiband raster with 10 bands&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Steps (using Spatial Analyst tools and operators)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Run CellStatistics 3 times to create mean, median, and standard deviation outputs as &lt;FONT color="#FF6600"&gt;cs_mean&lt;/FONT&gt;, &lt;FONT color="#FF6600"&gt;cs_median&lt;/FONT&gt;, &lt;FONT color="#FF6600"&gt;cs_stddev&lt;/FONT&gt; respectively.&lt;/LI&gt;&lt;LI&gt;Execute the following map algebra expression in Raster Calculator or in Python using arcpy.sa molule.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT color="#FF6600"&gt;out_skewness&lt;/FONT&gt; = 3 * (&lt;FONT color="#FF6600"&gt;cs_mean&lt;/FONT&gt; – &lt;FONT color="#FF6600"&gt;cs_median&lt;/FONT&gt;) / &lt;FONT color="#FF6600"&gt;cs_stddev&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Mar 2021 23:34:47 GMT</pubDate>
    <dc:creator>NawajishNoman</dc:creator>
    <dc:date>2021-03-31T23:34:47Z</dc:date>
    <item>
      <title>Skewness of values from 10 raster images</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020089#M11122</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using ArcMap 10.8 version. I have 10 raster files with different data ranging from 0 to 1 for the same study area. I am interested to study how the data from 10 raster files are distributed in each pixel.&lt;/P&gt;&lt;P&gt;I want to calculate the skewness of the data in each pixels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can this be done in ArcMap?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 16:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020089#M11122</guid>
      <dc:creator>Deepa</dc:creator>
      <dc:date>2021-01-26T16:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Skewness of values from 10 raster images</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020137#M11123</link>
      <description>&lt;P&gt;Local statistics&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/spatial-analyst/cell-statistics.htm" target="_blank"&gt;Cell Statistics (Spatial Analyst)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;can easily give you mean, median and standard deviation.&lt;/P&gt;&lt;P&gt;How difficult the next step would be would depend on which measure of skewness you wanted&lt;/P&gt;&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/Skewness" target="_blank"&gt;Skewness - Wikipedia&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Pearson's second skewness coefficient might suffice&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 17:37:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020137#M11123</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-26T17:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Skewness of values from 10 raster images</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020174#M11124</link>
      <description>&lt;P&gt;better solution,&lt;/P&gt;&lt;P&gt;get your multilayer raster out to a numpy array (RasterToNumPyArray), then use scipy's skew function&lt;/P&gt;&lt;LI-CODE lang="python"&gt;a = np.random.random_sample((10, 4, 3))  # 10 layer/band raster with 4 cols 3 rows
from scipy.stats import skew

sk_a = skew(a, axis=0)  # Calculate skewness over axis 0  ie local statistic
a0 = a[:, 0, 0]   # upper left corner over 10 layers
sk_a0 = skew(a0)  # check the skewness for the upper left over the 10 layers

sk_a
array([[-0.55202903,  0.9026473 , -0.22097936],
       [ 0.05148204, -0.6512716 ,  0.16846484],
       [ 0.93081464,  0.00802005,  0.04495503],
       [-0.37445255,  0.18772049, -0.10078703]])

sk_a0  # confirm axis 0 calculation
 -0.5520290295549968&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 18:43:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020174#M11124</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-26T18:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Skewness of values from 10 raster images</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020286#M11125</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/194032"&gt;@Deepa&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI&lt;/P&gt;&lt;P&gt;You can also bring the results back in.&amp;nbsp; In this example, I created a 10 "band" raster in NumPy and brought it back into ArcGIS Pro&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="numpyarraytoraster04.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4615iA23C479B4B1EF4A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="numpyarraytoraster04.png" alt="numpyarraytoraster04.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you can bring it back to numpy&lt;/P&gt;&lt;LI-CODE lang="python"&gt;b = arcpy.RasterToNumPyArray(pth)
b.shape
(10, 10, 10)

(a == b).all(-1) # ---- equality check, to make sure input and outputs are equal
array([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
       [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 23:30:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1020286#M11125</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-01-26T23:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Skewness of values from 10 raster images</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1042690#M11210</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Hi Deepa,&lt;/P&gt;&lt;P&gt;If I understand your inputs and analysis objective correctly, you can do this easily using the following workflow. You don't need to create numpy arrays or use any other python package.&lt;/P&gt;&lt;P&gt;Please make sure to use the correct formula for calculating skewness in the map algebra expression below.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Noman&lt;/P&gt;&lt;H6&gt;Nawajish Noman, PhD&lt;/H6&gt;&lt;H6&gt;&lt;FONT face="verdana,geneva"&gt;Sr. Principal Product Engineer, Product Engineering Lead&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&lt;FONT face="verdana,geneva"&gt;Esri, Redlands, CA.&lt;/FONT&gt;&lt;/H6&gt;&lt;H6&gt;&amp;nbsp;&lt;/H6&gt;&lt;/BLOCKQUOTE&gt;&lt;H4&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Calculating Pearson's second skewness coefficient (median skewness)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Input&lt;/STRONG&gt;&lt;/FONT&gt;: 10 single band rasters or 1 multiband raster with 10 bands&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Steps (using Spatial Analyst tools and operators)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Run CellStatistics 3 times to create mean, median, and standard deviation outputs as &lt;FONT color="#FF6600"&gt;cs_mean&lt;/FONT&gt;, &lt;FONT color="#FF6600"&gt;cs_median&lt;/FONT&gt;, &lt;FONT color="#FF6600"&gt;cs_stddev&lt;/FONT&gt; respectively.&lt;/LI&gt;&lt;LI&gt;Execute the following map algebra expression in Raster Calculator or in Python using arcpy.sa molule.&lt;/LI&gt;&lt;/OL&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;FONT color="#FF6600"&gt;out_skewness&lt;/FONT&gt; = 3 * (&lt;FONT color="#FF6600"&gt;cs_mean&lt;/FONT&gt; – &lt;FONT color="#FF6600"&gt;cs_median&lt;/FONT&gt;) / &lt;FONT color="#FF6600"&gt;cs_stddev&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 23:34:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/skewness-of-values-from-10-raster-images/m-p/1042690#M11210</guid>
      <dc:creator>NawajishNoman</dc:creator>
      <dc:date>2021-03-31T23:34:47Z</dc:date>
    </item>
  </channel>
</rss>

