<?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: Correlation between rainfall and temperature anomaly in Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426342#M33467</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;‌,&lt;/P&gt;&lt;P&gt;Sorry for late reply, I tried to prepared the data and example to better understand the process and output that I want to achieve.&lt;/P&gt;&lt;P&gt;So this is two different data and the correlation is not based on the distance. I will explain more details below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to see general sensitivity of rainfall in a country to sea surface temperature (SST) changes of NINO-3.4 region in Pacific. Why Pacific? Because this region is optimal for monitoring El Nino-Southern Oscillation and its impacts in Southeast Asia.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple regression equation is applied to indicate the correlation between rainfall anomaly in each area to anomaly of SST in Pacific Ocean which represent ENSO signals.&lt;BR /&gt;Y = a + bX, where:&lt;BR /&gt;Y = Rainfall anomaly&lt;BR /&gt;a = Y intercept&lt;BR /&gt;b = Slope&lt;BR /&gt;X = SST anomaly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From this approach (in this case, I used Timor-Leste as an example) and the map, we can say Timor-Leste is heavily affected by El Niño which is associated with a rise in SST, negatively impacting rainfall in much of the country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Slope" class="image-1 jive-image j-img-original" src="/legacyfs/online/429321_Screen Shot 2018-11-12 at 19.02.13.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the map, I tried manual process using spreadsheet - &lt;A class="link-titled" href="https://cl.ly/2a8f747c9c26" title="https://cl.ly/2a8f747c9c26"&gt;precip_sst_regression.xlsx&lt;/A&gt;&amp;nbsp;, I convert monthly rainfall anomaly raster data - &lt;A class="link-titled" href="https://cl.ly/9204d375d08c" title="https://cl.ly/9204d375d08c"&gt;tls_precip_anomaly.zip&lt;/A&gt;&amp;nbsp;&amp;nbsp;to csv and calculate the regression between rainfall anomaly and SST anomaly -&amp;nbsp;&lt;A class="link-titled" href="https://cl.ly/4e7bd396b1df" title="https://cl.ly/4e7bd396b1df"&gt;sst_anom.csv&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this help and how to use your script above in my case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Nov 2018 12:22:58 GMT</pubDate>
    <dc:creator>BennyIstanto</dc:creator>
    <dc:date>2018-11-12T12:22:58Z</dc:date>
    <item>
      <title>Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426340#M33465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;This question has been branched from this question:&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/198969-trend-analysis-through-time-series-of-raster-data"&gt;https://community.esri.com/thread/198969-trend-analysis-through-time-series-of-raster-data&lt;/A&gt;&amp;nbsp;to give it more visibility&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dear &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌ and &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt; thank you for the awesome discussion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have different case. Let say I have raster timeseries for monthly rainfall anomaly data from 1981-2017 for 1 province. And then I have sea surface temperature anomaly data for the same periods and from 1 location only (text data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to see the correlation between both data (rainfall and temperature anomaly) for each pixel in raster data. Is it possible to do this using above script? I want to have sets of raster (slope, intercept, r value, p value and std error) as an output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From this output I hope I can see if the temperature increase in the Pacific, which area will experience more/less rainfall.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Benny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 03:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426340#M33465</guid>
      <dc:creator>BennyIstanto</dc:creator>
      <dc:date>2018-11-02T03:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426341#M33466</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/59704"&gt;Benny Istanto&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understand correctly you have a single location with sea surface temperature anomaly data that should be related to every pixel of each raster. Does the location represent each pixel in the raster? Should a certain distance be considered for the raster to&amp;nbsp;have a correlation with the sea surface location?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 22:50:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426341#M33466</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-11-02T22:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426342#M33467</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;‌,&lt;/P&gt;&lt;P&gt;Sorry for late reply, I tried to prepared the data and example to better understand the process and output that I want to achieve.&lt;/P&gt;&lt;P&gt;So this is two different data and the correlation is not based on the distance. I will explain more details below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to see general sensitivity of rainfall in a country to sea surface temperature (SST) changes of NINO-3.4 region in Pacific. Why Pacific? Because this region is optimal for monitoring El Nino-Southern Oscillation and its impacts in Southeast Asia.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple regression equation is applied to indicate the correlation between rainfall anomaly in each area to anomaly of SST in Pacific Ocean which represent ENSO signals.&lt;BR /&gt;Y = a + bX, where:&lt;BR /&gt;Y = Rainfall anomaly&lt;BR /&gt;a = Y intercept&lt;BR /&gt;b = Slope&lt;BR /&gt;X = SST anomaly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From this approach (in this case, I used Timor-Leste as an example) and the map, we can say Timor-Leste is heavily affected by El Niño which is associated with a rise in SST, negatively impacting rainfall in much of the country.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Slope" class="image-1 jive-image j-img-original" src="/legacyfs/online/429321_Screen Shot 2018-11-12 at 19.02.13.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the map, I tried manual process using spreadsheet - &lt;A class="link-titled" href="https://cl.ly/2a8f747c9c26" title="https://cl.ly/2a8f747c9c26"&gt;precip_sst_regression.xlsx&lt;/A&gt;&amp;nbsp;, I convert monthly rainfall anomaly raster data - &lt;A class="link-titled" href="https://cl.ly/9204d375d08c" title="https://cl.ly/9204d375d08c"&gt;tls_precip_anomaly.zip&lt;/A&gt;&amp;nbsp;&amp;nbsp;to csv and calculate the regression between rainfall anomaly and SST anomaly -&amp;nbsp;&lt;A class="link-titled" href="https://cl.ly/4e7bd396b1df" title="https://cl.ly/4e7bd396b1df"&gt;sst_anom.csv&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this help and how to use your script above in my case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Nov 2018 12:22:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426342#M33467</guid>
      <dc:creator>BennyIstanto</dc:creator>
      <dc:date>2018-11-12T12:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426343#M33468</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/59704"&gt;Benny Istanto&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the additional explanation and sharing the data.&amp;nbsp;This will take some time to analyze. I just came back from Dallas (GeoConX) and next week I will be at our Ecuador office, so it might take some time before I can provide a useful answer, but I will definitely look into it.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2018 13:41:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426343#M33468</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-11-13T13:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426344#M33469</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;‌&lt;/P&gt;&lt;P&gt;I have tried to simplify the input data. See attached: &lt;A href="https://www.dropbox.com/s/mrt79sxmkcr6084/tls_rainanom.zip?dl=0"&gt;rainfall anomaly&lt;/A&gt;&amp;nbsp;and &lt;A href="https://www.dropbox.com/s/7j165mfwj17gg9s/tls_sstanom.zip?dl=0"&gt;sst anomaly&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Both folder (rainfall and sst) have 444 geotiff. For SST, I have created constant raster, and its have same dimension with rainfall anomaly, the value is following data in sst_anom.csv in my previous answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using your script in the different thread, how to do pixel-wise regression between two sets of raster timeseries?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 08:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426344#M33469</guid>
      <dc:creator>BennyIstanto</dc:creator>
      <dc:date>2018-12-19T08:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426345#M33470</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/59704"&gt;Benny Istanto&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing the simplified data. I haven't&amp;nbsp;had the time to look into it, since it is a "little" hectic here at the end of the year, but I haven't forgotten about it. I dowwloaded the data and will start soon to give it a try. Thanks for your patience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if a regression based on two values will yield&amp;nbsp;a good result, but I would have to look into this to see what the result will be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see in the "other" thread (&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/thread/198969-trend-analysis-through-time-series-of-raster-data#comment-711148" title="https://community.esri.com/thread/198969-trend-analysis-through-time-series-of-raster-data#comment-711148"&gt;https://community.esri.com/thread/198969-trend-analysis-through-time-series-of-raster-data#comment-711148&lt;/A&gt;&amp;nbsp;) you can access the raster(s) with&amp;nbsp;arcpy.RasterToNumPyArray(ras_path), get the number of rows and columns using the shape of the&amp;nbsp;array like this:&lt;/P&gt;&lt;P&gt;rows = ras_np.shape[0]&lt;BR /&gt; cols = ras_np.shape[1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on this you can create a loop through the rows and columns to access each pixel in multiple rasters (two in your case) and do something with these values and write the&amp;nbsp; result to a new numpy array which will be converted to a raster at the end. I will have to look into the data to see if a regression based on two values makes sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 12:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426345#M33470</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-12-19T12:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Correlation between rainfall and temperature anomaly in Python</title>
      <link>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426346#M33471</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/59704"&gt;Benny Istanto&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;I gave this some more thought and&amp;nbsp;&lt;/SPAN&gt;still come to the conclusion that having 444 regression rasters will make it hard to define a conclusion of the analysis. If the sequence of rasters is indeed a sequence of values through time, maybe it would be better to loop through the 444 raster, on a pixel level determine the difference between the &lt;STRONG&gt;rainanom&lt;/STRONG&gt; raster and the corresponding &lt;STRONG&gt;sstanom&lt;/STRONG&gt; raster and determine the regression values for the sequence of 444 differences on a pixel level. Does that make sense? With some modifications to the script this should be possible to achieve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 12:29:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/correlation-between-rainfall-and-temperature/m-p/426346#M33471</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-01-11T12:29:03Z</dc:date>
    </item>
  </channel>
</rss>

