Index: documentation/Sphinx/build/html/_modules/disaggregation.html
===================================================================
--- documentation/Sphinx/build/html/_modules/disaggregation.html	(revision 708c6674550abec09bd249f6654698bdeaed17d0)
+++ documentation/Sphinx/build/html/_modules/disaggregation.html	(revision 2625ca8faac35d65699e83e37bb42cdc24163490)
@@ -170,30 +170,34 @@
 <span class="c1">#        - outsourced the disaggregation functions dapoly and darain</span>
 <span class="c1">#          to a new module named disaggregation</span>
+<span class="c1">#        - added the new disaggregation method for precipitation</span>
 <span class="c1">#</span>
 <span class="c1"># @License:</span>
-<span class="c1">#    (C) Copyright 2015-2018.</span>
+<span class="c1">#    (C) Copyright 2014-2019.</span>
+<span class="c1">#    Anne Philipp, Leopold Haimberger</span>
 <span class="c1">#</span>
-<span class="c1">#    This software is licensed under the terms of the Apache Licence Version 2.0</span>
-<span class="c1">#    which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.</span>
+<span class="c1">#    This work is licensed under the Creative Commons Attribution 4.0</span>
+<span class="c1">#    International License. To view a copy of this license, visit</span>
+<span class="c1">#    http://creativecommons.org/licenses/by/4.0/ or send a letter to</span>
+<span class="c1">#    Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.</span>
 <span class="c1">#</span>
-<span class="c1"># @Module Description:</span>
-<span class="c1">#    disaggregation of deaccumulated flux data from an ECMWF model FG field.</span>
-<span class="c1">#    Initially the flux data to be concerned are:</span>
-<span class="c1">#    - large-scale precipitation</span>
-<span class="c1">#    - convective precipitation</span>
-<span class="c1">#    - surface sensible heat flux</span>
-<span class="c1">#    - surface solar radiation</span>
-<span class="c1">#    - u stress</span>
-<span class="c1">#    - v stress</span>
-<span class="c1">#    Different versions of disaggregation is provided for rainfall</span>
-<span class="c1">#    data (darain, modified linear) and the surface fluxes and</span>
-<span class="c1">#    stress data (dapoly, cubic polynomial).</span>
-<span class="c1">#</span>
-<span class="c1"># @Module Content:</span>
+<span class="c1"># @Methods:</span>
 <span class="c1">#    - dapoly</span>
 <span class="c1">#    - darain</span>
 <span class="c1">#    - IA3</span>
-<span class="c1">#</span>
 <span class="c1">#*******************************************************************************</span>
+<span class="sd">&#39;&#39;&#39;Disaggregation of deaccumulated flux data from an ECMWF model FG field.</span>
+
+<span class="sd">Initially the flux data to be concerned are:</span>
+<span class="sd">    - large-scale precipitation</span>
+<span class="sd">    - convective precipitation</span>
+<span class="sd">    - surface sensible heat flux</span>
+<span class="sd">    - surface solar radiation</span>
+<span class="sd">    - u stress</span>
+<span class="sd">    - v stress</span>
+
+<span class="sd">Different versions of disaggregation is provided for rainfall</span>
+<span class="sd">data (darain, modified linear) and the surface fluxes and</span>
+<span class="sd">stress data (dapoly, cubic polynomial).</span>
+<span class="sd">&#39;&#39;&#39;</span>
 
 <span class="c1"># ------------------------------------------------------------------------------</span>
@@ -218,5 +222,5 @@
 <span class="sd">    Parameters</span>
 <span class="sd">    ----------</span>
-<span class="sd">    alist : :obj:`list` of :obj:`array` of :obj:`float`</span>
+<span class="sd">    alist : list of array of float</span>
 <span class="sd">        List of 4 timespans as 2-dimensional, horizontal fields.</span>
 <span class="sd">        E.g. [[array_t1], [array_t2], [array_t3], [array_t4]]</span>
@@ -224,5 +228,5 @@
 <span class="sd">    Return</span>
 <span class="sd">    ------</span>
-<span class="sd">    nfield : :obj:`array` of :obj:`float`</span>
+<span class="sd">    nfield : array of float</span>
 <span class="sd">        Interpolated flux at central point of accumulation timespan.</span>
 
