[GRASS-SVN] r66207 - grass-addons/grass7/raster/r.subdayprecip.design
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Sep 14 04:33:10 PDT 2015
Author: martinl
Date: 2015-09-14 04:33:09 -0700 (Mon, 14 Sep 2015)
New Revision: 66207
Modified:
grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.html
grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.py
grass-addons/grass7/raster/r.subdayprecip.design/r_subdayprecip_design_basin.png
grass-addons/grass7/raster/r.subdayprecip.design/r_subdayprecip_design_h_rast.png
Log:
r.subdayprecip.design: manual improvements (thanks to Ludek Strouhal)
Modified: grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.html
===================================================================
--- grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.html 2015-09-14 11:32:14 UTC (rev 66206)
+++ grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.html 2015-09-14 11:33:09 UTC (rev 66207)
@@ -1,26 +1,29 @@
<h2>DESCRIPTION</h2>
-<em>r.subdayprecip.design</em> computes reduction of subday design
-precipitation series.
+<em>r.subdayprecip.design</em> computes subday design precipitation
+totals based on Hradek's method of reduction of daily maximums to
+chosen duration.
<p>
The tool uses methods of zonal statistics to compute average values of
-design 24 hours precipitation for a selected area or for a spot. This
-value is reduced to the chosen length design rain for selected period
-of repetition.
+24 hours precipitation amounts of specified return period for a
+provided area or a spot. Rasters of daily maxima were derived from
+statistics published by Samaj et al. in 1985, which were based on
+precipitation series observed in 1901-1980. Calculated average value
+is then reduced to the chosen length of design rain event.
<h2>NOTES</h2>
Subday design precipitation series are important for hydrological
modelling and soil erosion problems in a small catchment scale when
designing common measures for promoting water retention, landscape
-drainage systems, etc.
+drainage systems, flood mitigation measures etc.
<p>
First automatization has been implemented by well-known method
which is based on reduction of 24 hours design precipitation to
shorter time. GIS is used for spatial supervised classification of
-point values of specified repetition periods (2, 10, 20, 50 a 100
+point values of specified return periods (2, 10, 20, 50 and 100
years) over the area of the Czech Republic.
<center>
@@ -31,14 +34,14 @@
</tr>
<tr>
<td><em>Figure: Basins (in orange) with orthophoto<br> on background</em></td>
-<td><em>Figure: Repetition periods (2, 10, 20, 50 years)<br> in the area of the Czech Republic</em></td>
+<td><em>Figure: Return periods (2, 10, 20, 50 years)<br> in the area of the Czech Republic</em></td>
</tr>
</table>
<img src="r_subdayprecip_design_result.png">
<p>
-<em>Figure: Basins colored by H_002_60 value</em>
+<em>Figure: III.order basins colored by mean H_002_60 value</em>
</center>
Modified: grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.py
===================================================================
--- grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.py 2015-09-14 11:32:14 UTC (rev 66206)
+++ grass-addons/grass7/raster/r.subdayprecip.design/r.subdayprecip.design.py 2015-09-14 11:33:09 UTC (rev 66207)
@@ -6,7 +6,7 @@
#
# AUTHOR(S): Martin Landa
#
-# PURPOSE: Computes subday design precipitation series.
+# PURPOSE: Computes subday design precipitation totals.
#
# COPYRIGHT: (C) 2015 Martin Landa and GRASS development team
#
@@ -17,7 +17,7 @@
#############################################################################
#%module
-#% description: Computes subday design precipitation series.
+#% description: Computes subday design precipitation totals.
#% keyword: raster
#% keyword: hydrology
#% keyword: precipitation
@@ -29,7 +29,7 @@
#%option G_OPT_R_INPUTS
#% key: raster
-#% description: Name of repetition periods raster map(s)
+#% description: Name of return periods raster map(s)
#% options: H_002,H_005,H_010,H_020,H_050,H_100
#%end
@@ -54,7 +54,7 @@
columns = grass.vector_columns(opt['map']).keys()
except CalledModuleError as e:
return 1
-
+
allowed_rasters = ('H_002', 'H_005', 'H_010', 'H_020', 'H_050', 'H_100')
# extract multi values to points
@@ -70,18 +70,21 @@
'Allowed: {}'.format(rast, allowed_rasters))
continue
+ # perform zonal statistics
grass.message('Processing <{}>...'.format(rast))
table = '{}_table'.format(name)
# TODO: handle null values
Module('v.rast.stats', flags='c', map=opt['map'], raster=rast,
column_prefix=name, method='average', quiet=True)
+ # add column to the attribute table if not exists
rl = float(opt['rainlength'])
field_name='{}_{}'.format(name, opt['rainlength'])
if field_name not in columns:
Module('v.db.addcolumn', map=opt['map'],
columns='{} double precision'.format(field_name))
-
+
+ # determine coefficient for calculation
a = c = None
if name == 'H_002':
if rl < 40:
@@ -143,16 +146,17 @@
elif rl < 1440:
a = 0.642
c = 0.939
-
+
if a is None or c is None:
grass.fatal("Unable to calculate coefficients")
+ # calculate output values, update attribute table
coef = a * rl ** (1 - c)
expression = '{}_average * {}'.format(name, coef)
Module('v.db.update', map=opt['map'],
column=field_name, query_column=expression)
- # remove not used column
+ # remove unused column
Module('v.db.dropcolumn', map=opt['map'],
columns='{}_average'.format(name))
Modified: grass-addons/grass7/raster/r.subdayprecip.design/r_subdayprecip_design_basin.png
===================================================================
(Binary files differ)
Modified: grass-addons/grass7/raster/r.subdayprecip.design/r_subdayprecip_design_h_rast.png
===================================================================
(Binary files differ)
More information about the grass-commit
mailing list