[GRASS-SVN] r66748 - in grass-addons/grass7/raster/r.green: . r.green.hydro/libhydro r.green.hydro/r.green.hydro.financial r.green.hydro/r.green.hydro.optimal r.green.hydro/r.green.hydro.technical r.green.hydro/r.green.hydro.theoretical
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Nov 5 06:05:11 PST 2015
Author: Giulia
Date: 2015-11-05 06:05:11 -0800 (Thu, 05 Nov 2015)
New Revision: 66748
Added:
grass-addons/grass7/raster/r.green/r_green.png
Modified:
grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/optimal.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py
grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py
Log:
r.green: png added
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/optimal.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/optimal.py 2015-11-05 02:46:47 UTC (rev 66747)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/libhydro/optimal.py 2015-11-05 14:05:11 UTC (rev 66748)
@@ -12,6 +12,8 @@
import numpy as np
#from grass.script import mapcalc
+version = 70 # 71
+
from grass.script import core as gcore
from grass.pygrass.messages import get_msgr
from grass.pygrass.raster import RasterRow
@@ -290,6 +292,7 @@
raster_dtm.open('r')
reg = Region()
plants = []
+ import ipdb; ipdb.set_trace()
for line in vec:
count = 0
# args is prog, h, q
@@ -320,13 +323,19 @@
for pla in plants:
power = pla.potential_power(efficiency=efficiency)
if power > min_power:
+ for cat, ink in enumerate(pla.intakes):
+ if version == 70:
+ new_vec.write(pla.line, (pla.id, pla.id_stream, power,
+ float(pla.restitution.discharge),
+ float(ink.elevation),
+ float(pla.restitution.elevation)))
+ else:
+ new_vec.write(pla.line, cat=cat, attrs=(pla.id,
+ pla.id_stream, power,
+ float(pla.restitution.discharge),
+ float(ink.elevation),
+ float(pla.restitution.elevation)))
- for ink in pla.intakes:
- new_vec.write(pla.line, (pla.id, pla.id_stream, power,
- float(pla.restitution.discharge),
- float(ink.elevation),
- float(pla.restitution.elevation)))
-
new_vec.table.conn.commit()
new_vec.comment = (' '.join(sys.argv))
#pdb.set_trace()
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py 2015-11-05 02:46:47 UTC (rev 66747)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.financial/r.green.hydro.financial.py 2015-11-05 14:05:11 UTC (rev 66748)
@@ -848,6 +848,7 @@
def main(opts, flgs):
+ import ipdb; ipdb.set_trace()
pid = os.getpid()
pat = "tmprgreen_%i_*" % pid
atexit.register(cleanup,
@@ -933,6 +934,7 @@
alpha=opts['alpha_inlet']))
# add total inlet costs
# TODO: to be check to avoid to count cost more than one time I have moltiplied by 0.5
+ import ipdb; ipdb.set_trace()
tot = ('tot_cost = (comp_cost_sum + em_cost + '
'lin_pipe_cost + lin_electro_cost + '
'station_cost + inlet_cost + {grid}*0.5) * '
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py 2015-11-05 02:46:47 UTC (rev 66747)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.optimal/r.green.hydro.optimal.py 2015-11-05 14:05:11 UTC (rev 66748)
@@ -156,19 +156,14 @@
DEBUG = flags['d']
c = flags['c']
msgr = get_msgr()
-
#import ipdb; ipdb.set_trace()
-
- TMPVEC = ['river_clean']
- if not gcore.overwrite():
- for m in TMPVEC:
- if gcore.find_file(m)['name']:
- msgr.fatal(_("Temporary vector %s exists") % (m))
-
+
if c:
msgr.message("\Clean rivers\n")
- dissolve_lines(river, 'river_clean')
- river = 'river_clean'
+ TMPVECT = [("tmprgreen_%i_clean*" % os.getpid())]
+ pid = os.getpid()
+ dissolve_lines(river, "tmprgreen_%i_clean*" % os.getpid())
+ river = "tmprgreen_%i_clean*" % pid
# number of cell of the river
# range for the solution
msgr.message("\Loop on the category of segments\n")
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py 2015-11-05 02:46:47 UTC (rev 66747)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.technical/r.green.hydro.technical.py 2015-11-05 14:05:11 UTC (rev 66748)
@@ -135,7 +135,7 @@
#%option
#% key: roughness_penstock
#% type: double
-#% description: Roughness of the pensotck [mm]
+#% description: Roughness of the penstock [mm]
#% required: no
#% answer: 0.015
#% guisection: Head losses
Modified: grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py
===================================================================
--- grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py 2015-11-05 02:46:47 UTC (rev 66747)
+++ grass-addons/grass7/raster/r.green/r.green.hydro/r.green.hydro.theoretical/r.green.hydro.theoretical.py 2015-11-05 14:05:11 UTC (rev 66748)
@@ -5,7 +5,7 @@
#
# MODULE: r.green.hydro.potential
# AUTHOR(S): Giulia Garegnani, Pietro Zambelli
-# PURPOSE: Calculate the theorethical hydropower energy potential for each basin and segments of river
+# PURPOSE: Calculate the theoretical hydropower energy potential for each basin and segments of river
# COPYRIGHT: (C) 2014 by the GRASS Development Team
#
# This program is free software under the GNU General Public
@@ -29,7 +29,7 @@
#% type: string
#% gisprompt: old,cell,raster
#% key_desc: name
-#% description: Name of river discharge [m3/s]
+#% description: Name of input river discharge raster map [m3/s]
#% required: yes
#%end
#%option G_OPT_V_INPUT
@@ -37,7 +37,7 @@
#% type: string
#% gisprompt: old,vector,vector
#% key_desc: name
-#% description: Name of river network
+#% description: Name of river network input vector map
#% required: no
#%end
#%option G_OPT_V_INPUT
@@ -45,7 +45,7 @@
#% type: string
#% gisprompt: old,vector,vector
#% key_desc: name
-#% description: Name of lakes
+#% description: Name of lakes input vector map
#% required: no
#%end
#%option
@@ -83,7 +83,7 @@
#% key: output
#% type: string
#% key_desc: name
-#% description: Name of vector map with basin potential
+#% description: Name of output vector map with basin potential
#% required: yes
#% guisection: Basin Potential
#%END
Added: grass-addons/grass7/raster/r.green/r_green.png
===================================================================
(Binary files differ)
Property changes on: grass-addons/grass7/raster/r.green/r_green.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
More information about the grass-commit
mailing list