[GRASS-SVN] r64757 - grass-addons/grass7/vector/v.flexure
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 26 13:12:06 PST 2015
Author: awickert
Date: 2015-02-26 13:12:06 -0800 (Thu, 26 Feb 2015)
New Revision: 64757
Modified:
grass-addons/grass7/vector/v.flexure/v.flexure.html
grass-addons/grass7/vector/v.flexure/v.flexure.py
Log:
Modernize GRASS parser interface
Modified: grass-addons/grass7/vector/v.flexure/v.flexure.html
===================================================================
--- grass-addons/grass7/vector/v.flexure/v.flexure.html 2015-02-26 21:11:53 UTC (rev 64756)
+++ grass-addons/grass7/vector/v.flexure/v.flexure.html 2015-02-26 21:12:06 UTC (rev 64757)
@@ -6,7 +6,7 @@
<h2>NOTES</h2>
-<b>q0</b> is a vector points file containing the loads in units of force. Typically, this will be a representation of a distributed field of loads as a set of points, so the user will implicitly include the area over which a stress (vertical load) acts into the quantities in the database table of <b>q0</b>.
+<b>input</b> is a vector points file containing the loads in units of force. Typically, this will be a representation of a distributed field of loads as a set of points, so the user will implicitly include the area over which a stress (vertical load) acts into the quantities in the database table of <b>input</b>.
<p>
<b>te</b>, written in standard text as T<sub>e</sub> is the lithospheric elastic thickness.
<p>
Modified: grass-addons/grass7/vector/v.flexure/v.flexure.py
===================================================================
--- grass-addons/grass7/vector/v.flexure/v.flexure.py 2015-02-26 21:11:53 UTC (rev 64756)
+++ grass-addons/grass7/vector/v.flexure/v.flexure.py 2015-02-26 21:12:06 UTC (rev 64757)
@@ -30,25 +30,32 @@
#% keyword: vector
#% keyword: geophysics
#%end
-#%option
-#% key: q0
-#% type: string
-#% gisprompt: old,vector,vector
+
+#%option G_OPT_V_INPUT
+#% key: input
#% description: Vector map of loads (thickness * area * density * g) [N]
-#% required : yes
+#% guidependency: layer,column
#%end
-#%option
+
+#%option G_OPT_V_FIELD
+#% key: layer
+#% description: Layer containing load values
+#% guidependency: column
+#%end
+
+#%option G_OPT_DB_COLUMNS
#% key: column
-#% type: string
#% description: Column containing load values [N]
#% required : yes
#%end
+
#%option
#% key: te
#% type: double
#% description: Elastic thicnkess: scalar; unis chosen in "te_units"
#% required : yes
#%end
+
#%option
#% key: te_units
#% type: string
@@ -56,20 +63,19 @@
#% options: m, km
#% required : yes
#%end
-#%option
+
+#%option G_OPT_V_OUTPUT
#% key: output
-#% type: string
-#% gisprompt: old,vector,vector
#% description: Output vector points map of vertical deflections [m]
#% required : yes
#%end
-#%option
+
+#%option G_OPT_R_OUTPUT
#% key: raster_output
-#% type: string
-#% gisprompt: old,cell,raster
#% description: Output raster map of vertical deflections [m]
#% required : no
#%end
+
#%option
#% key: g
#% type: double
@@ -77,6 +83,7 @@
#% answer: 9.8
#% required : no
#%end
+
#%option
#% key: ym
#% type: double
@@ -84,6 +91,7 @@
#% answer: 65E9
#% required : no
#%end
+
#%option
#% key: nu
#% type: double
@@ -91,6 +99,7 @@
#% answer: 0.25
#% required : no
#%end
+
#%option
#% key: rho_fill
#% type: double
@@ -98,6 +107,7 @@
#% answer: 0
#% required : no
#%end
+
#%option
#% key: rho_m
#% type: double
@@ -180,7 +190,7 @@
######################################################
# x, y, q
- flex.x, flex.y = get_points_xy(options['q0'])
+ flex.x, flex.y = get_points_xy(options['input'])
# xw, yw: gridded output
if len(grass.parse_command('g.list', type='vect', pattern=options['output'])):
if not grass.overwrite():
@@ -192,7 +202,7 @@
grass.run_command('v.mkgrid', map=options['output'], type='point', overwrite=grass.overwrite(), quiet=True)
grass.run_command('v.db.addcolumn', map=options['output'], columns='w double precision', quiet=True)
flex.xw, flex.yw = get_points_xy(options['output']) # gridded output coordinates
- vect_db = grass.vector_db_select(options['q0'])
+ vect_db = grass.vector_db_select(options['input'])
col_names = np.array(vect_db['columns'])
q_col = (col_names == options['column'])
if np.sum(q_col):
More information about the grass-commit
mailing list