<?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 Calculate Correlation and P-value between rasters in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689941#M53456</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ I have used this script and got two rasters&amp;nbsp; "correlation" and "pearson".&amp;nbsp;Which one is the P-value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Branched from&amp;nbsp;&lt;A href="https://community.esri.com/thread/200534-re-correlation-between-two-different-rasters"&gt;https://community.esri.com/thread/200534-re-correlation-between-two-different-rasters&lt;/A&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jul 2019 05:15:40 GMT</pubDate>
    <dc:creator>margaritastevia</dc:creator>
    <dc:date>2019-07-03T05:15:40Z</dc:date>
    <item>
      <title>Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689941#M53456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ I have used this script and got two rasters&amp;nbsp; "correlation" and "pearson".&amp;nbsp;Which one is the P-value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Branched from&amp;nbsp;&lt;A href="https://community.esri.com/thread/200534-re-correlation-between-two-different-rasters"&gt;https://community.esri.com/thread/200534-re-correlation-between-two-different-rasters&lt;/A&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2019 05:15:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689941#M53456</guid>
      <dc:creator>margaritastevia</dc:creator>
      <dc:date>2019-07-03T05:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689942#M53457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neither, p-value is a measure of the strength of the correlation coefficient calculated from sample size and the measured 'r' and a sampling distribution&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html" title="https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html" rel="nofollow noopener noreferrer" target="_blank"&gt;scipy.stats.pearsonr — SciPy v1.3.0 Reference Guide&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example for variants of simple arrays, using this&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; scipy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; stats

a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;arange&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
c &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# ---- like b, but 2 numbers switched&lt;/SPAN&gt;

r&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stats&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pearsonr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# ---- perfect inverse, r = -1, p = 0.0000&lt;/SPAN&gt;
r&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p_val
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1.0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

