------------
User Choices
------------

pywatemsedem
============

 - Options: holding general options coupled to the general data processing
   and model run.
 - Erosion control measure options (ECM options): holding options related to
   erosion control measures.
 - Variables: holding values for model variables and parameters.
 - Output: holding options for the WaTEM/SEDEM model output.

Standard values for the first four sets are given in the last section of
this page, listed per model resolution.

.. note::

    It is important to note that a number of the pywatemsedem options hold
    functionalities that are inherited from the WaTEM/SEDEM model (see
    :ref:`model parameters in WaTEM/SEDEM documentation page <watemsedem:modelinput>`).
    As such many of these options hold the same key, but another
    functionality. If the functionality of the option is different for the
    WaTEM/SEDEM model, then this is indicated in the text (indicated with
    *For functionality in WaTEM/SEDEM, see ..*). If the functionality is the
    same, then a link to the documentation of WaTEM/SEDEM is presented (indicated
    with *see ..*).

Options
-------

UserProvidedKTC
^^^^^^^^^^^^^^^
This option indicates whether a User provided kTC value is used, and whether
WaTEM/SEDEM needs to generate a kTC value by itself. Typically, this option is set to
`1` when a **WaTEM/SEDEM simulation for scenario analysis** is done - in this case, a
kTC map will be generated by the pywatemsedem engine - and is set to `0` when a
**WaTEM/SEDEM calibration** is done - in this case, kTC maps are generated  by the
WaTEM/SEDEM engine.

Include sewers
^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:inlcudesewers>`

UseTillage
^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:calctileros>`

CreateKtc
^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:createktc>`

Create ktil map
^^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:createktil>`

Estimate clay content
^^^^^^^^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:estimclay>`

Manual outlet selection
^^^^^^^^^^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:manualoutlet>`

Calibrate
^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:calibrate>`

Convert output
^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:convertoutput>`

L model
^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:lmodel>`

S model
^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:smodel>`

Adjusted Slope
^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:adjustslope>`

Buffer reduce area
^^^^^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:bufferreduce>`

Force Routing
^^^^^^^^^^^^^
This options allows to use  user-defined routing. This functions is useful
for situations where it is known from expert knowledge that the general
flow pattern is incorrect.

For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:forcerouting>`

FilterDTM
^^^^^^^^^
Filter the digital elevation model with a 3x3 average filter which takes into
account the parcel boundaries (i.e. only averaging within parcel boundaries).

River Routing
^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:riverrouting>`

BankGrassStrips
^^^^^^^^^^^^^^^
This option defines gras bank strips at the side of the river for every
river-adjancent agricultural parcel (with the land cover equal to agriculture).

Calculate Tillage Erosion
^^^^^^^^^^^^^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:includetillagedirection>`

ECM options
-----------

Include buffers (WaTEM/SEDEM)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Load and translate buffer shapefiles to WaTEM/SEDEM buffer rasters. Consider
buffers for WaTEM/SEDEM model simulation. For functionality in WaTEM/SEDEM pascal, see
:ref:`here <watemsedem:includebuffers>`


UseGras (pywatemsedem)
^^^^^^^^^^^^^^^^^^^^^^
Load and translate grass strips shapefiles to WaTEM/SEDEM grass rasters. Grass strips
are considered in WaTEM/SEDEM via the WaTEM/SEDEM parcel raster (see
:ref:`here <watemsedem:prcmap>`).


Include dams (WaTEM/SEDEM)
^^^^^^^^^^^^^^^^^^^^^^^^^^
Load and translate buffer shapefiles to WaTEM/SEDEM grass rasters. Consider grass
for WaTEM/SEDEM model simulation. For functionality in WaTEM/SEDEM pascal, see
:ref:`here <watemsedem:includedams>`

Include ditches (WaTEM/SEDEM)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:includeditches>`

UseTeelttechn (pywatemsedem)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Make use of crop-technical measures. These are defined at the level of parcel
polygons, and reduce the C-factor.

Variables
---------

Bulk density
^^^^^^^^^^^^
See :ref:`here <watemsedem:bulkdensity>`:

ktc low
^^^^^^^
See :ref:`here <watemsedem:ktclow>`

ktc high
^^^^^^^^
See :ref:`here <watemsedem:ktchigh>`

ktc limit
^^^^^^^^^
See :ref:`here <watemsedem:ktclimit>`

ktil default
^^^^^^^^^^^^
See :ref:`here <watemsedem:ktildefault>`

ktil threshold
^^^^^^^^^^^^^^
See :ref:`here <watemsedem:ktilthres>`

Parcel connectivity cropland
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:parcelconncrop>`

Parcel connectivity forest
^^^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:parcelconnforest>`

Parcel trapping efficiency cropland
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:parceltrapppingcrop>`

Parcel trapping efficiency forest
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:parceltrappingforest>`

Parcel trapping efficiency pasture
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:parceltrappingpasture>`

Clay content parent material
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:claycontent>`

R factor
^^^^^^^^
See :ref:`here <watemsedem:rfactor_var>`

Alpha
^^^^^
See :ref:`here <watemsedem:alpha>`

Beta
^^^^
See :ref:`here <watemsedem:beta>`

Stream velocity
^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:streamvelocity>`

Final timestep output
^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:timestep>`

begin_jaar
^^^^^^^^^^
(begin) Year of simulation (in development).

begin_maand
^^^^^^^^^^^
(begin) Month of simulation (in development).

Max kernel
^^^^^^^^^^
See :ref:`here <watemsedem:maxkernel>`

Max kernel river
^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:maxkernelriver>`

SewerInletEff
^^^^^^^^^^^^^
Used to define efficiency inlet, mapped to raster. For functionality of
sewer raster in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:inlcudesewers>`

Sewer exit
^^^^^^^^^^
Only CN. For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:sewerexit>`

LS correction
^^^^^^^^^^^^^
For functionality in WaTEM/SEDEM pascal, see :ref:`here <watemsedem:lscorrection>`

Output
------

The output options below are all inherited by WaTEM/SEDEM. This implies that the
keys and functionalities of these options in pywatemsedem and WaTEM/SEDEM are exactly the
same. For an explanation of these functionalities, we refer to the
`WaTEM/SEDEM documentation page <https://watem-sedem.github.io/watem-sedem/>`_

Write aspect
^^^^^^^^^^^^
See :ref:`here <watemsedem:writeaspect>`

Write LS factor
^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:writels>`

Write RUSLE
^^^^^^^^^^^
See :ref:`here <watemsedem:writerusle>`

Write sediment export
^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:writesedexport>`

Write slope
^^^^^^^^^^^
See :ref:`here <watemsedem:writeslope>`

Write total runoff
^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:writetotalrunoff>`

Write upstream area
^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:writeuparea>`

Write water erosion
^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:writerwatereros>`

Output per river segment
^^^^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:outputsegment>`

Write rainfall excess
^^^^^^^^^^^^^^^^^^^^^
See :ref:`here <watemsedem:writerainfallexcess>`

Write routing table
^^^^^^^^^^^^^^^^^^^
see :ref:`here <watemsedem:writerouting>`

Maximize grass strips (maximize_grass_strips)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The option (boolean) enable the maximisation of for grass strips in the WaTEM/SEDEM
parcels raster. In essence, with this option, the
:func:`pywatemsedem.core.grasstrips.expand_grass_strips_with_triggers`-function is
used. This function aims to *expand* or *maximize* grass strips within the
boundaries of a parcel, so to avoid that grass strips are removed by
overlap with river and infrastructure pixels (note that river and
infrastructure pixels have a higher priority in the hierarchy of the WaTEM/SEDEM
perceelskaart). This algorithm loops with a 3x3-window over a grass strip
raster, and checks if any of the pixels in the 3x3-window are located next
to a *trigger* pixel. If this is the case, the considered pixel in the window
is also considered to be a grass pixel. Note that in essence this algorithm is
used as a solution to a resolution issue: because of the higher priority of
infrastructure and rivers in pywatemsedem, grass strips 'disappear' at a resolution
of 20 m.
