wolfhece 2.1.11__py3-none-any.whl → 2.1.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wolfhece/PyDraw.py +92 -73
- wolfhece/PyGui.py +38 -81
- wolfhece/Results2DGPU.py +20 -12
- wolfhece/apps/version.py +1 -1
- wolfhece/hydrology/Catchment.py +5 -5
- wolfhece/hydrology/PyWatershed.py +11 -3
- wolfhece/hydrology/SubBasin.py +1 -1
- wolfhece/mesh2d/wolf2dprev.py +4 -0
- wolfhece/models/blue.pal +7 -7
- wolfhece/wolfresults_2D.py +18 -4
- {wolfhece-2.1.11.dist-info → wolfhece-2.1.13.dist-info}/METADATA +1 -1
- {wolfhece-2.1.11.dist-info → wolfhece-2.1.13.dist-info}/RECORD +15 -15
- {wolfhece-2.1.11.dist-info → wolfhece-2.1.13.dist-info}/WHEEL +0 -0
- {wolfhece-2.1.11.dist-info → wolfhece-2.1.13.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.11.dist-info → wolfhece-2.1.13.dist-info}/top_level.txt +0 -0
wolfhece/PyDraw.py
CHANGED
@@ -1168,6 +1168,76 @@ class WolfMapViewer(wx.Frame):
|
|
1168
1168
|
elif itemlabel ==_("Create video..."):
|
1169
1169
|
if self.active_res2d is not None:
|
1170
1170
|
self.create_video()
|
1171
|
+
|
1172
|
+
elif itemlabel == _("Setup cache..."):
|
1173
|
+
|
1174
|
+
if self.active_res2d is None:
|
1175
|
+
logging.warning(_('No active 2D result !'))
|
1176
|
+
return
|
1177
|
+
|
1178
|
+
dlg = wx.MessageDialog(None, _('Cache only water depth results ?'), style=wx.YES_NO)
|
1179
|
+
ret = dlg.ShowModal()
|
1180
|
+
if ret == wx.ID_NO:
|
1181
|
+
only_h = False
|
1182
|
+
else:
|
1183
|
+
only_h = True
|
1184
|
+
dlg.Destroy()
|
1185
|
+
|
1186
|
+
dlg = wx.MessageDialog(None, _('Cache all results ?'), style=wx.YES_NO)
|
1187
|
+
ret = dlg.ShowModal()
|
1188
|
+
if ret == wx.ID_NO:
|
1189
|
+
|
1190
|
+
dlg_start = wx.SingleChoiceDialog(None, _('Choosing the start index'),
|
1191
|
+
_('Choices'),
|
1192
|
+
[str(cur) for cur in range(1,self.active_res2d.get_nbresults()+1)])
|
1193
|
+
ret = dlg_start.ShowModal()
|
1194
|
+
if ret == wx.ID_CANCEL:
|
1195
|
+
dlg_start.Destroy()
|
1196
|
+
return
|
1197
|
+
|
1198
|
+
start_idx = int(dlg_start.GetStringSelection())
|
1199
|
+
dlg_start.Destroy()
|
1200
|
+
|
1201
|
+
dlg_end = wx.SingleChoiceDialog(None, _('Choosing the end index'),
|
1202
|
+
_('Choices'),
|
1203
|
+
[str(cur) for cur in range(start_idx + 1,self.active_res2d.get_nbresults()+1)])
|
1204
|
+
|
1205
|
+
ret = dlg_end.ShowModal()
|
1206
|
+
if ret == wx.ID_CANCEL:
|
1207
|
+
dlg_end.Destroy()
|
1208
|
+
return
|
1209
|
+
|
1210
|
+
dlg_end.Destroy()
|
1211
|
+
|
1212
|
+
end_idx = int(dlg_end.GetStringSelection())
|
1213
|
+
|
1214
|
+
logging.info(_('Caching from {} to {} - Be patient !').format(start_idx, end_idx))
|
1215
|
+
self.active_res2d.setup_cache(start_idx = start_idx-1, end_idx = end_idx-1, only_h=only_h)
|
1216
|
+
logging.info(_('Caching done !'))
|
1217
|
+
else:
|
1218
|
+
logging.info(_('Caching all results - Be patient !'))
|
1219
|
+
self.active_res2d.setup_cache(only_h=only_h)
|
1220
|
+
logging.info(_('Caching done !'))
|
1221
|
+
|
1222
|
+
dlg.Destroy()
|
1223
|
+
|
1224
|
+
elif itemlabel == _("Clear cache..."):
|
1225
|
+
|
1226
|
+
if self.active_res2d is None:
|
1227
|
+
logging.warning(_('No active 2D result !'))
|
1228
|
+
return
|
1229
|
+
|
1230
|
+
self.active_res2d.clear_cache()
|
1231
|
+
logging.info(_('Cache cleared !'))
|
1232
|
+
|
1233
|
+
elif itemlabel == _("Show tiles..."):
|
1234
|
+
|
1235
|
+
if self.active_res2d is None:
|
1236
|
+
logging.warning(_('No active 2D result !'))
|
1237
|
+
return
|
1238
|
+
|
1239
|
+
self.active_res2d.show_tiles()
|
1240
|
+
|
1171
1241
|
|
1172
1242
|
def menu_2dgpu(self):
|
1173
1243
|
|
@@ -2094,8 +2164,8 @@ class WolfMapViewer(wx.Frame):
|
|
2094
2164
|
return
|
2095
2165
|
|
2096
2166
|
if fn=='':
|
2097
|
-
dlg = wx.FileDialog(
|
2098
|
-
|
2167
|
+
dlg = wx.FileDialog(parent = None,
|
2168
|
+
message = _('Choose file name'),
|
2099
2169
|
wildcard = 'AVI video file (*.avi)|*.avi',
|
2100
2170
|
style = wx.FD_SAVE)
|
2101
2171
|
ret = dlg.ShowModal()
|
@@ -2175,6 +2245,12 @@ class WolfMapViewer(wx.Frame):
|
|
2175
2245
|
interval = int(dlg.GetValue())
|
2176
2246
|
dlg.Destroy()
|
2177
2247
|
|
2248
|
+
self.read_one_result(start_step)
|
2249
|
+
|
2250
|
+
for curmodel in self.iterator_over_objects(draw_type.RES2D):
|
2251
|
+
curmodel: Wolfresults_2D
|
2252
|
+
curmodel.step_interval_results = interval
|
2253
|
+
|
2178
2254
|
for idx in tqdm(range(start_step, end_step, interval)):
|
2179
2255
|
|
2180
2256
|
image = Image.frombytes('RGB', fig.canvas.get_width_height(),fig.canvas.tostring_rgb())
|
@@ -2189,6 +2265,11 @@ class WolfMapViewer(wx.Frame):
|
|
2189
2265
|
ax=ax[0],
|
2190
2266
|
title=_('Current time {:0>8} s'.format(el_time)))
|
2191
2267
|
|
2268
|
+
for curmodel in self.iterator_over_objects(draw_type.RES2D):
|
2269
|
+
curmodel: Wolfresults_2D
|
2270
|
+
curmodel.step_interval_results = 1
|
2271
|
+
|
2272
|
+
|
2192
2273
|
def get_canvas_as_image(self) -> Image.Image:
|
2193
2274
|
"""
|
2194
2275
|
Récupère la fenêtre OpenGL sous forme d'image
|
@@ -4008,8 +4089,15 @@ class WolfMapViewer(wx.Frame):
|
|
4008
4089
|
elif unknown == _('Head'):
|
4009
4090
|
unknown = 'head'
|
4010
4091
|
|
4011
|
-
|
4012
|
-
|
4092
|
+
figax = None
|
4093
|
+
for curblock in self.active_res2d.myblocks.values():
|
4094
|
+
if curblock.SelectionData.nb > 0:
|
4095
|
+
|
4096
|
+
figax = self.active_res2d.plot_h(curblock.SelectionData.myselection,
|
4097
|
+
unknown, toshow=False, figax=figax)
|
4098
|
+
if figax is not None:
|
4099
|
+
fig, ax = figax
|
4100
|
+
fig.show()
|
4013
4101
|
|
4014
4102
|
elif itemlabel == _("Plot stats unknown (inside active vector)..."):
|
4015
4103
|
|
@@ -4379,75 +4467,6 @@ class WolfMapViewer(wx.Frame):
|
|
4379
4467
|
# if self.active_res2d is not None:
|
4380
4468
|
# self.create_video()
|
4381
4469
|
|
4382
|
-
elif itemlabel == _("Setup cache..."):
|
4383
|
-
|
4384
|
-
if self.active_res2d is None:
|
4385
|
-
logging.warning(_('No active 2D result !'))
|
4386
|
-
return
|
4387
|
-
|
4388
|
-
dlg = wx.MessageDialog(None, _('Cache only water depth results ?'), style=wx.YES_NO)
|
4389
|
-
ret = dlg.ShowModal()
|
4390
|
-
if ret == wx.ID_NO:
|
4391
|
-
only_h = False
|
4392
|
-
else:
|
4393
|
-
only_h = True
|
4394
|
-
dlg.Destroy()
|
4395
|
-
|
4396
|
-
dlg = wx.MessageDialog(None, _('Cache all results ?'), style=wx.YES_NO)
|
4397
|
-
ret = dlg.ShowModal()
|
4398
|
-
if ret == wx.ID_NO:
|
4399
|
-
|
4400
|
-
dlg_start = wx.SingleChoiceDialog(None, _('Choosing the start index'),
|
4401
|
-
_('Choices'),
|
4402
|
-
[str(cur) for cur in range(1,self.active_res2d.get_nbresults()+1)])
|
4403
|
-
ret = dlg_start.ShowModal()
|
4404
|
-
if ret == wx.ID_CANCEL:
|
4405
|
-
dlg_start.Destroy()
|
4406
|
-
return
|
4407
|
-
|
4408
|
-
start_idx = int(dlg_start.GetStringSelection())
|
4409
|
-
dlg_start.Destroy()
|
4410
|
-
|
4411
|
-
dlg_end = wx.SingleChoiceDialog(None, _('Choosing the end index'),
|
4412
|
-
_('Choices'),
|
4413
|
-
[str(cur) for cur in range(start_idx + 1,self.active_res2d.get_nbresults()+1)])
|
4414
|
-
|
4415
|
-
ret = dlg_end.ShowModal()
|
4416
|
-
if ret == wx.ID_CANCEL:
|
4417
|
-
dlg_end.Destroy()
|
4418
|
-
return
|
4419
|
-
|
4420
|
-
dlg_end.Destroy()
|
4421
|
-
|
4422
|
-
end_idx = int(dlg_end.GetStringSelection())
|
4423
|
-
|
4424
|
-
logging.info(_('Caching from {} to {} - Be patient !').format(start_idx, end_idx))
|
4425
|
-
self.active_res2d.setup_cache(start_idx = start_idx-1, end_idx = end_idx-1, only_h=only_h)
|
4426
|
-
logging.info(_('Caching done !'))
|
4427
|
-
else:
|
4428
|
-
logging.info(_('Caching all results - Be patient !'))
|
4429
|
-
self.active_res2d.setup_cache(only_h=only_h)
|
4430
|
-
logging.info(_('Caching done !'))
|
4431
|
-
|
4432
|
-
dlg.Destroy()
|
4433
|
-
|
4434
|
-
elif itemlabel == _("Clear cache..."):
|
4435
|
-
|
4436
|
-
if self.active_res2d is None:
|
4437
|
-
logging.warning(_('No active 2D result !'))
|
4438
|
-
return
|
4439
|
-
|
4440
|
-
self.active_res2d.clear_cache()
|
4441
|
-
logging.info(_('Cache cleared !'))
|
4442
|
-
|
4443
|
-
elif itemlabel == _("Show tiles..."):
|
4444
|
-
|
4445
|
-
if self.active_res2d is None:
|
4446
|
-
logging.warning(_('No active 2D result !'))
|
4447
|
-
return
|
4448
|
-
|
4449
|
-
self.active_res2d.show_tiles()
|
4450
|
-
|
4451
4470
|
elif itemlabel == _("Manage banks..."):
|
4452
4471
|
if self.active_vector is None:
|
4453
4472
|
msg = _('Active vector is None\nPlease activate the one desired')
|
wolfhece/PyGui.py
CHANGED
@@ -34,22 +34,28 @@ from .CpGrid import CpGrid
|
|
34
34
|
GEOM_GROUP_NAME = _('Block geometry')
|
35
35
|
MAGN_GROUP_NAME = _('Magnetic grid')
|
36
36
|
|
37
|
-
# FIXME : Is it necessary to override wx.Frame ? WolfMapManager is a wx.Frame.
|
38
|
-
# Is it sufficient to run a wx.App ?
|
39
37
|
class GenMapManager(wx.Frame):
|
40
|
-
|
41
|
-
|
38
|
+
"""
|
39
|
+
Default class for a Wolf Map Manager.
|
40
|
+
|
41
|
+
Will be overriden by the specific classes MapManager, GPU2DModel, HydrologyModel, Wolf2DModel.
|
42
|
+
|
43
|
+
It is not suitable for direct use.
|
44
|
+
|
45
|
+
"""
|
42
46
|
|
43
47
|
def __init__(self, *args, **kw):
|
44
48
|
# `args` and `kwargs` represent parameters
|
45
49
|
# that have to be passed to `wx.Frame.__init__`
|
46
50
|
|
47
|
-
self.mapviewer = None
|
48
|
-
self.wx_exists = wx.App.Get() is not None # test if wx App is running
|
51
|
+
self.mapviewer:WolfMapViewer = None
|
52
|
+
self.wx_exists:bool = wx.App.Get() is not None # test if wx App is running
|
49
53
|
self.mylogs=None
|
50
54
|
|
51
55
|
if self.wx_exists:
|
52
56
|
|
57
|
+
super().__init__(parent = None)
|
58
|
+
|
53
59
|
if len(args) == 0:
|
54
60
|
# FIXME This is hackish. the parent parameter should be passed explicitely.
|
55
61
|
# I do it this way to not have to recheck the whole project
|
@@ -73,14 +79,13 @@ class GenMapManager(wx.Frame):
|
|
73
79
|
# Don't pollute the call to wf.Frame.__init__
|
74
80
|
kw.pop(SPLASH_PARAM, None)
|
75
81
|
|
76
|
-
super().__init__(*args)
|
82
|
+
# super().__init__(*args)
|
77
83
|
self.mylogs = create_wxlogwindow(_('Informations'))
|
78
84
|
|
79
85
|
|
80
|
-
def setup_mapviewer(self, title, wolfparent):
|
81
|
-
"""
|
82
|
-
|
83
|
-
"""
|
86
|
+
def setup_mapviewer(self, title:str, wolfparent):
|
87
|
+
""" Setup of a WolfMapViewer """
|
88
|
+
|
84
89
|
self.mapviewer = WolfMapViewer(None,
|
85
90
|
title=title,
|
86
91
|
wolfparent= wolfparent,
|
@@ -88,60 +93,15 @@ class GenMapManager(wx.Frame):
|
|
88
93
|
self.mapviewer.add_grid()
|
89
94
|
self.mapviewer.add_WMS()
|
90
95
|
|
91
|
-
def get_mapviewer(self):
|
92
|
-
|
96
|
+
def get_mapviewer(self) -> WolfMapViewer:
|
97
|
+
""" Retourne une instance WolfMapViewer """
|
98
|
+
|
93
99
|
return self.mapviewer
|
94
100
|
|
95
|
-
def get_configuration(self):
|
96
|
-
|
101
|
+
def get_configuration(self) -> WolfConfiguration:
|
102
|
+
""" Retourne la configuration de Wolf """
|
97
103
|
|
98
|
-
|
99
|
-
# """ Add a grid to the mapviewer """
|
100
|
-
# mygrid=Grid(1000.)
|
101
|
-
|
102
|
-
# if tomapviewer is None:
|
103
|
-
# tomapviewer = self.mapviewer
|
104
|
-
# tomapviewer.add_object('vector',newobj=mygrid,ToCheck=False,id='Grid')
|
105
|
-
|
106
|
-
# def add_WMS(self, tomapviewer:WolfMapViewer=None):
|
107
|
-
# """ Add WMS layers to the mapviewer """
|
108
|
-
# if tomapviewer is None:
|
109
|
-
# tomapviewer = self.mapviewer
|
110
|
-
|
111
|
-
# xmin=0
|
112
|
-
# xmax=0
|
113
|
-
# ymin=0
|
114
|
-
# ymax=0
|
115
|
-
# orthos={'IMAGERIE':{'1971':'ORTHO_1971','1994-2000':'ORTHO_1994_2000',
|
116
|
-
# '2006-2007':'ORTHO_2006_2007',
|
117
|
-
# '2009-2010':'ORTHO_2009_2010',
|
118
|
-
# '2012-2013':'ORTHO_2012_2013',
|
119
|
-
# '2015':'ORTHO_2015','2016':'ORTHO_2016','2017':'ORTHO_2017',
|
120
|
-
# '2018':'ORTHO_2018','2019':'ORTHO_2019','2020':'ORTHO_2020',
|
121
|
-
# '2021':'ORTHO_2021'}}
|
122
|
-
# for idx,(k,item) in enumerate(orthos.items()):
|
123
|
-
# for kdx,(m,subitem) in enumerate(item.items()):
|
124
|
-
# tomapviewer.add_object(which='wmsback',
|
125
|
-
# newobj=imagetexture('PPNC',m,k,subitem,
|
126
|
-
# tomapviewer,xmin,xmax,ymin,ymax,-99999,1024),
|
127
|
-
# ToCheck=False,id='PPNC '+m)
|
128
|
-
|
129
|
-
# tomapviewer.add_object(which='wmsback',
|
130
|
-
# newobj=imagetexture('PPNC','Orthos France','OI.OrthoimageCoverage.HR','',
|
131
|
-
# tomapviewer,xmin,xmax,ymin,ymax,-99999,1024,France=True,epsg='EPSG:27563'),
|
132
|
-
# ToCheck=False,id='Orthos France')
|
133
|
-
|
134
|
-
# forelist={'EAU':{'Aqualim':'RES_LIMNI_DGARNE','Alea':'ALEA_INOND','Lidaxes':'LIDAXES','Juillet 2021':'ZONES_INONDEES','Juillet 2021 IDW':'ZONES_INONDEES$IDW'},
|
135
|
-
# 'LIMITES':{'Secteurs Statistiques':'LIMITES_QS_STATBEL'},
|
136
|
-
# 'INSPIRE':{'Limites administratives':'AU_wms'},
|
137
|
-
# 'PLAN_REGLEMENT':{'Plan Percellaire':'CADMAP_2021_PARCELLES'}}
|
138
|
-
|
139
|
-
# for idx,(k,item) in enumerate(forelist.items()):
|
140
|
-
# for kdx,(m,subitem) in enumerate(item.items()):
|
141
|
-
# tomapviewer.add_object(which='wmsfore',
|
142
|
-
# newobj=imagetexture('PPNC',m,k,subitem,
|
143
|
-
# tomapviewer,xmin,xmax,ymin,ymax,-99999,1024),
|
144
|
-
# ToCheck=False,id=m)
|
104
|
+
return self._configuration
|
145
105
|
|
146
106
|
class MapManager(GenMapManager):
|
147
107
|
def __init__(self,*args, **kw):
|
@@ -155,11 +115,6 @@ class MapManager(GenMapManager):
|
|
155
115
|
|
156
116
|
self.setup_mapviewer(title = 'Wolf - main data manager', wolfparent=self)
|
157
117
|
|
158
|
-
try:
|
159
|
-
self.mylogs.GetFrame().SetIcon(icon)
|
160
|
-
except:
|
161
|
-
logging.error("No icon for the log window")
|
162
|
-
|
163
118
|
try:
|
164
119
|
self.mapviewer.mytooltip.SetIcon(icon)
|
165
120
|
except:
|
@@ -170,7 +125,14 @@ class MapManager(GenMapManager):
|
|
170
125
|
except:
|
171
126
|
logging.error("No icon for the mapviewer window")
|
172
127
|
|
173
|
-
|
128
|
+
if self.wx_exists:
|
129
|
+
try:
|
130
|
+
self.mylogs.GetFrame().SetIcon(icon)
|
131
|
+
except:
|
132
|
+
logging.error("No icon for the log window")
|
133
|
+
|
134
|
+
|
135
|
+
# Set directory for hydrometry data, relative to the current file
|
174
136
|
dir_hydro = Path(__file__).parent / "data/hydrometry"
|
175
137
|
if not exists(dir_hydro):
|
176
138
|
makedirs(dir_hydro, exist_ok=True)
|
@@ -241,19 +203,6 @@ class GPU2DModel(GenMapManager):
|
|
241
203
|
id='res1',
|
242
204
|
ToCheck=False)
|
243
205
|
|
244
|
-
"""self.files_results_array={}
|
245
|
-
self.files_results_array['H']=[]
|
246
|
-
idx=101
|
247
|
-
while path.exists(self.mydir+'//out'+str(idx)+'r.bin'):
|
248
|
-
self.files_results_array['H'].append(['out'+str(idx)+'r.bin','step '+str(idx)])
|
249
|
-
idx+=1
|
250
|
-
|
251
|
-
for curfile in self.files_results_array['H']:
|
252
|
-
curext=curfile[0]
|
253
|
-
curidx=curfile[1]
|
254
|
-
self.allviews.add_object(which='array',filename=self.mydir+'//'+curext,id=curidx,ToCheck=False)
|
255
|
-
"""
|
256
|
-
|
257
206
|
self.mapviewer.findminmax(True)
|
258
207
|
self.mapviewer.Autoscale(False)
|
259
208
|
|
@@ -1840,6 +1789,14 @@ class Wolf2DModel(GenMapManager):
|
|
1840
1789
|
if dlg.ShowModal() == wx.ID_OK:
|
1841
1790
|
try:
|
1842
1791
|
dx, dy = dlg.GetValue().split(',')
|
1792
|
+
|
1793
|
+
try:
|
1794
|
+
floatdx = float(dx)
|
1795
|
+
floatdy = float(dy)
|
1796
|
+
except:
|
1797
|
+
logging.error(_('Invalid fine resolution'))
|
1798
|
+
return
|
1799
|
+
|
1843
1800
|
self.sim.set_mesh_fine_size(float(dx), float(dy))
|
1844
1801
|
self._show_glob_properties()
|
1845
1802
|
except:
|
wolfhece/Results2DGPU.py
CHANGED
@@ -237,6 +237,10 @@ class wolfres2DGPU(Wolfresults_2D):
|
|
237
237
|
try:
|
238
238
|
curblock.top.dx = params["parameters"]["dx"]
|
239
239
|
curblock.top.dy = params["parameters"]["dy"]
|
240
|
+
|
241
|
+
curblock.dx = curblock.top.dx
|
242
|
+
curblock.dy = curblock.top.dy
|
243
|
+
|
240
244
|
except:
|
241
245
|
logging.error(_('No spatial resolution (dx,dy) in parameters.json -- Results will not be shown in viewer'))
|
242
246
|
return -1
|
@@ -244,6 +248,10 @@ class wolfres2DGPU(Wolfresults_2D):
|
|
244
248
|
try:
|
245
249
|
curblock.top.origx = params["parameters"]["base_coord_x"]
|
246
250
|
curblock.top.origy = params["parameters"]["base_coord_y"]
|
251
|
+
|
252
|
+
curblock.origx = curblock.top.origx
|
253
|
+
curblock.origy = curblock.top.origy
|
254
|
+
|
247
255
|
except:
|
248
256
|
logging.error(_('No spatial position (base_coord_x,base_coord_y) in parameters.json -- Results will not be spatially based'))
|
249
257
|
return -2
|
@@ -406,12 +414,12 @@ class wolfres2DGPU(Wolfresults_2D):
|
|
406
414
|
self.current_result = self._sanitize_result_step(self.current_result)
|
407
415
|
self.read_oneresult(self.current_result)
|
408
416
|
|
409
|
-
def read_next(self):
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
417
|
+
# def read_next(self):
|
418
|
+
# """
|
419
|
+
# Lecture du pas suivant
|
420
|
+
# """
|
421
|
+
# self.current_result+= self._step_interval
|
422
|
+
# self._update_result_view()
|
415
423
|
|
416
424
|
def get_times_steps(self, nb:int = None):
|
417
425
|
"""
|
@@ -441,12 +449,12 @@ class wolfres2DGPU(Wolfresults_2D):
|
|
441
449
|
else:
|
442
450
|
return self.times, self.timesteps
|
443
451
|
|
444
|
-
def read_previous(self):
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
452
|
+
# def read_previous(self):
|
453
|
+
# """
|
454
|
+
# Lecture du pas suivant
|
455
|
+
# """
|
456
|
+
# self.current_result -= self._step_interval
|
457
|
+
# self._update_result_view()
|
450
458
|
|
451
459
|
def get_cached_h(self, idx):
|
452
460
|
""" Return cached water depth according to WOLF convention """
|
wolfhece/apps/version.py
CHANGED
wolfhece/hydrology/Catchment.py
CHANGED
@@ -194,7 +194,7 @@ class Catchment:
|
|
194
194
|
# self.topo_wolf_array = WolfArray(self.workingDir + "Characteristic_maps/Drainage_basin.b")
|
195
195
|
# self.topo_wolf_array = WolfArray(self.workingDir + "Characteristic_maps/Drainage_basin.b2")
|
196
196
|
self.time_wolf_array = WolfArray(os.path.join(self.workingDir,"Characteristic_maps/Drainage_basin.time"))
|
197
|
-
self.charact_watrshd = Watershed(self.workingDir)
|
197
|
+
self.charact_watrshd = Watershed(self.workingDir, dir_mnt_subpixels=self.paramsInput[('Sub-pixeling', 'Directory')])
|
198
198
|
self.set_eff_outlet_coord()
|
199
199
|
|
200
200
|
# time array:
|
@@ -1416,10 +1416,10 @@ class Catchment:
|
|
1416
1416
|
endFileName = "rain.hyeto"
|
1417
1417
|
for element in self.hyetoDict['Ordered To Nb']:
|
1418
1418
|
nbToRead = self.hyetoDict['Ordered To Nb'][element]
|
1419
|
-
fileName = os.path.join(beginFileName, nbToRead
|
1419
|
+
fileName = os.path.join(beginFileName, nbToRead+ endFileName)
|
1420
1420
|
isOk, fileName = check_path(fileName, applyCWD=True)
|
1421
1421
|
if isOk<0:
|
1422
|
-
print("WARNING: could not find any dbf file! ")
|
1422
|
+
# print("WARNING: could not find any dbf file! ")
|
1423
1423
|
time_mod.sleep(.5)
|
1424
1424
|
return
|
1425
1425
|
[time, rain] = self.get_hyeto(fileName)
|
@@ -1856,7 +1856,7 @@ class Catchment:
|
|
1856
1856
|
directory = self.paramsInput.get_param("Measuring stations SPW", "Directory")
|
1857
1857
|
isOk, directory = check_path(directory, self.workingDir)
|
1858
1858
|
if isOk<0:
|
1859
|
-
|
1859
|
+
logging.error(_("ERROR : measuring station data path not present! "))
|
1860
1860
|
fileName = os.path.join(directory, self.paramsInput.get_param("Measuring stations SPW", "Filename"))
|
1861
1861
|
|
1862
1862
|
|
@@ -1869,7 +1869,7 @@ class Catchment:
|
|
1869
1869
|
for raw in data_reader:
|
1870
1870
|
list_data.append(raw)
|
1871
1871
|
else:
|
1872
|
-
|
1872
|
+
logging.error(_("ERROR : measuring station data file not present! "))
|
1873
1873
|
return
|
1874
1874
|
|
1875
1875
|
# Building dictionnary
|
@@ -1185,10 +1185,13 @@ class Watershed:
|
|
1185
1185
|
computecorr:bool=False,
|
1186
1186
|
plotstats:bool=False,
|
1187
1187
|
plotriversystem=False,
|
1188
|
+
dir_mnt_subpixels:str=None,
|
1188
1189
|
*args, **kwargs):
|
1189
1190
|
|
1190
1191
|
logging.info(_('Read files...'))
|
1192
|
+
|
1191
1193
|
self.dir=os.path.normpath(dir)
|
1194
|
+
self.dir_mnt_subpixels = dir_mnt_subpixels if dir_mnt_subpixels is not None else self.dir
|
1192
1195
|
|
1193
1196
|
self.subs_array = WolfArray(self.dir+'\\Characteristic_maps\\Drainage_basin.sub')
|
1194
1197
|
|
@@ -1625,21 +1628,26 @@ class Watershed:
|
|
1625
1628
|
Recherche des altitudes dans un mnt plus dense
|
1626
1629
|
"""
|
1627
1630
|
demsubs = {}
|
1628
|
-
|
1631
|
+
|
1632
|
+
file_10m = os.path.join(self.dir_mnt_subpixels,'mnt10m.bin')
|
1629
1633
|
isOk, file_10m = check_path(file_10m, prefix=self.dir)
|
1630
1634
|
if isOk>=0:
|
1631
1635
|
dem_10m=WolfArray(file_10m)
|
1632
1636
|
demsubs["dem_10m"] = dem_10m
|
1637
|
+
else:
|
1638
|
+
logging.warning(_('No 10m DEM found'))
|
1633
1639
|
|
1634
|
-
file_20m = os.path.join(self.
|
1640
|
+
file_20m = os.path.join(self.dir_mnt_subpixels,'mnt20m.bin')
|
1635
1641
|
isOk, file_20m = check_path(file_20m, prefix=self.dir)
|
1636
1642
|
if isOk>=0:
|
1637
1643
|
dem_20m=WolfArray(file_20m)
|
1638
1644
|
demsubs["dem_20m"] = dem_20m
|
1639
|
-
|
1645
|
+
else:
|
1646
|
+
logging.warning(_('No 20m DEM found'))
|
1640
1647
|
|
1641
1648
|
# demsubs={'dem_10m':dem_10m,'dem_20m':dem_20m}
|
1642
1649
|
if len(demsubs)==0:
|
1650
|
+
logging.info(_('No subpixel DEM found'))
|
1643
1651
|
return
|
1644
1652
|
|
1645
1653
|
curnode:Node_Watershed
|
wolfhece/hydrology/SubBasin.py
CHANGED
@@ -248,7 +248,7 @@ class SubBasin:
|
|
248
248
|
file_exists = os.path.exists(fileName)
|
249
249
|
if(not(file_exists)):
|
250
250
|
typeOfFileName = 'simul_net_trans_rain.txt'
|
251
|
-
fileName = workingDir
|
251
|
+
fileName = join(workingDir, subBasinName + typeOfFileName)
|
252
252
|
file_exists = os.path.exists(fileName)
|
253
253
|
if(file_exists):
|
254
254
|
print("ERROR : the file simul_net_trans_rain.txt is not used yet in this version! Please check version of the code before 05/11/2021 !")
|
wolfhece/mesh2d/wolf2dprev.py
CHANGED
@@ -8457,6 +8457,10 @@ class blocks_file():
|
|
8457
8457
|
def add_block(self, contour:zone, dx:float, dy:float):
|
8458
8458
|
"""Add a block to the list of blocks"""
|
8459
8459
|
|
8460
|
+
if contour is None:
|
8461
|
+
logging.error(_('No contour zone available for block creation - Create a contour first'))
|
8462
|
+
return
|
8463
|
+
|
8460
8464
|
new_block = block_description(self, idx = self.nb_blocks+1)
|
8461
8465
|
new_block.setup(contour, dx, dy)
|
8462
8466
|
self.my_blocks.append(new_block)
|
wolfhece/models/blue.pal
CHANGED
wolfhece/wolfresults_2D.py
CHANGED
@@ -1434,7 +1434,7 @@ class OneWolfResult:
|
|
1434
1434
|
self._sedimentdensity = 2.65
|
1435
1435
|
self._force_update_shields = True # Force la MAJ du Shields si le diametre ou la densité change
|
1436
1436
|
|
1437
|
-
self.mngselection = SelectionData(self.current)
|
1437
|
+
# self.mngselection = SelectionData(self.current)
|
1438
1438
|
|
1439
1439
|
@property
|
1440
1440
|
def SelectionData(self) -> SelectionDataMB:
|
@@ -1716,6 +1716,9 @@ class OneWolfResult:
|
|
1716
1716
|
self._current.idx = self.idx
|
1717
1717
|
self._current.nullvalue = nullvalue
|
1718
1718
|
|
1719
|
+
self.mngselection = SelectionData(self._current)
|
1720
|
+
|
1721
|
+
|
1719
1722
|
@property
|
1720
1723
|
def min_field_size(self):
|
1721
1724
|
return self._min_field_size
|
@@ -2008,7 +2011,10 @@ class Wolfresults_2D(Element_To_Draw):
|
|
2008
2011
|
self._epsilon_default = self.epsilon
|
2009
2012
|
|
2010
2013
|
self.loaded=True
|
2014
|
+
|
2011
2015
|
self.current_result = -1
|
2016
|
+
self._step_interval = 1
|
2017
|
+
|
2012
2018
|
self.mypal = wolfpalette(None,'Colors')
|
2013
2019
|
self.mypal.default16()
|
2014
2020
|
self.mypal.automatic = True
|
@@ -2308,6 +2314,14 @@ class Wolfresults_2D(Element_To_Draw):
|
|
2308
2314
|
|
2309
2315
|
return x>=xmin and x<=xmax and y>=ymin and y<=ymax
|
2310
2316
|
|
2317
|
+
@property
|
2318
|
+
def step_interval_results(self):
|
2319
|
+
return self._step_interval
|
2320
|
+
|
2321
|
+
@step_interval_results.setter
|
2322
|
+
def step_interval_results(self, value:int):
|
2323
|
+
self._step_interval = value
|
2324
|
+
|
2311
2325
|
@property
|
2312
2326
|
def nullvalue(self):
|
2313
2327
|
""" Get nullvalue from the first block """
|
@@ -2875,7 +2889,7 @@ class Wolfresults_2D(Element_To_Draw):
|
|
2875
2889
|
Lecture du pas suivant
|
2876
2890
|
"""
|
2877
2891
|
|
2878
|
-
self.current_result +=
|
2892
|
+
self.current_result += self._step_interval
|
2879
2893
|
self._update_result_view()
|
2880
2894
|
|
2881
2895
|
def _sanitize_result_step(self, which_step:int=-1):
|
@@ -3006,7 +3020,7 @@ class Wolfresults_2D(Element_To_Draw):
|
|
3006
3020
|
"""
|
3007
3021
|
|
3008
3022
|
# if self.current_result > 0:
|
3009
|
-
self.current_result -=
|
3023
|
+
self.current_result -= self._step_interval
|
3010
3024
|
self._update_result_view()
|
3011
3025
|
|
3012
3026
|
def get_h_for_block(self, block: Union[int, str]) -> WolfArray:
|
@@ -4026,7 +4040,7 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4026
4040
|
if self.current_result==-1:
|
4027
4041
|
self.read_oneresult(-1)
|
4028
4042
|
else:
|
4029
|
-
self.current_result+=
|
4043
|
+
self.current_result+= self._step_interval
|
4030
4044
|
self.current_result = min(nb,self.current_result)
|
4031
4045
|
self.read_oneresult(self.current_result)
|
4032
4046
|
|
@@ -6,8 +6,8 @@ wolfhece/ManageParams.py,sha256=Wgt5Zh7QBtyiwTAltPHunSLqt4XuVuRH76GTUrXabS4,219
|
|
6
6
|
wolfhece/Model1D.py,sha256=-cMz-ePSYzrKVVDidiDOz6cojEZ3y6u9gIb7RPwT6Y8,476593
|
7
7
|
wolfhece/PyConfig.py,sha256=oGSL1WsLM9uinlNP4zGBLK3uHPmBfduUi7R-VtWuRFA,8034
|
8
8
|
wolfhece/PyCrosssections.py,sha256=f4dNYRUGZKePruaaBiTcn5vlrw8TFTj9XwTDrdiF_uU,112450
|
9
|
-
wolfhece/PyDraw.py,sha256=
|
10
|
-
wolfhece/PyGui.py,sha256=
|
9
|
+
wolfhece/PyDraw.py,sha256=JA_tGLF5LbhAK3565bKR32pI-Nvg3nLbxRoQhRGuf1Y,379054
|
10
|
+
wolfhece/PyGui.py,sha256=7p4ecrrODTggH8Oz4GTg4rWk6Z3vhYH4GNAE4TL3VY8,102058
|
11
11
|
wolfhece/PyGuiHydrology.py,sha256=wKhR-KthPRyzJ887NmsozmUpm2CIQIwO3IbYORCYjrE,7290
|
12
12
|
wolfhece/PyHydrographs.py,sha256=GKK8U0byI45H9O_e4LAOOi7Aw0Tg7Q0Lx322stPg5IQ,3453
|
13
13
|
wolfhece/PyPalette.py,sha256=Vl5RrBIC_a5-mZKUtBd5kG0mif946B7OtS3fnehkmOc,25012
|
@@ -21,7 +21,7 @@ wolfhece/RatingCurve.py,sha256=YSQvSvdMHE6hSlWVBF5Oe0-Fh3waNMpOdmcymaCCTis,21706
|
|
21
21
|
wolfhece/RatingCurveData.py,sha256=5UvnIm89BwqjnEbLCcY3CA8WoFd_xHJbooNy62fX5iY,57660
|
22
22
|
wolfhece/RatingCurve_xml.py,sha256=vbLxSWwHPsCAsR13KaG5WVmVn_cha7-6cF4zj7Diiz8,33593
|
23
23
|
wolfhece/ReadDataDCENN.py,sha256=4OMDBgkZ_v7OWmVhyQ-reab7MPxGhFEDY2qS8yThhdM,1240
|
24
|
-
wolfhece/Results2DGPU.py,sha256=
|
24
|
+
wolfhece/Results2DGPU.py,sha256=pC7jHQhzSJPmGiboNNLG619yVYaOUT_O5_yhKMzslxA,20563
|
25
25
|
wolfhece/__init__.py,sha256=FRDE8PiJAWxX9PMXsShRMZ8YADAY4WIgKMRh52rmhiw,23
|
26
26
|
wolfhece/_add_path.py,sha256=nudniS-lsgHwXXq5o626XRDzIeYj76GoGKYt6lcu2Nc,616
|
27
27
|
wolfhece/cli.py,sha256=rHxZGgs_R776VCWhs36pYFoiuiQycwgGTVOLK-JNzjE,1937
|
@@ -54,7 +54,7 @@ wolfhece/wolf_texture.py,sha256=llQ7aV8scWXIkhpri9XjaPejzoBJsGfsln2ZnlRbFkU,1627
|
|
54
54
|
wolfhece/wolf_tiles.py,sha256=F2JsJHdAP8fIffNJdG_J26bonCIRtIwMmxKFqdSCRDA,10088
|
55
55
|
wolfhece/wolf_vrt.py,sha256=un5CKzAUmzSsjLXK7YLnQEWz8FLoafXJs8oqUvS_-h0,10271
|
56
56
|
wolfhece/wolf_zi_db.py,sha256=Ok0MxQYZMMLRJN1QY-HSplLhUzzb6gkXgBQ3ihhLQHk,12669
|
57
|
-
wolfhece/wolfresults_2D.py,sha256=
|
57
|
+
wolfhece/wolfresults_2D.py,sha256=6VbONzD2lMFCnZ2-gyBk7pW9LcBmSWkZxiVLTMKVPIQ,159403
|
58
58
|
wolfhece/xyz_file.py,sha256=aQOcTHkHRhXHxL_WxTHwzygp6e47San7SHSpxKQU0dw,5457
|
59
59
|
wolfhece/apps/ManageParams.py,sha256=heg5L4fMn0ettR7Bad_Q680o_JWnTbe3WFkL_9IziAk,312
|
60
60
|
wolfhece/apps/Optimisation_hydro.py,sha256=mHazBazTUGyxPbHPXhaQim8vqIeOOuKPjH0B48VWduA,374
|
@@ -66,7 +66,7 @@ wolfhece/apps/check_install.py,sha256=jrKR-njqnpIh6ZJqvP6KbDUPVCfwTNQj4glQhcyzs9
|
|
66
66
|
wolfhece/apps/curvedigitizer.py,sha256=avWERHuVxPnJBOD_ibczwW_XG4vAenqWS8W1zjhBox8,4898
|
67
67
|
wolfhece/apps/isocurrent.py,sha256=4XnNWPa8mYUK7V4zdDRFrHFIXNG2AN2og3TqWKKcqjY,3811
|
68
68
|
wolfhece/apps/splashscreen.py,sha256=LkEVMK0eCc84NeCWD3CGja7fuQ_k1PrZdyqD3GQk_8c,2118
|
69
|
-
wolfhece/apps/version.py,sha256=
|
69
|
+
wolfhece/apps/version.py,sha256=a9eiwDNszu93f8vdAjTr999YFaeZRJGnUP8ygnLdzJg,388
|
70
70
|
wolfhece/apps/wolf.py,sha256=gqfm-ZaUJqNsfCzmdtemSeqLw-GVdSVix-evg5WArJI,293
|
71
71
|
wolfhece/apps/wolf2D.py,sha256=gWD9ee2-1pw_nUxjgRaJMuSe4kUT-RWhOeoTt_Lh1mM,267
|
72
72
|
wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
|
@@ -96,15 +96,15 @@ wolfhece/fonts/helvetica.ttf,sha256=X4Zd3zdUmuRGMLE6UB-BMIbirpdK3Ia5czfNnuSx5P8,
|
|
96
96
|
wolfhece/fonts/sanserif.ttf,sha256=Nvv5eMgTl5-bWgV37B7E1-vZpAZPNJwjtJSzMNDrl9A,42696
|
97
97
|
wolfhece/ftp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
98
98
|
wolfhece/ftp/downloader.py,sha256=NANzxSzdcp25dFMYin5QA9UnFexNe6-W2AqqTzUE4f4,5223
|
99
|
-
wolfhece/hydrology/Catchment.py,sha256=
|
99
|
+
wolfhece/hydrology/Catchment.py,sha256=j4ggD0FQn04s9thXYHB-HiOx3tkvTmwt8R5QSgwNDlE,135112
|
100
100
|
wolfhece/hydrology/Comparison.py,sha256=vO9ogoZA8qzG57pg1AdHNL9HWgCCY8-5wqPyCgj1ucg,82209
|
101
101
|
wolfhece/hydrology/Dumping.py,sha256=GKYvkKgCfJQT1XEF1ceh7evdhlpZRPcuf6VlBdH-TaM,2085
|
102
102
|
wolfhece/hydrology/Optimisation.py,sha256=kpfR-krMRzANU96Mn4H2kroIuEmMWns8quEnLSFGB8E,138736
|
103
103
|
wolfhece/hydrology/Outlet.py,sha256=fpetH2ZKnTKIBNuVclxrncc5OAxWUGI5_ed9gXh6fD4,10201
|
104
104
|
wolfhece/hydrology/PostProcessHydrology.py,sha256=SiW5FIf8FeQL9ItWG8ODt612k5m59aogSLgpsXinr8I,6944
|
105
|
-
wolfhece/hydrology/PyWatershed.py,sha256=
|
105
|
+
wolfhece/hydrology/PyWatershed.py,sha256=gSCEz7W38fnTNyjBYgiepUbZbluCDSGIpzTMNDVzXPc,74277
|
106
106
|
wolfhece/hydrology/RetentionBasin.py,sha256=UZiHvygNEMfNdaK49CX3y8jzqwkThwwniS9ob1BTECs,71505
|
107
|
-
wolfhece/hydrology/SubBasin.py,sha256=
|
107
|
+
wolfhece/hydrology/SubBasin.py,sha256=4qpvPi41R9gmKDzyJA_S77k953w2FknnsP2ZSRZQstE,169754
|
108
108
|
wolfhece/hydrology/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
109
109
|
wolfhece/hydrology/constant.py,sha256=nRn4IuQ1FZakQtS6z9IpVHeudMfU_7KQ66LCxY6NX4k,1227
|
110
110
|
wolfhece/hydrology/cst_exchanges.py,sha256=u0Bs4SBOjgp6n6xuKusHvUCI0abeiEIUpBZRr11RExg,17569
|
@@ -217,9 +217,9 @@ wolfhece/mesh2d/bc_manager.py,sha256=OzN4NPlDniv9HsLTUQrJkBY6U_a3SkqNpvjIw0TcguI
|
|
217
217
|
wolfhece/mesh2d/cell_tracker.py,sha256=AR-Bty-QnrY1ni8Lwak2kU2UWMAJSBCF2ugl2YpfsB4,8660
|
218
218
|
wolfhece/mesh2d/config_manager.py,sha256=qQE5sPbHj9cNZe3uGk1pkuogsS28kJZNx3xybZ6CfCM,14438
|
219
219
|
wolfhece/mesh2d/cst_2D_boundary_conditions.py,sha256=cZrHvtfqqTWtUcWnUe9iy9ZY6lAWAJnDoVupV6H7Zw4,4710
|
220
|
-
wolfhece/mesh2d/wolf2dprev.py,sha256=
|
220
|
+
wolfhece/mesh2d/wolf2dprev.py,sha256=Lbm-Qp4PVEEphOm3AHVwW9BiZQxrab40GYlABaK0-A4,491191
|
221
221
|
wolfhece/models/HECE_169.pptx,sha256=OWJtsWz504A-REFaaxw8lwStHyQU2l7KEeiE7IZvtbk,3396930
|
222
|
-
wolfhece/models/blue.pal,sha256=
|
222
|
+
wolfhece/models/blue.pal,sha256=s9-wEPzSiKMMHuKofUB2FPjmyO7HfGM2xWaUJwsKAY8,39
|
223
223
|
wolfhece/models/diff16.pal,sha256=Pkp9kQ1GvmAKz3lgwohsw8eQySjVVKHbjhoWw-gZ6Nc,303
|
224
224
|
wolfhece/models/diff3.pal,sha256=qk-yGgJr_FHdW7p7i93GFsH9ClT0dl5nqa9G1lLh7Z0,50
|
225
225
|
wolfhece/models/red.pal,sha256=W6oeIjDCoGCsJDZPH2K4jfyfPmCMlH9rfRi4PTs-n28,33
|
@@ -267,8 +267,8 @@ wolfhece/sounds/sonsw2.wav,sha256=pFLVt6By0_EPQNt_3KfEZ9a1uSuYTgQSX1I_Zurv9Rc,11
|
|
267
267
|
wolfhece/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
268
268
|
wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa7tbNQ_SxqhpAZxhm-mTy4,14860
|
269
269
|
wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=wCxGRnE3kzEkWlWA6-3X8ADOFux_B0a5QWJ2GnXTgJw,4709
|
270
|
-
wolfhece-2.1.
|
271
|
-
wolfhece-2.1.
|
272
|
-
wolfhece-2.1.
|
273
|
-
wolfhece-2.1.
|
274
|
-
wolfhece-2.1.
|
270
|
+
wolfhece-2.1.13.dist-info/METADATA,sha256=DghX1BAmzBJLe8etnO3FCeT-LTKyab8jTTcZ5PUWhlw,2282
|
271
|
+
wolfhece-2.1.13.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
272
|
+
wolfhece-2.1.13.dist-info/entry_points.txt,sha256=AIu1KMswrdsqNq_2jPtrRIU4tLjuTnj2dCY-pxIlshw,276
|
273
|
+
wolfhece-2.1.13.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
|
274
|
+
wolfhece-2.1.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|