Skip to content
Snippets Groups Projects
samir_params.html 20.1 KiB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Preparing the SAMIR parameter csv file &mdash; modspa-pixel 0.1 documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../_static/graphviz.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../_static/jquery.js?v=5d32c60e"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="../_static/documentation_options.js?v=2709fde1"></script>
        <script src="../_static/doctools.js?v=888ff710"></script>
        <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Run the SAMIR model" href="../samir/run_samir.html" />
    <link rel="prev" title="Preparing the soil data raster" href="soil_data.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            modspa-pixel
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../setup/setup.html">Setting up the correct environnment and parameters</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="input_preparation.html">Preparing the inputs for Modspa-Pixel</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="ndvi_cube.html">Preparing the NDVI data cube</a></li>
<li class="toctree-l2"><a class="reference internal" href="weather_cube.html">Preparing the weather data cube</a></li>
<li class="toctree-l2"><a class="reference internal" href="land_cover.html">Preparing the land cover raster</a></li>
<li class="toctree-l2"><a class="reference internal" href="soil_data.html">Preparing the soil data raster</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Preparing the SAMIR parameter csv file</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#modspa_pixel.parameters.params_samir_class.samir_parameters"><code class="docutils literal notranslate"><span class="pre">samir_parameters</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="#modspa_pixel.parameters.params_samir_class.samir_parameters.__init__"><code class="docutils literal notranslate"><span class="pre">samir_parameters.__init__()</span></code></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../samir/run_samir.html">Run the SAMIR model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../file_structure.html">Project file structure</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">modspa-pixel</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="input_preparation.html">Preparing the inputs for Modspa-Pixel</a></li>
      <li class="breadcrumb-item active">Preparing the SAMIR parameter csv file</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/preprocessing/samir_params.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="preparing-the-samir-parameter-csv-file">
