Skip to content

Commit

Permalink
Updated tutorial with more possible errors
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBurek committed Dec 6, 2024
1 parent b1de3ea commit 6f51741
Showing 1 changed file with 50 additions and 24 deletions.
74 changes: 50 additions & 24 deletions tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
<li class="toctree-l3"><a class="reference internal" href="#error-because-python-is-not-added-to-the-path">Error because python is not added to the PATH</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-the-path-has-white-spaces-included">Error because the path has white spaces included</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-the-python-libraries-are-installed-incorrectly">Error because the python libraries are installed incorrectly</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-the-settings-file-is-not-stored-as-utf-8-file">Error because the settings file is not stored as utf-8 file</a></li>
<li class="toctree-l3"><a class="reference internal" href="#error-because-the-references-are-used-wrong">Error because the references are used wrong</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#running-the-model-1">Running the model 1</a></li>
Expand Down Expand Up @@ -248,21 +250,23 @@ <h1><a class="toc-backref" href="#id3"><span class="section-number">5. </span>Tu
<li><p><a class="reference internal" href="#error-because-python-is-not-added-to-the-path" id="id14">Error because python is not added to the PATH</a></p></li>
<li><p><a class="reference internal" href="#error-because-the-path-has-white-spaces-included" id="id15">Error because the path has white spaces included</a></p></li>
<li><p><a class="reference internal" href="#error-because-the-python-libraries-are-installed-incorrectly" id="id16">Error because the python libraries are installed incorrectly</a></p></li>
<li><p><a class="reference internal" href="#error-because-the-settings-file-is-not-stored-as-utf-8-file" id="id17">Error because the settings file is not stored as utf-8 file</a></p></li>
<li><p><a class="reference internal" href="#error-because-the-references-are-used-wrong" id="id18">Error because the references are used wrong</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#running-the-model-1" id="id17">Running the model 1</a></p></li>
<li><p><a class="reference internal" href="#downloading-and-installing-the-spatial-dataset" id="id18">Downloading and installing the spatial dataset</a></p></li>
<li><p><a class="reference internal" href="#changing-the-settings-file" id="id19">Changing the Settings file</a></p></li>
<li><p><a class="reference internal" href="#error-and-exception-handling" id="id20">Error and exception handling</a></p></li>
<li><p><a class="reference internal" href="#running-the-model-2" id="id21">Running the model 2</a></p></li>
<li><p><a class="reference internal" href="#changing-parameters-of-the-model" id="id22">Changing parameters of the model</a></p></li>
<li><p><a class="reference internal" href="#changing-the-output" id="id23">Changing the Output</a></p>
<li><p><a class="reference internal" href="#running-the-model-1" id="id19">Running the model 1</a></p></li>
<li><p><a class="reference internal" href="#downloading-and-installing-the-spatial-dataset" id="id20">Downloading and installing the spatial dataset</a></p></li>
<li><p><a class="reference internal" href="#changing-the-settings-file" id="id21">Changing the Settings file</a></p></li>
<li><p><a class="reference internal" href="#error-and-exception-handling" id="id22">Error and exception handling</a></p></li>
<li><p><a class="reference internal" href="#running-the-model-2" id="id23">Running the model 2</a></p></li>
<li><p><a class="reference internal" href="#changing-parameters-of-the-model" id="id24">Changing parameters of the model</a></p></li>
<li><p><a class="reference internal" href="#changing-the-output" id="id25">Changing the Output</a></p>
<ul>
<li><p><a class="reference internal" href="#output-variables" id="id24">Output variables</a></p></li>
<li><p><a class="reference internal" href="#daily-monthly-at-the-end-or-average" id="id25">Daily, monthly - at the end or average</a></p></li>
<li><p><a class="reference internal" href="#time-series-as-point-infomation-or-catchment-sum-or-average" id="id26">Time series as point infomation or catchment sum or average</a></p></li>
<li><p><a class="reference internal" href="#most-important-output-variables-a-selection" id="id27">Most important output variables - a selection</a></p></li>
<li><p><a class="reference internal" href="#a-list-of-all-variables" id="id28">A list of all variables</a></p></li>
<li><p><a class="reference internal" href="#output-variables" id="id26">Output variables</a></p></li>
<li><p><a class="reference internal" href="#daily-monthly-at-the-end-or-average" id="id27">Daily, monthly - at the end or average</a></p></li>
<li><p><a class="reference internal" href="#time-series-as-point-infomation-or-catchment-sum-or-average" id="id28">Time series as point infomation or catchment sum or average</a></p></li>
<li><p><a class="reference internal" href="#most-important-output-variables-a-selection" id="id29">Most important output variables - a selection</a></p></li>
<li><p><a class="reference internal" href="#a-list-of-all-variables" id="id30">A list of all variables</a></p></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -442,9 +446,31 @@ <h3><a class="toc-backref" href="#id16">Error because the python libraries are i
</pre></div>
</div>
</div>
<div class="section" id="error-because-the-settings-file-is-not-stored-as-utf-8-file">
<h3><a class="toc-backref" href="#id17">Error because the settings file is not stored as utf-8 file</a><a class="headerlink" href="#error-because-the-settings-file-is-not-stored-as-utf-8-file" title="Permalink to this headline"></a></h3>
<p>If the model causing an error which look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="ne">UnicodeDecodeError</span><span class="p">:</span> <span class="s1">&#39;utf-8&#39;</span> <span class="n">codec</span> <span class="n">can</span><span class="s1">&#39;t decode byte 0x83 in position 1504: invalid start byte</span>
</pre></div>
</div>
<p>It is because the file was not stored as utf-8 (Unicode Transformation Format - 8-bit) file. This can happen if you use the Windows texteditor Wordpad or Notepad. We suggest you use Notepad++ and store the file as utf-8. Might happen too, if your language use strange characters like German Umlaut.</p>
</div>
<div class="section" id="error-because-the-references-are-used-wrong">
<h3><a class="toc-backref" href="#id18">Error because the references are used wrong</a><a class="headerlink" href="#error-because-the-references-are-used-wrong" title="Permalink to this headline"></a></h3>
<p>In the settingsfile we use references:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[FILE_PATHS]
PathRoot = C:\basin
PathMaps = $(PathRoot)/input
</pre></div>
</div>
<p>If you use the reference in the next section, you have to put in the section where you defined the reference. Here: FILE_PATHS:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[NETCDF_ATTRIBUTES]
metaNetcdfFile = $(FILE_PATHS:PathRoot)/metaNetcdf.xml
</pre></div>
</div>
</div>
</div>
<div class="section" id="running-the-model-1">
<h2><a class="toc-backref" href="#id17">Running the model 1</a><a class="headerlink" href="#running-the-model-1" title="Permalink to this headline"></a></h2>
<h2><a class="toc-backref" href="#id19">Running the model 1</a><a class="headerlink" href="#running-the-model-1" title="Permalink to this headline"></a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The model needs a settings file as an argument. See: <a class="reference internal" href="setup.html#rst-settingdoc"><span class="std std-ref">Settings file</span></a></p>
Expand All @@ -464,7 +490,7 @@ <h2><a class="toc-backref" href="#id17">Running the model 1</a><a class="headerl
</div>
</div>
<div class="section" id="downloading-and-installing-the-spatial-dataset">
<h2><a class="toc-backref" href="#id18">Downloading and installing the spatial dataset</a><a class="headerlink" href="#downloading-and-installing-the-spatial-dataset" title="Permalink to this headline"></a></h2>
<h2><a class="toc-backref" href="#id20">Downloading and installing the spatial dataset</a><a class="headerlink" href="#downloading-and-installing-the-spatial-dataset" title="Permalink to this headline"></a></h2>
<p>The spatial dataset contains:</p>
<ul class="simple">
<li><p>static data ie. data that does not change over time (a model assumption) e.g. soil data</p></li>
Expand Down Expand Up @@ -512,7 +538,7 @@ <h2><a class="toc-backref" href="#id18">Downloading and installing the spatial d
</div>
</div>
<div class="section" id="changing-the-settings-file">
<h2><a class="toc-backref" href="#id19">Changing the Settings file</a><a class="headerlink" href="#changing-the-settings-file" title="Permalink to this headline"></a></h2>
<h2><a class="toc-backref" href="#id21">Changing the Settings file</a><a class="headerlink" href="#changing-the-settings-file" title="Permalink to this headline"></a></h2>
<p>to run the model the pathes to data have to be set correctly:
The information of pathes are stored in the settings file around line 80-100</p>
<p>[FILE_PATHS]:</p>
Expand All @@ -533,12 +559,12 @@ <h2><a class="toc-backref" href="#id19">Changing the Settings file</a><a class="
</div>
</div>
<div class="section" id="error-and-exception-handling">
<span id="rst-output2"></span><h2><a class="toc-backref" href="#id20">Error and exception handling</a><a class="headerlink" href="#error-and-exception-handling" title="Permalink to this headline"></a></h2>
<span id="rst-output2"></span><h2><a class="toc-backref" href="#id22">Error and exception handling</a><a class="headerlink" href="#error-and-exception-handling" title="Permalink to this headline"></a></h2>
<p>We try to make our program behave properly when encountering unexpected conditions. Therefore we caption a number of possible wrong inputs.</p>
<p>If you get an output with an error number please look at <a class="reference internal" href="errorHandling.html#rst-error"><span class="std std-ref">Error handling</span></a></p>
</div>
<div class="section" id="running-the-model-2">
<h2><a class="toc-backref" href="#id21">Running the model 2</a><a class="headerlink" href="#running-the-model-2" title="Permalink to this headline"></a></h2>
<h2><a class="toc-backref" href="#id23">Running the model 2</a><a class="headerlink" href="#running-the-model-2" title="Permalink to this headline"></a></h2>
<p>If you type now:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">cwatm</span><span class="o">.</span><span class="n">py</span> <span class="n">settings_rhine</span><span class="o">.</span><span class="n">ini</span> <span class="o">-</span><span class="n">l</span>
</pre></div>
Expand Down Expand Up @@ -594,16 +620,16 @@ <h2><a class="toc-backref" href="#id21">Running the model 2</a><a class="headerl
<p>P.s. some error we captured and we give a hint. Please look at <a class="reference internal" href="errorHandling.html#rst-error"><span class="std std-ref">Error handling</span></a></p>
</div>
<div class="section" id="changing-parameters-of-the-model">
<h2><a class="toc-backref" href="#id22">Changing parameters of the model</a><a class="headerlink" href="#changing-parameters-of-the-model" title="Permalink to this headline"></a></h2>
<h2><a class="toc-backref" href="#id24">Changing parameters of the model</a><a class="headerlink" href="#changing-parameters-of-the-model" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>An overview of possibilities is given in see <a class="reference internal" href="setup.html#rst-settingdoc"><span class="std std-ref">Settings file</span></a></p>
</div>
</div>
<div class="section" id="changing-the-output">
<h2><a class="toc-backref" href="#id23">Changing the Output</a><a class="headerlink" href="#changing-the-output" title="Permalink to this headline"></a></h2>
<h2><a class="toc-backref" href="#id25">Changing the Output</a><a class="headerlink" href="#changing-the-output" title="Permalink to this headline"></a></h2>
<div class="section" id="output-variables">
<h3><a class="toc-backref" href="#id24">Output variables</a><a class="headerlink" href="#output-variables" title="Permalink to this headline"></a></h3>
<h3><a class="toc-backref" href="#id26">Output variables</a><a class="headerlink" href="#output-variables" title="Permalink to this headline"></a></h3>
<p>Output can be every global defined variable in the model
Variable are e.g. Precipitation, runoff, baseflow</p>
<p>but also not so common variables as:</p>
Expand All @@ -615,7 +641,7 @@ <h3><a class="toc-backref" href="#id24">Output variables</a><a class="headerlink
</ul>
</div>
<div class="section" id="daily-monthly-at-the-end-or-average">
<h3><a class="toc-backref" href="#id25">Daily, monthly - at the end or average</a><a class="headerlink" href="#daily-monthly-at-the-end-or-average" title="Permalink to this headline"></a></h3>
<h3><a class="toc-backref" href="#id27">Daily, monthly - at the end or average</a><a class="headerlink" href="#daily-monthly-at-the-end-or-average" title="Permalink to this headline"></a></h3>
<ul class="simple">
<li><p>per day</p></li>
<li><p>total month, average month, end of month</p></li>
Expand Down Expand Up @@ -646,7 +672,7 @@ <h3><a class="toc-backref" href="#id25">Daily, monthly - at the end or average</
</div>
</div>
<div class="section" id="time-series-as-point-infomation-or-catchment-sum-or-average">
<h3><a class="toc-backref" href="#id26">Time series as point infomation or catchment sum or average</a><a class="headerlink" href="#time-series-as-point-infomation-or-catchment-sum-or-average" title="Permalink to this headline"></a></h3>
<h3><a class="toc-backref" href="#id28">Time series as point infomation or catchment sum or average</a><a class="headerlink" href="#time-series-as-point-infomation-or-catchment-sum-or-average" title="Permalink to this headline"></a></h3>
<p>As standard time series can include values of the specific cell as defined in the settings file as <em>Gauges</em>
But time series can also show the area sum or area average of the upstream catchment from the specific cell</p>
<p>for example</p>
Expand All @@ -663,7 +689,7 @@ <h3><a class="toc-backref" href="#id26">Time series as point infomation or catch
</div>
</div>
<div class="section" id="most-important-output-variables-a-selection">
<h3><a class="toc-backref" href="#id27">Most important output variables - a selection</a><a class="headerlink" href="#most-important-output-variables-a-selection" title="Permalink to this headline"></a></h3>
<h3><a class="toc-backref" href="#id29">Most important output variables - a selection</a><a class="headerlink" href="#most-important-output-variables-a-selection" title="Permalink to this headline"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">#Variable name : Description</span>
<span class="n">discharge</span> <span class="p">:</span> <span class="n">river</span> <span class="n">discharge</span>
<span class="n">runoff</span> <span class="p">:</span> <span class="n">runoff</span>
Expand All @@ -678,7 +704,7 @@ <h3><a class="toc-backref" href="#id27">Most important output variables - a sele
</div>
</div>
<div class="section" id="a-list-of-all-variables">
<h3><a class="toc-backref" href="#id28">A list of all variables</a><a class="headerlink" href="#a-list-of-all-variables" title="Permalink to this headline"></a></h3>
<h3><a class="toc-backref" href="#id30">A list of all variables</a><a class="headerlink" href="#a-list-of-all-variables" title="Permalink to this headline"></a></h3>
<p>We started a list of possible output variables. Please note that this list is under construction. We still need to fill in all descriptions and all units.
You find this list at <a class="reference internal" href="listVariables.html#rst-variables"><span class="std std-ref">List of output variables</span></a></p>
</div>
Expand Down

0 comments on commit 6f51741

Please sign in to comment.