<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://climate-cms.wikis.unsw.edu.au/index.php?action=history&amp;feed=atom&amp;title=CodeBreak_02%2F03%2F2022</id>
	<title>CodeBreak 02/03/2022 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://climate-cms.wikis.unsw.edu.au/index.php?action=history&amp;feed=atom&amp;title=CodeBreak_02%2F03%2F2022"/>
	<link rel="alternate" type="text/html" href="http://climate-cms.wikis.unsw.edu.au/index.php?title=CodeBreak_02/03/2022&amp;action=history"/>
	<updated>2026-12-06T12:43:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>http://climate-cms.wikis.unsw.edu.au/index.php?title=CodeBreak_02/03/2022&amp;diff=3459&amp;oldid=prev</id>
		<title>C.carouge at 23:03, 22 March 2022</title>
		<link rel="alternate" type="text/html" href="http://climate-cms.wikis.unsw.edu.au/index.php?title=CodeBreak_02/03/2022&amp;diff=3459&amp;oldid=prev"/>
		<updated>2022-03-22T23:03:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 23:03, 22 March 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;&amp;#160; font-family:Arial;&amp;#160; color:#434343;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Copying global attributes from NetCDF&lt;/del&gt;&amp;lt;/span&amp;gt; =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;&amp;#160; font-family:Arial;&amp;#160; color:#434343;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Installing Python Package -- &lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[https://bitbucket.org/lbl-cascade/climextremes-dev/src/master/ &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;&amp;#160; font-family:Arial;&amp;#160; color:#1155cc;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:underline;&amp;#160; -webkit-text-decoration-skip:none;&amp;#160; text-decoration-skip-ink:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;climextRemes&amp;lt;/span&amp;gt;] &lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;There was a question where data was converted using a python notebook and xarray&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;but the global attributes of the input file should be copied over &lt;/del&gt;to the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;output file.&lt;/del&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;When importing climextRemes for the first time&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;it tries &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;install R libraries. This fails at some point with &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;error message:&lt;/ins&gt;&amp;lt;/span&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The new file was saved using the line&lt;/del&gt;&amp;lt;/span&amp;gt;&amp;amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;KeyError: 'title'&lt;/ins&gt;&amp;lt;/span&amp;gt; &amp;amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;pre&amp;gt;pr.to_dataset(name='pr').to_netcdf(&amp;lt;filename&amp;gt;)&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;We recommended to do &lt;/del&gt;it &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;in two steps, and add &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;copying of &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;attributes in between&lt;/del&gt;:&amp;lt;/span&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Digging deeper, &lt;/ins&gt;it &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;turns out that &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;bug is known to &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;developer&lt;/ins&gt;:&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ds &lt;/del&gt;= &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pr&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;to_dataset(name=&lt;/del&gt;'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pr&lt;/del&gt;'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;) &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;blockquote&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ds&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;attrs = f.attrs &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:&lt;/ins&gt;pre&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;-wrap&amp;quot;&amp;gt;Finally note that we recently discovered that climextremes is incompatible with recent versions of rpy2 (&lt;/ins&gt;&amp;gt;= &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;3.4.1)&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;While we are fixing this, if you get the error KeyError: &lt;/ins&gt;'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;title&lt;/ins&gt;' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;when importing climextremes in Python, please force installation of an older rpy2&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/span&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ds.to_netcddf(&lt;/del&gt;&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;filename&lt;/del&gt;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;)&lt;/del&gt;&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/blockquote&lt;/ins&gt;&amp;gt; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;Pinning the version of rpy2 using the conda environment yaml file below works:&lt;/ins&gt;&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;span&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;= &lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;13.999999999999998pt&lt;/del&gt;;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;434343&lt;/del&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Calculating differential in xarray&lt;/del&gt;&amp;lt;/span&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;11pt&lt;/ins&gt;;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;000000&lt;/ins&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;name: cliextremes&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;The question revolved around calculating the differential of the density (⍴) with respect to the depth (&amp;lt;/span&amp;gt;&lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:'&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Times &lt;/del&gt;New &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Roman&lt;/del&gt;';&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;z&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;). Attempting this calculation using np.gradient led to broadcasting errors. It is much easier to use an xarray aware function like &amp;lt;/span&amp;gt;[https://xarray.pydata.org/en/stable/generated/xarray.DataArray.differentiate.html &amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#1155cc;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:underline;&amp;#160; -webkit-text-decoration-skip:none;&amp;#160; text-decoration-skip-ink:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;xarray.differentiate&amp;lt;/span&amp;gt;]&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;pre-wrap&amp;quot;&amp;gt;, which knows how to broadcast because of the named coordinates and uses the spacing in the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:'Times New Roman';&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;coordinate to properly calculate the differential δ⍴/δ&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:'Times New Roman';&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;.&lt;/del&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:'&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Courier &lt;/ins&gt;New';&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;channels&lt;/ins&gt;:&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;= &lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;13.999999999999998pt&lt;/del&gt;;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;434343&lt;/del&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Regression analysis on spatial data&lt;/del&gt;&amp;lt;/span&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;11pt&lt;/ins&gt;;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;000000&lt;/ins&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&amp;amp;nbsp;- cascade&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The question was about the suitability of using &lt;/del&gt;&amp;lt;/span&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[https://xarray.pydata.org/en/stable/generated/xarray.DataArray.polyfit.html?highlight=polyfit &lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1155cc&lt;/del&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;underline&lt;/del&gt;;&amp;#160; -&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;webkit&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;text&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;decoration&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;skip&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;none&lt;/del&gt;;&amp;#160; text-decoration&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-skip-ink&lt;/del&gt;:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;xarray.Dataset.polyfit&lt;/del&gt;&amp;lt;/span&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;to do regression analysis on spatial data&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This might not be the correct tool, as it has limited options for the fitting function. If more than a simple fit is required, it might be better to use something like &lt;/del&gt;&amp;lt;/span&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[https://sklearn-xarray.readthedocs.io/en/latest/auto_examples/plot_linear_regression.html &lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1155cc&lt;/del&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;underline&lt;/del&gt;;&amp;#160; -&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;webkit&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;text&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;decoration&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;skip&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;none&lt;/del&gt;;&amp;#160; text-decoration&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-skip-ink&lt;/del&gt;:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sklearn&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;xarray&lt;/del&gt;&amp;lt;/span&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;or wrap &lt;/del&gt;&amp;lt;/span&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[https://stackoverflow.com/questions/62105673/applying-stats-linregress-to-every-grid-cell-in-a-netcdf-file &lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Arial&lt;/del&gt;;&amp;#160; color:#&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1155cc&lt;/del&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;underline&lt;/del&gt;;&amp;#160; -&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;webkit&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;text&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;decoration&lt;/del&gt;-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;skip&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;none&lt;/del&gt;;&amp;#160; text-decoration&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;-skip-ink&lt;/del&gt;:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;scipy.stats.lingress&lt;/del&gt;&amp;lt;/span&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;in &lt;/del&gt;a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;function and apply this &lt;/del&gt;to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;all points&lt;/del&gt;.&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&amp;amp;nbsp;- conda-forge&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;000000&lt;/ins&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;none&lt;/ins&gt;;&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;vertical&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;align:baseline;&amp;#160; white&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;- defaults&amp;lt;/span&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:'Courier New';&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;style:normal;&amp;#160; font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variant&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;normal&lt;/ins&gt;;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dependencies:&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&amp;amp;nbsp;- python&amp;gt;=3&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;9&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;000000&lt;/ins&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;none;&amp;#160; vertical-align:baseline&lt;/ins&gt;;&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&lt;/ins&gt;- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jupyterlab&amp;lt;/span&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;span style=&amp;quot;font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;size:11pt;&amp;#160; font-family:'Courier New';&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;style:normal;&amp;#160; font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variant&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;normal&lt;/ins&gt;;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&amp;amp;nbsp;&lt;/ins&gt;- &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;rpy2==3.3.6&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;nbsp;&amp;amp;nbsp;- pytest&lt;/ins&gt;&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'Courier New'&lt;/ins&gt;;&amp;#160; color:#&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;000000&lt;/ins&gt;;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;none;&amp;#160; vertical-align:baseline&lt;/ins&gt;;&amp;#160; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;white&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;space:pre;&amp;#160; white-space:pre&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;wrap&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;- climextremes&amp;lt;/span&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;&amp;#160; font-family:Arial;&amp;#160; color:#434343;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;style:normal;&amp;#160; font&lt;/ins&gt;-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;variant&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;normal&lt;/ins&gt;;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Understand and use a Fortran program&lt;/ins&gt;&amp;lt;/span&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;span style=&amp;quot;font-size:11pt;&amp;#160; font-family:Arial;&amp;#160; color:#000000;&amp;#160; background-color:transparent;&amp;#160; font-weight:400;&amp;#160; font-style:normal;&amp;#160; font-variant:normal;&amp;#160; text-decoration:none;&amp;#160; vertical-align:baseline;&amp;#160; white-space:pre;&amp;#160; white-space:pre-wrap&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The person had a Fortran program given to him to reproduce an analysis from a paper. They needed help to understand how to use the program. After having &lt;/ins&gt;a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;look at it, we came to the conclusion they would need &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;get more information from the authors of the software. Mostly, the program was lacking information on the many arguments needed as inputs&lt;/ins&gt;.&amp;lt;/span&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>C.carouge</name></author>
		
	</entry>
	<entry>
		<id>http://climate-cms.wikis.unsw.edu.au/index.php?title=CodeBreak_02/03/2022&amp;diff=3457&amp;oldid=prev</id>
		<title>C.carouge: Created page with &quot; = &lt;span style=&quot;font-size:13.999999999999998pt;  font-family:Arial;  color:#434343;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;...&quot;</title>
		<link rel="alternate" type="text/html" href="http://climate-cms.wikis.unsw.edu.au/index.php?title=CodeBreak_02/03/2022&amp;diff=3457&amp;oldid=prev"/>
		<updated>2022-03-22T22:59:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; = &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;  font-family:Arial;  color:#434343;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