r&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stats&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pearsonr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; c&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
r&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p_val
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0.9833333333333333&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1.936196303745927e-06&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689942#M53457</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T05:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689943#M53458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to extract the pixels where correlation is positive and p-value is &amp;lt; 0.05 How i can do that? How i can estimate P as a raster?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jul 2019 05:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689943#M53458</guid>
      <dc:creator>margaritastevia</dc:creator>
      <dc:date>2019-07-04T05:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689944#M53459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ please help me with how i can extract correlation values at 0.05 significance level.&amp;nbsp;I'm running out of time.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 05:38:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689944#M53459</guid>
      <dc:creator>margaritastevia</dc:creator>
      <dc:date>2019-07-08T05:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689945#M53460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/margaritastevia"&gt;margaritastevia&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share a sample of your data and the script you have so far?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 13:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689945#M53460</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-07-08T13:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689946#M53461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander Bakker,&lt;/P&gt;&lt;P&gt; Thank you very much for your kind response. please find the attachment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jul 2019 15:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689946#M53461</guid>
      <dc:creator>margaritastevia</dc:creator>
      <dc:date>2019-07-08T15:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689947#M53462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/368733" target="_blank"&gt;margarita stevia&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you validate if this works for you? I will create the additional p-value raster and a mask raster containing the pixels with value 1 where the condition (p-value &amp;lt;= 0.05 and positive correlation) is met. The calculation of the p-value is based on the code provided by&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3116" target="_blank"&gt;Dan Patterson&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the resulting&amp;nbsp;areas (blue pixels)&amp;nbsp;are near the rivers . Does that make sense?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/452670_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See code below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;main&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"load modules..."&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np
    template1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\Pvalue\Send\NDVI\r{0}_WUE.TIF'&lt;/SPAN&gt;
    template2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\Pvalue\Send\temp\r{0}_TEM.TIF'&lt;/SPAN&gt;
    nodata &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3.4028235e+38&lt;/SPAN&gt;
    out_ras_corr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\Pvalue\Send\Results\correlation_v01.TIF'&lt;/SPAN&gt;
    out_ras_pear &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\Pvalue\Send\Results\pearson_v01.TIF'&lt;/SPAN&gt;
    out_ras_pval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\Pvalue\Send\Results\pvalue_v01.TIF'&lt;/SPAN&gt;
    out_ras_mask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\GeoNet\Pvalue\Send\Results\mask_v01.TIF'&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;# settings&lt;/SPAN&gt;
    max_pval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0.05&lt;/SPAN&gt;
    min_corr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
    mask_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
    no_mask_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"create nested numpy array list..."&lt;/SPAN&gt;
    lst_np_ras &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        ras_path1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; template1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%03d"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ras_path1
        ras_np1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RasterToNumPyArray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_path1&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        ras_path2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; template2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%03d"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ras_path2
        ras_np2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RasterToNumPyArray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_path2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        lst_np_ras&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ras_np1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ras_np2&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"read props numpy raster..."&lt;/SPAN&gt;
    ras_np &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; lst_np_ras&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;# take first numpy array from list&lt;/SPAN&gt;
    rows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ras_np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    cols &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ras_np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - rows:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; rows
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - cols:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"create output numpy array..."&lt;/SPAN&gt;
    ras_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; template1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%03d"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    raster &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ras_np_res_corr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ndarray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rows&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ras_np_res_pear &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ndarray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rows&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ras_np_res_pval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ndarray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rows&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    ras_np_res_mask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ndarray&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rows&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cols&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - out rows:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ras_np_res_corr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - out cols:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; ras_np_res_corr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"loop through pixels..."&lt;/SPAN&gt;
    pix_cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rows&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; col &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cols&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            pix_cnt &lt;SPAN class="operator token"&gt;+=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; pix_cnt &lt;SPAN class="operator token"&gt;%&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5000&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - row:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"  col:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"  pixel:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; pix_cnt
            lst_vals1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
            lst_vals2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lst_pars &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lst_np_ras&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                    lst_vals1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_pars&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                    lst_vals2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_pars&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                lst_vals1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ReplaceNoData&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_vals1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                lst_vals2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ReplaceNoData&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_vals2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                &lt;SPAN class="comment token"&gt;# perform calculation on list&lt;/SPAN&gt;
                correlation &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; CalculateCorrelation&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_vals1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lst_vals2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                ras_np_res_corr&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; correlation
                pearson &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; CalculatePearsons&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_vals1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lst_vals2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                ras_np_res_pear&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pearson
                pvalue &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; CalculatePvalue&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst_vals1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lst_vals2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                ras_np_res_pval&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pvalue
                &lt;SPAN class="comment token"&gt;# compare correlation and p-value&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; pvalue &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                    mask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; nodata
                &lt;SPAN class="keyword token"&gt;elif&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;correlation &lt;SPAN class="operator token"&gt;&amp;gt;=&lt;/SPAN&gt; min_corr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pvalue &lt;SPAN class="operator token"&gt;&amp;lt;=&lt;/SPAN&gt; max_pval&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                    mask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mask_val
                &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                    mask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; no_mask_val
                ras_np_res_mask&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mask

            &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt; Exception &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ERR:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - row:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"  col:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; col&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"  pixel:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; pix_cnt
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - lst_vals1:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lst_vals1
                &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - lst_vals2:"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lst_vals2

    pnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;XMin&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;YMin&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#  - raster.meanCellHeight&lt;/SPAN&gt;
    xcellsize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;meanCellWidth
    ycellsize &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; raster&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;meanCellHeight

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Write output rasters..."&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_corr
    ras_res_corr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NumPyArrayToRaster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_np_res_corr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lower_left_corner&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;pnt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;xcellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                 y_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;ycellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; value_to_nodata&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyRaster_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_res_corr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_corr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefineProjection_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_dataset&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;out_ras_corr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; coor_system&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_pear
    ras_res_pear &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NumPyArrayToRaster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_np_res_pear&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lower_left_corner&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;pnt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;xcellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                 y_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;ycellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; value_to_nodata&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyRaster_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_res_pear&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_pear&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefineProjection_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_dataset&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;out_ras_pear&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; coor_system&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_pval
    ras_res_pval &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NumPyArrayToRaster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_np_res_pval&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lower_left_corner&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;pnt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;xcellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                 y_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;ycellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; value_to_nodata&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyRaster_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_res_pval&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_pval&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefineProjection_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_dataset&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;out_ras_pval&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; coor_system&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_mask
    ras_res_mask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NumPyArrayToRaster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_np_res_mask&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lower_left_corner&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;pnt&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; x_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;xcellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                                 y_cell_size&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;ycellsize&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; value_to_nodata&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyRaster_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ras_res_mask&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_ras_mask&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DefineProjection_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_dataset&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;out_ras_mask&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; coor_system&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CalculateCorrelation&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy
    &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        coef &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; numpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;corrcoef&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; coef&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; nodata