@@ -262,5 +266,5 @@
 <span class="sd">    Parameters</span>
 <span class="sd">    ----------</span>
-<span class="sd">    alist : :obj:`list` of :obj:`array` of :obj:`float`</span>
+<span class="sd">    alist : list of array of float</span>
 <span class="sd">        List of 4 timespans as 2-dimensional, horizontal fields.</span>
 <span class="sd">        E.g. [[array_t1], [array_t2], [array_t3], [array_t4]]</span>
@@ -268,5 +272,5 @@
 <span class="sd">    Return</span>
 <span class="sd">    ------</span>
-<span class="sd">    nfield : :obj:`array` of :obj:`float`</span>
+<span class="sd">    nfield : array of float</span>
 <span class="sd">        Interpolated flux at central point of accumulation timespan.</span>
 
@@ -313,5 +317,5 @@
 <span class="sd">    Note</span>
 <span class="sd">    ----</span>
-<span class="sd">    Copyright 2017</span>
+<span class="sd">    (C) Copyright 2017-2019</span>
 <span class="sd">    Sabine Hittmeir, Anne Philipp, Petra Seibert</span>
 
@@ -323,5 +327,5 @@
 <span class="sd">    Parameters</span>
 <span class="sd">    ----------</span>
-<span class="sd">    g : :obj:`list` of :obj:`float`</span>
+<span class="sd">    g : list of float</span>
 <span class="sd">        Complete data series that will be interpolated having</span>
 <span class="sd">        the dimension of the original raw series.</span>
@@ -329,5 +333,5 @@
 <span class="sd">    Return</span>
 <span class="sd">    ------</span>
-<span class="sd">    f : :obj:`list` of :obj:`float`</span>
+<span class="sd">    f : list of float</span>
 <span class="sd">        The interpolated data series with additional subgrid points.</span>
 <span class="sd">        Its dimension is equal to the length of the input data series</span>
@@ -363,5 +367,5 @@
 
     <span class="c1"># time step</span>
-    <span class="n">dt</span><span class="o">=</span><span class="mf">1.0</span>
+    <span class="n">dt</span> <span class="o">=</span> <span class="mf">1.0</span>
 
     <span class="c1">############### Non-negative Geometric Mean Based Algorithm ###############</span>
@@ -370,5 +374,5 @@
     <span class="c1"># the value at t=0 of the interpolation algorithm coincides with the</span>
     <span class="c1"># first data value according to the persistence hypothesis</span>
-    <span class="n">f</span><span class="o">=</span><span class="p">[</span><span class="n">g</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span>
+    <span class="n">f</span> <span class="o">=</span> <span class="p">[</span><span class="n">g</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span>
 
     <span class="c1"># compute two first sub-grid intervals without monotonicity check</span>
@@ -376,5 +380,5 @@
     <span class="c1"># points and interpolate the corresponding data values</span>
     <span class="c1"># except for the last interval due to boundary conditions</span>
-    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">2</span><span class="p">):</span>
+    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">):</span>
 
         <span class="c1"># as a requirement:</span>
@@ -382,6 +386,6 @@
         <span class="c1"># interval in f has to be zero to such that f[i+1]=f[i+2]=f[i+3]=0</span>
         <span class="c1"># according to Eq. (6)</span>
-        <span class="k">if</span> <span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">==</span><span class="mf">0.</span><span class="p">:</span>
-            <span class="n">f</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">])</span>
+        <span class="k">if</span> <span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="mf">0.</span><span class="p">:</span>
+            <span class="n">f</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="mf">0.</span><span class="p">,</span> <span class="mf">0.</span><span class="p">,</span> <span class="mf">0.</span><span class="p">])</span>
 
         <span class="c1"># otherwise the sub-grid values are calculated and added to the list</span>
@@ -398,9 +402,9 @@
             <span class="c1"># the function value at the first sub-grid point (fi1) is determined</span>
             <span class="c1"># according to the equal area condition with Eq. (19)</span>
