GRASS logo

NAME

m.swim.hydrotopes.py - Soil and Water Integrated Model (SWIM) preprocessor: hydrotopes

KEYWORDS

SYNOPSIS

m.swim.hydrotopes.py
m.swim.hydrotopes.py --help
m.swim.hydrotopes.py [-ckv] subbasins=name landuse=name soil=name strfilepath=path hydrotopes=name [contours=ints or list of ints or raster] [contourrast=string] elevation=name [management=name] [wetland=name] [glaciers=name] [more=name[,name,...]] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-c
deprecated option, left for backwards compatibility
-k
Keep intermediat files (include __ in names)
-v
Show version and change/install date of this module and grass.
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

subbasins=name [required]
Subbasin raster map
landuse=name [required]
Land use raster map in SWIM land use classification
soil=name [required]
Soil raster map classified to SWIM soil files
strfilepath=path [required]
Path where structure file will be written
hydrotopes=name [required]
Name of hydrotope raster to be created
Default: hydrotopes
contours=ints or list of ints or raster
Elevation contours to include in hydrotopes [optional, if set, DEM in Subbasins also needs to be set]
contourrast=string
Resultant contours raster if contours option is int/list of ints
Default: contours
elevation=name [required]
Elevation raster
management=name
Raster name (if not given, column is filled with default)
wetland=name
Raster name (if not given, column is filled with default)
glaciers=name
Raster name (if not given, column is filled with default)
more=name[,name,...]
More rasters maps included in hydrotopes [optional]

DESCRIPTION

The m.swim.hydrotopes module computes the hydrotopes (or Hydrological Response Units/HRU) and writes this information to the SWIM structure file.

Structure file (.str)

The full path to the structure file should be given to the strfilepath. As the different versions of SWIM require different columns in the .str file, the output file may have to be adapted to each project. The standard columns are:

subbasinID  landuseID  soilID  [elevation]  [more,more,...]  area  cells
...
0                 0                0            ...                                        0         0

The elevation is only included if any of the contours options are set (see below) and the more column(s) are those raster maps set in the more argument. The last line of the .str file is filled with nills.

Contours

Elevation contours can be calculated if needed by setting the -c flag and giving the elevation argument and setting either the contours argument with elevation breaks (e.g. contours=100,300,500,...) or intervals (e.g. contours=100) or by setting the raster map to the countourrast argument. The contours argument takes precedence over the contourrast argument and the contourrast argument becomes the output argument for the resultant contours raster. When recalculating the hydrotopes, the execution time can be reduced by leaving out the contours argument, i.e. picking up the contours raster that has already been created.

NOTES

All input maps should be interger rasters (CELL rasters), i.e. r.stats <raster> should give discrete values, not value ranges.
Although this module has been tested, it is still in beta mode and hasn't been extensively error coded. Please report unexplained errors to the author (see below).

EXAMPLE

Setting up a SWIM project in the North Carolina (basic) testing location:

Create a new mapset and set region:
g.mapset -c mapset=subbasins
g.region rast=elevation@PERMANENT

Stations

Create a stations point vector map:
echo "x|y|name|subbsize
640579|215607|outlet|0.1
640388|216617|headwater|0.05" > stations.dat
v.in.ascii input=stations.dat out=stations x=1 y=2 columns='x int, y int, name varchar(20), subbsize double' skip=1

Subbasins

Make subbasins (default output arguments):
m.swim.subbasins elevation=elevation@PERMANENT stations=stations upthresh=0.1 subbasins=subbasins

In addition to the subbasins vector and raster map, this also produces catchment raster and vector maps, accumulation, drainage, streams, slopesteepness and slopelength rasters (as needed by the subsequent m.swim.* modules) by default.

Hydrotopes

Calculate hydrotopes with the subbasins, landuse and soil raster maps:
m.swim.hydrotopes subbasins=subbasins landuse=landuse@PERMANENT soil=soils@PERMANENT strfilepath=mypro.str hydrotopes=hydrotopes
Alternatively, contours (either as interval or list of breaks through the controus argument; or as a raster map through the contourrast argument) and more maps can be used to further subdevide the hydrotopes:
m.swim.hydrotopes subbasins=subbasins landuse=landuse@PERMANENT soil=soils@PERMANENT -c contours=50 \
 elevation=elevation@PERMANENT more=geology@PERMANENT strfilepath=mypro.str
This implicitly creates a raster called contours and one called hydrotopes (as default names given for the hydrotopes and contourrast arguments).

SEE ALSO

m.swim.subbasins, r.watershed, m.swim.substats, m.swim.routing

Documentation [external]: m.swim

AUTHORS

Michel Wortmann, Potsdam Institute for Climate Impact Research (wortmann@pik-potsdam.de)

Last updated (docs/code): Mon Dec 2 15:41:04 2019 +0100 / Wed Jan 19 23:04:38 2022 +0000