&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;ReplaceNoData&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lst&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    res &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; a &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lst&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt; nodata &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2.0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            res&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            res&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; res


&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CalculatePearsons&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np
    &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; scipy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stats &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; pearsonr
    &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        r&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pearsonr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; p
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; nodata

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CalculatePvalue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; b&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; nodata&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np
    &lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; scipy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;stats &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; stats
    &lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        r&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; p_val &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; stats&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;pearsonr&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; p_val
    &lt;SPAN class="keyword token"&gt;except&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; nodata



&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; __name__ &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'__main__'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    main&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689947#M53462</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-12T05:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689948#M53463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;print("Thank you")&lt;/P&gt;&lt;P&gt;Thank you Sir&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;.&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;I'm vary&amp;nbsp;&lt;/SPAN&gt;thankful&amp;nbsp;to you for&amp;nbsp;your kind response.&amp;nbsp;&lt;SPAN&gt;The script is running perfectly. Yes the pixels are near the river. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 06:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689948#M53463</guid>
      <dc:creator>margaritastevia</dc:creator>
      <dc:date>2019-07-10T06:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689949#M53464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/margaritastevia"&gt;margaritastevia&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad to hear that the script is producing the expected results. Good luck with you investigation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 12:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689949#M53464</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-07-10T12:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689950#M53465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Xander Bakker,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Glad to get the script of the correlation and P-value between rasters, but now I only have two rasters(ndvi and occurence of flooding). I can't&amp;nbsp; solve my question using the script above. I need calculate the correlation and p-value between two rasters not sets of rasters.&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;&lt;A href="https://community.esri.com/thread/236424"&gt;Calculate Correlation and P-value between rasters&lt;/A&gt;#My data is attached, need your help.&lt;/P&gt;&lt;P&gt;Best wishes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2019 14:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689950#M53465</guid>
      <dc:creator>YingyingZhang</dc:creator>
      <dc:date>2019-09-06T14:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689951#M53466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/zhangyywhigg"&gt;zhangyywhigg&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only have two data values (comparing each pixel between 2 rasters) you will have a perfect linear relationship and will have a result of -1 or +1, so that would not make much sense. What are you trying to obtain?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2019 22:34:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689951#M53466</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-09-06T22:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Correlation and P-value between rasters</title>
      <link>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689952#M53467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Xander Bakker,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have calculated the coefficient of correlation between two rasters using arcgis spatial analyst tool——multivariate——band collection statistics,and the result of coefficient wasn't the -1 or 1, but it got a .txt result. The problem I want to solve is to find the pixel-by-pixel correlation coefficients and&amp;nbsp;P-values between two layers.&amp;nbsp;I don't know whether the methods of &lt;SPAN&gt;band collection statistics&lt;/SPAN&gt;&amp;nbsp;is related to the direct calculation of the correlation between the two rasters. If the only two rasters will have a result of -1 or +1, what methods can&amp;nbsp;visualize the correlation between the two rasters?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Sep 2019 02:58:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-correlation-and-p-value-between-rasters/m-p/689952#M53467</guid>
      <dc:creator>YingyingZhang</dc:creator>
      <dc:date>2019-09-07T02:58:54Z</dc:date>
    </item>
  </channel>
</rss>