-            <span class="n">fi1</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fip1</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fi</span>
+            <span class="n">fi1</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fip1</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fi</span>
 
             <span class="c1"># the function value at the second sub-grid point (fi2) is determined</span>
             <span class="c1"># according Eq. (18)</span>
-            <span class="n">fi2</span><span class="o">=</span><span class="n">fi1</span><span class="o">+</span><span class="mf">1.</span><span class="o">/</span><span class="mf">3.</span><span class="o">*</span><span class="p">(</span><span class="n">fip1</span><span class="o">-</span><span class="n">fi</span><span class="p">)</span>
+            <span class="n">fi2</span> <span class="o">=</span> <span class="n">fi1</span><span class="o">+</span><span class="mf">1.</span><span class="o">/</span><span class="mf">3.</span><span class="o">*</span><span class="p">(</span><span class="n">fip1</span><span class="o">-</span><span class="n">fi</span><span class="p">)</span>
 
             <span class="c1"># add next interval of interpolated (sub-)grid values</span>
@@ -413,5 +417,5 @@
     <span class="c1"># points and interpolate the corresponding data values</span>
     <span class="c1"># except for the last interval due to boundary conditions</span>
-    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="nb">len</span><span class="p">(</span><span class="n">g</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">):</span>
+    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">g</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">):</span>
 
         <span class="c1"># as a requirement:</span>
@@ -419,10 +423,10 @@
         <span class="c1"># interval in f has to be zero to such that f[i+1]=f[i+2]=f[i+3]=0</span>
         <span class="c1"># according to Eq. (6)</span>
-        <span class="k">if</span> <span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">==</span><span class="mf">0.</span><span class="p">:</span>
+        <span class="k">if</span> <span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="mf">0.</span><span class="p">:</span>
             <span class="c1"># apply monotonicity filter for interval before</span>
             <span class="c1"># check if there is &quot;M&quot; or &quot;W&quot; shape</span>
-            <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span><span class="p">:</span>
+            <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
 
                 <span class="c1"># the monotonicity filter corrects the value at (fim1) by</span>
@@ -436,9 +440,9 @@
                 <span class="c1"># interval boundaries (fi) and (fip2) remains unchanged</span>
                 <span class="c1"># see Eq. (18) and (19)</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">=</span><span class="n">fmon</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span> <span class="n">fmon</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
 
             <span class="n">f</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">])</span>
@@ -453,19 +457,19 @@
             <span class="c1"># geometric mean, restricted such that non-negativity is guaranteed</span>
             <span class="c1"># according to Eq. (25)</span>
-            <span class="n">fip1</span><span class="o">=</span><span class="nb">min</span><span class="p">(</span> <span class="mf">3.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="p">,</span> <span class="mf">3.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span> <span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="p">)</span>
+            <span class="n">fip1</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span> <span class="mf">3.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="p">,</span> <span class="mf">3.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span> <span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="p">)</span>
 
             <span class="c1"># the function value at the first sub-grid point (fi1) is determined</span>
             <span class="c1"># according to the equal area condition with Eq. (19)</span>
-            <span class="n">fi1</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fip1</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fi</span>
+            <span class="n">fi1</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fip1</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fi</span>
 
             <span class="c1"># the function value at the second sub-grid point (fi2) is determined</span>
             <span class="c1"># according Eq. (18)</span>
-            <span class="n">fi2</span><span class="o">=</span><span class="n">fi1</span><span class="o">+</span><span class="mf">1.</span><span class="o">/</span><span class="mf">3.</span><span class="o">*</span><span class="p">(</span><span class="n">fip1</span><span class="o">-</span><span class="n">fi</span><span class="p">)</span>
+            <span class="n">fi2</span> <span class="o">=</span> <span class="n">fi1</span><span class="o">+</span><span class="mf">1.</span><span class="o">/</span><span class="mf">3.</span><span class="o">*</span><span class="p">(</span><span class="n">fip1</span><span class="o">-</span><span class="n">fi</span><span class="p">)</span>
 
             <span class="c1"># apply monotonicity filter for interval before</span>
             <span class="c1"># check if there is &quot;M&quot; or &quot;W&quot; shape</span>
-            <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span><span class="p">:</span>
+            <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+               <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
 
                 <span class="c1"># the monotonicity filter corrects the value at (fim1) by</span>
