You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55Lines changed: 55 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,9 @@ NetCDF, PCRaster and TSS files.
74
74
75
75
*__[catchstats](#catchstats)__ calculates catchment statistics (mean, sum, std, min, max...) from NetCDF4 files given masks created with [cutmaps](#cutmaps).
76
76
77
+
*__[mctrivers](#mctrivers)__ creates a river mask for MCT diffusive river routing in LISFLOOD.
78
+
> **Note**: PCRaster must be installed in the Conda environment.
79
+
77
80
The package contains convenient classes for reading/writing:
78
81
79
82
* PCRasterMap
@@ -925,6 +928,58 @@ The structure of the output depends on whether the input files include a tempora
925
928
* If the input files DO NOT have a time dimension, the output has a single dimension: the catchment ID. It contains as many variables as the combinations of input variables and statistics. For instance, if the input variables are "elevation" and "gradient" and three statistics are required ("mean", "max", "min"), the output will contain 6 variables: "elevation_mean", "elevation_max", "elevation_min", "gradient_mean", "gradient_max" and "gradient_min".
926
929
* If the input files DO have a time dimension, the output has two dimensions: the catchment ID and time. The number of variables follows the same structure explained in the previous point. For instance, if the input files are daily maps of precipitation (variable name "pr") and we calculate the mean and total precipitation over the catchment, the output will contain two dimensions ("ID", "time") and two variables ("pr_mean", "pr_sum").
927
930
931
+
932
+
## mctrivers
933
+
934
+
This tool builds a mask of mild sloping rivers for use in LISFLOOD with MCT diffusive river routing. It takes LISFLOOD channels slope map (changrad.nc), the LDD (ldd.nc), the upstream drained area map (upArea.nc) and the catchment/domain mask (mask.nc), and outputs a bolean mask (chanmct.nc).
935
+
Pixels where riverbed gradient < threshold (--slope) are added to the mask if their drainage area is large enough (--minuparea) and they also have at least --nloops consecutive downstream pixels that meet the same condition for slope (drainage area will be met as downstream the area increases).
936
+
937
+
### Usage
938
+
939
+
The tool requires the following mandatory input arguments:
-`-l`, `--LDDfile`: LISFLOOD local drain direction file (ldd.nc)
943
+
-`-u`, `--uparea`: LISFLOOD Uustream area file (upArea.nc)
944
+
945
+
The tool can take the following additional input arguments:
946
+
947
+
-`-m`, `--maskfile`: LISFLOOD mask or domain file (mask.nc; if not given, all domain is considered valid)
948
+
-`-S`, `--slope`: Riverbed slope threshold to use MCT diffusive wave routing (default: 0.001)
949
+
-`-N`, `--nloops`: Number of consecutive downstream grid cells that also need to comply with the slope requirement for including a grid cell in the MCT rivers mask (default: 5)
950
+
-`-U`, `--minuparea`: Minimum upstream drainage area for a pixel to be included in the MCT rivers mask (uses the same units as in the -u file) (default: 0)
951
+
-`-E`, `--coordsnames`: Coordinates names for lat, lon (in this order with space!) used in the netcdf files. The function checks for 3 commonly used names (x, lon, rlon for longitudes, and y, lat, rlat for latitudes). Therefere, it is recommended to keep the default value.
952
+
953
+
The tool generates the following outputs (when called from command line as main script):
954
+
955
+
-`-O`, `--outputfilename`: Output file containing the rivers mask where LISFLOOD can use the MCT diffusive wave routing (default: chanmct.nc)
956
+
957
+
It can be used either from command line, or also as a python function. Below follow some examples:
958
+
959
+
Example of command that will generate an MCT rivers mask with pixels where riverbed slope < 0.001 (same as default), drainage area > 500 kms and at least 5 (same as default) downstream pixels meet the same two conditions, considering the units of the upArea.nc file are given in kms:
Example of command that will generate an MCT rivers mask with pixels where riverbed slope < 0.0005, drainage area > 0 (same as default) kms and at least 3 downstream pixels meet the same two conditions. Also a mask (mask.nc) will be used, and the coords names in the nc files are "Lat1", "Lon1" for lat, lon respectively:
You can use lisflood utilities in your python programs. As an example, the script below creates the mask map for a set of stations (stations.txt). The mask map is a boolean map with 1 and 0. 1 is used for all (and only) the pixels hydrologically connected to one of the stations. The resulting mask map is in pcraster format.
Builds a mask of mild sloping rivers for use in LISFLOOD with MCT diffusive river routing. It takes LISFLOOD channels slope map (changrad.nc), the LDD (ldd.nc),
50
+
the upstream drained area map (upArea.nc) and the catchment/domain mask (mask.nc), and outputs a bolean mask (chanmct.nc). Pixels where riverbed gradient < threshold
51
+
(slp_threshold) are added to the mask if their drainage area is large enough (minuparea) and they also have at least nloops consecutive downstream pixels that meet
52
+
the same condition for slope (drainage area will be met as downstream the area increases).
ldd_file: LISFLOOD local drain direction file (ldd.nc)
59
+
uparea_file: LISFLOOD Upstream area file (upArea.nc)
60
+
mask_file: a mask nc file; if not given (default) all cells are considered valid.
61
+
slp_threshold: Riverbed slope threshold to use MCT diffusive wave routing (default: 0.001)
62
+
nloops: Number of consecutive downstream grid cells that also need to comply with the slope requirement for including a grid cell in the MCT rivers mask (default: 5)
63
+
minuparea: Minimum upstream drainage area for a pixel to be included in the MCT rivers mask (uses the same units as in the -u file) (default: 0)
64
+
coords_names: Coordinates names for lat, lon (in this order as list) used in the the netcdf files (default: 'None'; checks for commonly used names ['x', 'lon', 'rlon'], similar for lat names)
65
+
outputfile: Output file containing the rivers mask where LISFLOOD can use the MCT diffusive wave routing (default: chanmct.nc)
66
+
67
+
Example for generating an MCT rivers mask with pixels where riverbed slope < 0.001, drainage area > 500 kms and at least 5 downstream pixels meet the same
68
+
two conditions, considering the units of the upArea.nc file are given in kms:
0 commit comments