<span id="samir-params"></span><h1>Preparing the SAMIR parameter csv file<a class="headerlink" href="#preparing-the-samir-parameter-csv-file" title="Link to this heading"></a></h1>
<p>All the <em>SAMIR</em> model parameters are written in a csv file. Here is an example of such a file:</p>
<table class="docutils align-default">
<tbody>
<tr class="row-odd"><td><p>ClassName</p></td>
<td><p>scale_factor</p></td>
<td><p>Default</p></td>
<td><p>class1</p></td>
<td><p>class2</p></td>
<td><p>class3</p></td>
<td><p>class4</p></td>
<td><p>class5</p></td>
<td><p>class6</p></td>
<td><p>class7</p></td>
</tr>
<tr class="row-even"><td><p>ClassNumber</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td><p>1</p></td>
<td><p>2</p></td>
<td><p>3</p></td>
<td><p>4</p></td>
<td><p>5</p></td>
<td><p>6</p></td>
<td><p>7</p></td>
</tr>
<tr class="row-odd"><td><p>FmaxFC</p></td>
<td><p>1000</p></td>
<td><p>1</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Fslope</p></td>
<td><p>1000</p></td>
<td><p>1.4</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Foffset</p></td>
<td><p>1000</p></td>
<td><p>-0.075</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Plateau</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Kcb_max</p></td>
<td><p>1000</p></td>
<td><p>1.15</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Kslope</p></td>
<td><p>1000</p></td>
<td><p>1.2</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Koffset</p></td>
<td><p>1000</p></td>
<td><p>-0.24</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Zsoil</p></td>
<td><p>1</p></td>
<td><p>2000</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Ze</p></td>
<td><p>1</p></td>
<td><p>300</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Init_RU</p></td>
<td><p>1000</p></td>
<td><p>0.87</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>DiffE</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>DiffR</p></td>
<td><p>1</p></td>
<td><p>5</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>REW</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>minZr</p></td>
<td><p>1</p></td>
<td><p>150</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>maxZr</p></td>
<td><p>1</p></td>
<td><p>600</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>p</p></td>
<td><p>1000</p></td>
<td><p>0.55</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>FW</p></td>
<td><p>1000</p></td>
<td><p>1</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Irrig_auto</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-odd"><td><p>Irrig_man</p></td>
<td><p>1</p></td>
<td><p>0</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="row-even"><td><p>Kcb_stop_irrig</p></td>
<td><p>1</p></td>
<td><p>0.5</p></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Here is how the file is organised:</p>
<ul class="simple">
<li><p><strong>model parameters</strong> are located in the <strong>first column</strong> (row header), a row contains the values of a parameter for <strong>different classes</strong>.</p></li>
<li><p>the file contains <strong>three header columns</strong>: the <strong>parameter name</strong> (<code class="docutils literal notranslate"><span class="pre">ClassName</span></code> leftmost), the <strong>scale factors</strong> (<code class="docutils literal notranslate"><span class="pre">scale_factor</span></code> used to manage data types in the <em>SAMIR</em> calculations) and the <strong>default</strong> (<code class="docutils literal notranslate"><span class="pre">Default</span></code>) parameter values column.</p></li>
<li><p>the other columns have the <code class="docutils literal notranslate"><span class="pre">ClassName</span></code> as a header and contain the different parameter values. If a cell is <strong>empty</strong>, it will take the <code class="docutils literal notranslate"><span class="pre">Default</span></code> column value.</p></li>
<li><p>the <code class="docutils literal notranslate"><span class="pre">ClassNumber</span></code> row should not be changed for the <code class="docutils literal notranslate"><span class="pre">scale_factor</span></code> and <code class="docutils literal notranslate"><span class="pre">Default</span></code> columns. For the classes, it should correspond to the integer values contained in the <a class="reference internal" href="land_cover.html#land-cover"><span class="std std-ref">land cover raster</span></a>.</p></li>
</ul>
<p>You can have different parameter files, the file to use for a simulation is set in the <a class="reference internal" href="../setup/json_config_file.html#json-config"><span class="std std-ref">json configuration file</span></a>. This csv table is then loaded in an object as a <code class="docutils literal notranslate"><span class="pre">pandas</span> <span class="pre">DataFrame</span></code> attribute with the following function:</p>
<dl class="py class">
<dt class="sig sig-object py" id="modspa_pixel.parameters.params_samir_class.samir_parameters">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">modspa_pixel.parameters.params_samir_class.</span></span><span class="sig-name descname"><span class="pre">samir_parameters</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paramFile</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/modspa_pixel/parameters/params_samir_class.html#samir_parameters"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#modspa_pixel.parameters.params_samir_class.samir_parameters" title="Link to this definition"></a></dt>
<dd><p>Load all parameters for multiples classes in one object.</p>
<section id="attributes">
<h2>Attributes<a class="headerlink" href="#attributes" title="Link to this heading"></a></h2>
<ol class="arabic">
<li><dl>
<dt>.table: <code class="docutils literal notranslate"><span class="pre">pd.DataFrame</span></code></dt><dd><p><code class="docutils literal notranslate"><span class="pre">pandas</span> <span class="pre">DataFrame</span></code> with all paramters (rows) for all classes (columns)</p>
<p>It also contains :</p>
<ul class="simple">
<li><p>a <code class="docutils literal notranslate"><span class="pre">scale_factor</span></code> column (first column) that allows to convert all parameters to integer values for reduced memory usage</p></li>
<li><p>a <code class="docutils literal notranslate"><span class="pre">Default</span></code> column (second column) that contains default values to fill in missing values</p></li>
</ul>
<p>Example of the parameter table:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span>                <span class="n">scale_factor</span>  <span class="n">Default</span>   <span class="n">class1</span>    <span class="n">class2</span>    <span class="n">class3</span>
<span class="n">ClassName</span>                                                                      
<span class="n">ClassNumber</span>                <span class="mi">1</span>     <span class="mf">0.00</span>     <span class="mf">1.00</span>     <span class="mf">2.000</span>     <span class="mf">3.000</span>
<span class="n">FminNDVI</span>                <span class="mi">1000</span>     <span class="mf">0.20</span>     <span class="mf">0.20</span>     <span class="mf">0.100</span>     <span class="mf">0.100</span>
<span class="n">FmaxNDVI</span>                <span class="mi">1000</span>     <span class="mf">0.90</span>     <span class="mf">0.90</span>     <span class="mf">0.900</span>     <span class="mf">0.900</span>
<span class="n">FminFC</span>                  <span class="mi">1000</span>     <span class="mf">0.90</span>     <span class="mf">0.90</span>     <span class="mf">0.900</span>     <span class="mf">0.900</span>
<span class="n">FmaxFC</span>                  <span class="mi">1000</span>     <span class="mf">1.00</span>     <span class="mf">0.90</span>     <span class="mf">1.000</span>     <span class="mf">1.000</span>
<span class="n">Fslope</span>                  <span class="mi">1000</span>     <span class="mf">1.40</span>     <span class="mf">1.50</span>     <span class="mf">1.500</span>     <span class="mf">1.500</span>
<span class="n">Foffset</span>                 <span class="mi">1000</span>    <span class="o">-</span><span class="mf">0.10</span>    <span class="o">-</span><span class="mf">0.10</span>    <span class="o">-</span><span class="mf">0.100</span>    <span class="o">-</span><span class="mf">0.100</span>
<span class="n">Plateau</span>                    <span class="mi">1</span>    <span class="mf">70.00</span>    <span class="mf">70.00</span>    <span class="mf">70.000</span>    <span class="mf">70.000</span>
<span class="n">KminNDVI</span>                <span class="mi">1000</span>     <span class="mf">0.10</span>     <span class="mf">0.10</span>     <span class="mf">0.100</span>     <span class="mf">0.100</span>
<span class="n">KmaxNDVI</span>                <span class="mi">1000</span>     <span class="mf">0.90</span>     <span class="mf">0.90</span>     <span class="mf">0.900</span>     <span class="mf">0.900</span>
<span class="n">KminKcb</span>                 <span class="mi">1000</span>     <span class="mf">0.00</span>     <span class="mf">0.20</span>     <span class="mf">0.000</span>     <span class="mf">0.000</span>
<span class="n">KmaxKcb</span>                 <span class="mi">1000</span>     <span class="mf">0.98</span>     <span class="mf">1.00</span>     <span class="mf">1.100</span>     <span class="mf">1.100</span>
<span class="n">Kslope</span>                  <span class="mi">1000</span>     <span class="mf">1.60</span>     <span class="mf">1.60</span>     <span class="mf">1.600</span>     <span class="mf">1.600</span>
<span class="n">Koffset</span>                 <span class="mi">1000</span>    <span class="o">-</span><span class="mf">0.10</span>    <span class="o">-</span><span class="mf">0.10</span>    <span class="o">-</span><span class="mf">0.100</span>    <span class="o">-</span><span class="mf">0.100</span>
<span class="n">Zsoil</span>                      <span class="mi">1</span>  <span class="mf">2000.00</span>  <span class="mf">1600.00</span>  <span class="mf">1550.000</span>  <span class="mf">1550.000</span>
<span class="o">...</span>                      <span class="o">...</span>      <span class="o">...</span>      <span class="o">...</span>       <span class="o">...</span>       <span class="o">...</span>
<span class="n">Kcmax</span>                   <span class="mi">1000</span>     <span class="mf">1.15</span>     <span class="mf">1.15</span>      <span class="mf">1.15</span>      <span class="mf">1.15</span>
<span class="n">Fc_stop</span>                 <span class="mi">1000</span>     <span class="mf">0.15</span>     <span class="mf">0.15</span>      <span class="mf">0.15</span>      <span class="mf">0.15</span>
<span class="n">Start_date_Irr</span>             <span class="mi">1</span>     <span class="mf">0.00</span>     <span class="mf">0.00</span>      <span class="mf">0.00</span>      <span class="mf">0.00</span>
<span class="n">p_trigger</span>                  <span class="mi">1</span>     <span class="mf">0.00</span>     <span class="mf">0.00</span>      <span class="mf">0.00</span>      <span class="mf">0.00</span>
</pre></div>
</div>
</dd>
</dl>
</li>
</ol>
</section>
<section id="methods">
<h2>Methods<a class="headerlink" href="#methods" title="Link to this heading"></a></h2>
<dl class="py method">
<dt class="sig sig-object py" id="modspa_pixel.parameters.params_samir_class.samir_parameters.__init__">
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paramFile</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="../_modules/modspa_pixel/parameters/params_samir_class.html#samir_parameters.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#modspa_pixel.parameters.params_samir_class.samir_parameters.__init__" title="Link to this definition"></a></dt>
<dd><p>Create pandas table from the csv parameter file.</p>
<section id="arguments">
<h3>Arguments<a class="headerlink" href="#arguments" title="Link to this heading"></a></h3>
<ol class="arabic simple">
<li><dl class="simple">
<dt>paramFile: <code class="docutils literal notranslate"><span class="pre">str</span></code></dt><dd><p>path to csv parameter file</p>
</dd>
</dl>
</li>
</ol>
</section>
</dd></dl>

</section>
</dd></dl>

<p>This object is used to build a raster for each parameter (spatialized parameters) in the <em>SAMIR</em> functions.</p>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="soil_data.html" class="btn btn-neutral float-left" title="Preparing the soil data raster" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../samir/run_samir.html" class="btn btn-neutral float-right" title="Run the SAMIR model" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2023, auclairj.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>