@@ -479,9 +483,9 @@
                 <span class="c1"># interval boundaries (fi) and (fip2) remains unchanged</span>
                 <span class="c1"># see Eq. (18) and (19)</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">=</span><span class="n">fmon</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
-                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span> <span class="n">fmon</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
+                <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
 
             <span class="c1"># add next interval of interpolated (sub-)grid values</span>
@@ -496,10 +500,10 @@
     <span class="c1"># interval in f has to be zero to such that f[i+1]=f[i+2]=f[i+3]=0</span>
     <span class="c1"># according to Eq. (6)</span>
-    <span class="k">if</span> <span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">==</span><span class="mf">0.</span><span class="p">:</span>
+    <span class="k">if</span> <span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="mf">0.</span><span class="p">:</span>
         <span class="c1"># apply monotonicity filter for interval before</span>
         <span class="c1"># check if there is &quot;M&quot; or &quot;W&quot; shape</span>
-        <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span><span class="p">:</span>
+        <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
 
             <span class="c1"># the monotonicity filter corrects the value at (fim1) by</span>
@@ -513,9 +517,9 @@
             <span class="c1"># interval boundaries (fi) and (fip2) remains unchanged</span>
             <span class="c1"># see Eq. (18) and (19)</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">=</span><span class="n">fmon</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span> <span class="n">fmon</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
 
         <span class="n">f</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">])</span>
@@ -538,7 +542,7 @@
         <span class="c1"># apply monotonicity filter for interval before</span>
         <span class="c1"># check if there is &quot;M&quot; or &quot;W&quot; shape</span>
-        <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span> \
-           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span><span class="o">==-</span><span class="mi">1</span><span class="p">:</span>
+        <span class="k">if</span>     <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span> \
+           <span class="ow">and</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">])</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">])</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">:</span>
 
             <span class="c1"># the monotonicity filter corrects the value at (fim1) by</span>
@@ -552,9 +556,9 @@
             <span class="c1"># interval boundaries (fi) and (fip2) remains unchanged</span>
             <span class="c1"># see Eq. (18) and (19)</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span><span class="o">=</span><span class="n">fmon</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">=</span><span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
-            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">=</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">4</span><span class="p">]</span> <span class="o">=</span> <span class="n">fmon</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">]</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">5</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">6</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">fmon</span><span class="o">-</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">])</span><span class="o">/</span><span class="mf">3.</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.</span><span class="o">/</span><span class="mf">2.</span><span class="o">*</span><span class="n">g</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span><span class="o">-</span><span class="mf">5.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="mf">1.</span><span class="o">/</span><span class="mf">12.</span><span class="o">*</span><span class="n">fmon</span>
+            <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">3</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="n">f</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">-</span><span class="n">fmon</span><span class="p">)</span><span class="o">/</span><span class="mf">3.</span>
 
         <span class="c1"># add next interval of interpolated (sub-)grid values</span>
@@ -576,5 +580,5 @@
   <div role="contentinfo">
     <p>
-        &copy; Copyright 2018, Anne Philipp and Leopold Haimberger.
+        &copy; Copyright 2018, Anne Philipp and Leopold Haimberger
 
     </p>
@@ -595,19 +599,11 @@
   
 
-    <script type="text/javascript">
-        var DOCUMENTATION_OPTIONS = {
-            URL_ROOT:'../',
-            VERSION:'7.1 alpha',
-            LANGUAGE:'None',
-            COLLAPSE_INDEX:false,
-            FILE_SUFFIX:'.html',
-            HAS_SOURCE:  true,
-            SOURCELINK_SUFFIX: '.txt'
-        };
-    </script>
-      <script type="text/javascript" src="../_static/jquery.js"></script>
-      <script type="text/javascript" src="../_static/underscore.js"></script>
-      <script type="text/javascript" src="../_static/doctools.js"></script>
-      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    
+    
+      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+        <script type="text/javascript" src="../_static/jquery.js"></script>
+        <script type="text/javascript" src="../_static/underscore.js"></script>
+        <script type="text/javascript" src="../_static/doctools.js"></script>
+    
 
   