= &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;  font-family:Arial;  color:#434343;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;Copying global attributes from NetCDF&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;There was a question where data was converted using a python notebook and xarray, but the global attributes of the input file should be copied over to the output file.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;The new file was saved using the line&amp;lt;/span&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&amp;lt;pre&amp;gt;pr.to_dataset(name='pr').to_netcdf(&amp;lt;filename&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;We recommended to do it in two steps, and add the copying of the attributes in between:&amp;lt;/span&amp;gt; &amp;amp;nbsp;&lt;br /&gt;
&amp;lt;pre&amp;gt;ds = pr.to_dataset(name='pr') &lt;br /&gt;
ds.attrs = f.attrs &lt;br /&gt;
ds.to_netcddf(&amp;lt;filename&amp;gt;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;  font-family:Arial;  color:#434343;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;Calculating differential in xarray&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;The question revolved around calculating the differential of the density (⍴) with respect to the depth (&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:'Times New Roman';  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;). Attempting this calculation using np.gradient led to broadcasting errors. It is much easier to use an xarray aware function like &amp;lt;/span&amp;gt;[https://xarray.pydata.org/en/stable/generated/xarray.DataArray.differentiate.html &amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#1155cc;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:underline;  -webkit-text-decoration-skip:none;  text-decoration-skip-ink:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;xarray.differentiate&amp;lt;/span&amp;gt;]&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;, which knows how to broadcast because of the named coordinates and uses the spacing in the &amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:'Times New Roman';  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;coordinate to properly calculate the differential δ⍴/δ&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:'Times New Roman';  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span style=&amp;quot;font-size:13.999999999999998pt;  font-family:Arial;  color:#434343;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;Regression analysis on spatial data&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;The question was about the suitability of using &amp;lt;/span&amp;gt;[https://xarray.pydata.org/en/stable/generated/xarray.DataArray.polyfit.html?highlight=polyfit &amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#1155cc;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:underline;  -webkit-text-decoration-skip:none;  text-decoration-skip-ink:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;xarray.Dataset.polyfit&amp;lt;/span&amp;gt;]&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;to do regression analysis on spatial data. This might not be the correct tool, as it has limited options for the fitting function. If more than a simple fit is required, it might be better to use something like &amp;lt;/span&amp;gt;[https://sklearn-xarray.readthedocs.io/en/latest/auto_examples/plot_linear_regression.html &amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#1155cc;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:underline;  -webkit-text-decoration-skip:none;  text-decoration-skip-ink:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;sklearn-xarray&amp;lt;/span&amp;gt;]&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;or wrap &amp;lt;/span&amp;gt;[https://stackoverflow.com/questions/62105673/applying-stats-linregress-to-every-grid-cell-in-a-netcdf-file &amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#1155cc;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:underline;  -webkit-text-decoration-skip:none;  text-decoration-skip-ink:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;scipy.stats.lingress&amp;lt;/span&amp;gt;]&amp;lt;span style=&amp;quot;font-size:11pt;  font-family:Arial;  color:#000000;  background-color:transparent;  font-weight:400;  font-style:normal;  font-variant:normal;  text-decoration:none;  vertical-align:baseline;  white-space:pre;  white-space:pre-wrap&amp;quot;&amp;gt;in a function and apply this to all points.&amp;lt;/span&amp;gt;&lt;/div&gt;</summary>
		<author><name>C.carouge</name></author>
		
	</entry>
</feed>