wolfhece 2.1.17__py3-none-any.whl → 2.1.19__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 +46 -10
- wolfhece/PyWMS.py +12 -11
- wolfhece/apps/version.py +1 -1
- wolfhece/models/white_black.pal +9 -0
- wolfhece/wolf_array.py +129 -5
- wolfhece/wolfresults_2D.py +32 -11
- {wolfhece-2.1.17.dist-info → wolfhece-2.1.19.dist-info}/METADATA +1 -1
- {wolfhece-2.1.17.dist-info → wolfhece-2.1.19.dist-info}/RECORD +11 -10
- {wolfhece-2.1.17.dist-info → wolfhece-2.1.19.dist-info}/WHEEL +0 -0
- {wolfhece-2.1.17.dist-info → wolfhece-2.1.19.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.17.dist-info → wolfhece-2.1.19.dist-info}/top_level.txt +0 -0
wolfhece/PyDraw.py
CHANGED
@@ -882,7 +882,12 @@ class WolfMapViewer(wx.Frame):
|
|
882
882
|
|
883
883
|
|
884
884
|
def get_canvas_bounds(self, gridsize:float = None):
|
885
|
-
"""
|
885
|
+
"""
|
886
|
+
Retourne les limites de la zone d'affichage
|
887
|
+
|
888
|
+
:return: [xmin, ymin, xmax, ymax]
|
889
|
+
|
890
|
+
"""
|
886
891
|
|
887
892
|
if gridsize is None:
|
888
893
|
|
@@ -1261,7 +1266,7 @@ class WolfMapViewer(wx.Frame):
|
|
1261
1266
|
|
1262
1267
|
outdir = dlg.GetPath()
|
1263
1268
|
|
1264
|
-
names = ['danger_h.tif', 'danger_u.tif', 'danger_q.tif']
|
1269
|
+
names = ['danger_h.tif', 'danger_u.tif', 'danger_q.tif', 'danger_Z.tif']
|
1265
1270
|
for name, danger_map in zip(names, danger_maps):
|
1266
1271
|
danger_map.write_all(Path(outdir) / name)
|
1267
1272
|
|
@@ -2772,13 +2777,26 @@ class WolfMapViewer(wx.Frame):
|
|
2772
2777
|
'2015': 'ORTHO_2015', '2016': 'ORTHO_2016', '2017': 'ORTHO_2017',
|
2773
2778
|
'2018': 'ORTHO_2018', '2019': 'ORTHO_2019', '2020': 'ORTHO_2020',
|
2774
2779
|
'2021': 'ORTHO_2021', '2022 printemps': 'ORTHO_2022_PRINTEMPS', '2022 été': 'ORTHO_2022_ETE',
|
2775
|
-
'2023 été': 'ORTHO_2023_ETE'
|
2780
|
+
'2023 été': 'ORTHO_2023_ETE',
|
2781
|
+
}}
|
2782
|
+
data_2021 = {'EAU': {'IDW': 'ZONES_INONDEES_IDW',
|
2783
|
+
'Emprise': 'ZONES_INONDEES',
|
2784
|
+
'Emprise wo Alea': 'ZONES_INONDEES_wo_alea'}}
|
2785
|
+
|
2776
2786
|
for idx, (k, item) in enumerate(orthos.items()):
|
2777
2787
|
for kdx, (m, subitem) in enumerate(item.items()):
|
2778
2788
|
self.add_object(which='wmsback',
|
2779
2789
|
newobj=imagetexture('PPNC', m, k, subitem,
|
2780
2790
|
self, xmin, xmax, ymin, ymax, -99999, 1024),
|
2781
2791
|
ToCheck=False, id='PPNC ' + m)
|
2792
|
+
|
2793
|
+
for idx, (k, item) in enumerate(data_2021.items()):
|
2794
|
+
for kdx, (m, subitem) in enumerate(item.items()):
|
2795
|
+
self.add_object(which='wmsback',
|
2796
|
+
newobj=imagetexture('PPNC', m, k, subitem,
|
2797
|
+
self, xmin, xmax, ymin, ymax, -99999, 1024),
|
2798
|
+
ToCheck=False, id='Data 2021 ' + m)
|
2799
|
+
|
2782
2800
|
self.add_object(which='wmsback',
|
2783
2801
|
newobj=imagetexture('PPNC', 'Orthos France', 'OI.OrthoimageCoverage.HR', '',
|
2784
2802
|
self, xmin, xmax, ymin, ymax, -99999, 1024, France=True, epsg='EPSG:27563'),
|
@@ -5594,7 +5612,7 @@ class WolfMapViewer(wx.Frame):
|
|
5594
5612
|
Add object to current Frame/Drawing area
|
5595
5613
|
"""
|
5596
5614
|
|
5597
|
-
filterArray = "bin (*.bin)|*.bin|Elevation WOLF2D (*.top)|*.top|Geotif (*.tif)|*.tif|Float ESRI (*.flt)|*.flt|Numpy (*.npy)|*.npy|Numpy named arrays(*.npz)|*.npz|all (*.*)|*.*"
|
5615
|
+
filterArray = "All supported formats|*.bin;*.tif;*.tiff;*.top;*.flt;*.npy;*.npz|bin (*.bin)|*.bin|Elevation WOLF2D (*.top)|*.top|Geotif (*.tif)|*.tif|Float ESRI (*.flt)|*.flt|Numpy (*.npy)|*.npy|Numpy named arrays(*.npz)|*.npz|all (*.*)|*.*"
|
5598
5616
|
filterjson = "json (*.json)|*.json|all (*.*)|*.*"
|
5599
5617
|
filterall = "all (*.*)|*.*"
|
5600
5618
|
filterres2d = "all (*.*)|*.*"
|
@@ -5662,6 +5680,7 @@ class WolfMapViewer(wx.Frame):
|
|
5662
5680
|
|
5663
5681
|
curtree = None
|
5664
5682
|
if which.lower() == 'array' or which.lower() == 'array_crop':
|
5683
|
+
|
5665
5684
|
curdict = self.myarrays
|
5666
5685
|
curtree = self.myitemsarray
|
5667
5686
|
|
@@ -5860,7 +5879,7 @@ class WolfMapViewer(wx.Frame):
|
|
5860
5879
|
|
5861
5880
|
with wx.lib.busy.BusyInfo(_('Importing files')):
|
5862
5881
|
wait = wx.BusyCursor()
|
5863
|
-
newobj = Tiles(filename, parent=self, linked_data_dir=dirname)
|
5882
|
+
newobj = Tiles(filename, parent=self, linked_data_dir=dirname, mapviewer=self)
|
5864
5883
|
del wait
|
5865
5884
|
|
5866
5885
|
if which.lower() == 'tilescomp':
|
@@ -5947,6 +5966,7 @@ class WolfMapViewer(wx.Frame):
|
|
5947
5966
|
self._set_active_bc()
|
5948
5967
|
|
5949
5968
|
elif which.lower() == 'array_lidar_first' or which.lower() == 'array_lidar_second':
|
5969
|
+
|
5950
5970
|
curdict = self.myarrays
|
5951
5971
|
curtree = self.myitemsarray
|
5952
5972
|
|
@@ -6001,6 +6021,7 @@ class WolfMapViewer(wx.Frame):
|
|
6001
6021
|
id = 'lidar2002_secondecho'
|
6002
6022
|
|
6003
6023
|
elif which.lower() == 'res2d':
|
6024
|
+
|
6004
6025
|
curdict = self.myres2D
|
6005
6026
|
curtree = self.myitemsres2d
|
6006
6027
|
|
@@ -6016,6 +6037,7 @@ class WolfMapViewer(wx.Frame):
|
|
6016
6037
|
self.active_res2d = newobj
|
6017
6038
|
|
6018
6039
|
elif which.lower() == 'res2d_gpu':
|
6040
|
+
|
6019
6041
|
curdict = self.myres2D
|
6020
6042
|
curtree = self.myitemsres2d
|
6021
6043
|
|
@@ -6042,6 +6064,7 @@ class WolfMapViewer(wx.Frame):
|
|
6042
6064
|
self.myvectors.append(newobj)
|
6043
6065
|
|
6044
6066
|
elif which.lower() == 'cross_sections':
|
6067
|
+
|
6045
6068
|
curdict = self.myvectors
|
6046
6069
|
curtree = self.myitemsvector
|
6047
6070
|
|
@@ -6107,7 +6130,7 @@ class WolfMapViewer(wx.Frame):
|
|
6107
6130
|
|
6108
6131
|
with wx.lib.busy.BusyInfo(_('Importing cloud points')):
|
6109
6132
|
wait = wx.BusyCursor()
|
6110
|
-
newobj = cloud_vertices(filename, header=loadhead)
|
6133
|
+
newobj = cloud_vertices(filename, header=loadhead, mapviewer=self)
|
6111
6134
|
del wait
|
6112
6135
|
|
6113
6136
|
self.myclouds.append(newobj)
|
@@ -6116,12 +6139,13 @@ class WolfMapViewer(wx.Frame):
|
|
6116
6139
|
self.create_cloud_menu()
|
6117
6140
|
|
6118
6141
|
elif which.lower() == 'triangulation':
|
6142
|
+
|
6119
6143
|
curdict = self.mytri
|
6120
6144
|
curtree = self.myitemstri
|
6121
6145
|
if newobj is None:
|
6122
6146
|
with wx.lib.busy.BusyInfo(_('Importing triangulation')):
|
6123
6147
|
wait = wx.BusyCursor()
|
6124
|
-
newobj = Triangulation(filename,mapviewer=self)
|
6148
|
+
newobj = Triangulation(filename, mapviewer=self)
|
6125
6149
|
del wait
|
6126
6150
|
|
6127
6151
|
self.mytri.append(newobj)
|
@@ -6134,8 +6158,11 @@ class WolfMapViewer(wx.Frame):
|
|
6134
6158
|
curtree = self.myitemsothers
|
6135
6159
|
self.myothers.append(newobj)
|
6136
6160
|
newobj.mapviewer = self
|
6161
|
+
else:
|
6162
|
+
logging.warning('No object to add in "Other" category -- Please provide an object to add or check your code')
|
6137
6163
|
|
6138
6164
|
elif which.lower() == 'views':
|
6165
|
+
|
6139
6166
|
if newobj is None:
|
6140
6167
|
newobj = WolfViews(plotted=ToCheck, mapviewer=self)
|
6141
6168
|
newobj.read_from_file(filename)
|
@@ -6145,22 +6172,29 @@ class WolfMapViewer(wx.Frame):
|
|
6145
6172
|
self.myviews.append(newobj)
|
6146
6173
|
|
6147
6174
|
elif which.lower() == 'wmsback':
|
6175
|
+
|
6148
6176
|
if not newobj is None:
|
6149
6177
|
curdict = self.mywmsback
|
6150
6178
|
curtree = self.myitemswmsback
|
6151
6179
|
self.mywmsback.append(newobj)
|
6180
|
+
else:
|
6181
|
+
logging.warning('No object to add in "WMS background" category -- Please provide an object to add or check your code')
|
6152
6182
|
|
6153
6183
|
elif which.lower() == 'wmsfore':
|
6184
|
+
|
6154
6185
|
if not newobj is None:
|
6155
6186
|
curdict = self.mywmsfore
|
6156
6187
|
curtree = self.myitemswmsfore
|
6157
6188
|
self.mywmsfore.append(newobj)
|
6189
|
+
else:
|
6190
|
+
logging.warning('No object to add in "WMS foreground" category -- Please provide an object to add or check your code')
|
6158
6191
|
|
6159
6192
|
elif which.lower() == 'particlesystem':
|
6193
|
+
|
6160
6194
|
curdict = self.mypartsystems
|
6161
6195
|
curtree = self.myitemsps
|
6162
6196
|
if newobj is None:
|
6163
|
-
newobj = Particle_system()
|
6197
|
+
newobj = Particle_system(mapviewer=self)
|
6164
6198
|
newobj.load(filename)
|
6165
6199
|
|
6166
6200
|
self.mypartsystems.append(newobj)
|
@@ -6546,6 +6580,7 @@ class WolfMapViewer(wx.Frame):
|
|
6546
6580
|
elif text == _('Down'):
|
6547
6581
|
self.downobj()
|
6548
6582
|
elif text == _('Rename'):
|
6583
|
+
|
6549
6584
|
#Modification du nom de l'objet sélectionné
|
6550
6585
|
if self.selected_object is not None:
|
6551
6586
|
#récupération de l'id courant
|
@@ -7341,8 +7376,9 @@ class WolfMapViewer(wx.Frame):
|
|
7341
7376
|
|
7342
7377
|
#Print info in the status bar
|
7343
7378
|
txt = 'Dx : {:4f} ; Dy : {:4f}'.format(self.active_array.dx, self.active_array.dy)
|
7344
|
-
txt += ' ; Xmin : {:4f} ; Ymin : {:4f}'.format(self.active_array.
|
7345
|
-
txt += ' ; Xmax : {:4f} ; Ymax : {:4f}'.format(self.active_array.
|
7379
|
+
txt += ' ; Xmin : {:4f} ; Ymin : {:4f}'.format(self.active_array.origx, self.active_array.origy)
|
7380
|
+
txt += ' ; Xmax : {:4f} ; Ymax : {:4f}'.format(self.active_array.origx + self.active_array.dx * float(self.active_array.nbx),
|
7381
|
+
self.active_array.origy + self.active_array.dy * float(self.active_array.nby))
|
7346
7382
|
txt += ' ; Nx : {:d} ; Ny : {:d}'.format(self.active_array.nbx, self.active_array.nby)
|
7347
7383
|
|
7348
7384
|
if self.active_array.nb_blocks > 0:
|
wolfhece/PyWMS.py
CHANGED
@@ -12,7 +12,7 @@ from .PyTranslate import _
|
|
12
12
|
def to_image(mybytes:BytesIO) -> Image:
|
13
13
|
return Image.open(mybytes)
|
14
14
|
|
15
|
-
def getWalonmap(cat:Literal['IMAGERIE/ORTHO_2021', 'ALEA', 'CADMAP', 'LIDAXES', '$IDW', 'ZONES_INONDEES'],
|
15
|
+
def getWalonmap(cat:Literal['IMAGERIE/ORTHO_2021', 'ALEA', 'CADMAP', 'LIDAXES', '$IDW', 'EAU/ZONES_INONDEES'],
|
16
16
|
xl:float,
|
17
17
|
yl:float,
|
18
18
|
xr:float,
|
@@ -23,6 +23,8 @@ def getWalonmap(cat:Literal['IMAGERIE/ORTHO_2021', 'ALEA', 'CADMAP', 'LIDAXES',
|
|
23
23
|
|
24
24
|
if cat.find('$')>0:
|
25
25
|
catloc=cat[:cat.find('$')]
|
26
|
+
elif cat.find('_wo_alea')>0:
|
27
|
+
catloc=cat[:cat.find('_wo_alea')]
|
26
28
|
else:
|
27
29
|
catloc=cat
|
28
30
|
|
@@ -78,18 +80,17 @@ def getWalonmap(cat:Literal['IMAGERIE/ORTHO_2021', 'ALEA', 'CADMAP', 'LIDAXES',
|
|
78
80
|
elif cat.find('LIDAXES')>0:
|
79
81
|
curcont=['4,5,6,7,8,9,11,13']
|
80
82
|
curstyles=['default,default,default,default,default,default,default,default']
|
81
|
-
elif cat.find('
|
82
|
-
curcont=[
|
83
|
+
elif cat.find('IDW')>0:
|
84
|
+
curcont=['0']
|
83
85
|
curstyles=['default']
|
84
86
|
elif cat.find('ZONES_INONDEES')>0:
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
curstyles=['default,default,default,default,default']
|
87
|
+
|
88
|
+
if 'wo_alea' in cat:
|
89
|
+
curcont = list(wms.contents)[1:]
|
90
|
+
curstyles=['default']*len(curcont)
|
91
|
+
else:
|
92
|
+
curcont = list(wms.contents)
|
93
|
+
curstyles=['default']*len(curcont)
|
93
94
|
|
94
95
|
try:
|
95
96
|
img=wms.getmap(layers=curcont,styles=curstyles,srs='EPSG:31370',bbox=(xl,yl,xr,yr),size=(w,h),format='image/png',transparent=True)
|
wolfhece/apps/version.py
CHANGED
wolfhece/wolf_array.py
CHANGED
@@ -477,7 +477,7 @@ class header_wolf():
|
|
477
477
|
logging.warning(_('get_xy_from_ij_array - ij is a tuple of 2 arrays, it is converted to a 2D array'))
|
478
478
|
else:
|
479
479
|
ij = np.array(ij)
|
480
|
-
|
480
|
+
|
481
481
|
elif isinstance(ij,list):
|
482
482
|
if len(ij) == 2:
|
483
483
|
if (isinstance(ij[0],np.ndarray)) and (isinstance(ij[1],np.ndarray)):
|
@@ -486,7 +486,7 @@ class header_wolf():
|
|
486
486
|
logging.warning(_('get_xy_from_ij_array - ij is a list of 2 arrays, it is converted to a 2D array'))
|
487
487
|
else:
|
488
488
|
ij = np.array(ij)
|
489
|
-
|
489
|
+
|
490
490
|
if abs:
|
491
491
|
tr_x = self.translx
|
492
492
|
tr_y = self.transly
|
@@ -649,6 +649,49 @@ class header_wolf():
|
|
649
649
|
filename = str(filename)
|
650
650
|
|
651
651
|
if filename.endswith('.tif'):
|
652
|
+
from osgeo import gdal
|
653
|
+
|
654
|
+
raster:gdal.Dataset
|
655
|
+
raster = gdal.Open(filename)
|
656
|
+
geotr = raster.GetGeoTransform()
|
657
|
+
self.dx = geotr[1]
|
658
|
+
self.dy = abs(geotr[5])
|
659
|
+
self.origx = geotr[0]
|
660
|
+
self.origy = geotr[3]
|
661
|
+
self.nbx = raster.RasterXSize
|
662
|
+
self.nby = raster.RasterYSize
|
663
|
+
|
664
|
+
"""
|
665
|
+
https://docs.qgis.org/3.34/en/docs/user_manual/processing_algs/gdal/rasterconversion.html
|
666
|
+
|
667
|
+
0 — Use Input Layer Data Type
|
668
|
+
1 — Byte (Eight bit unsigned integer (quint8))
|
669
|
+
2 — Int16 (Sixteen bit signed integer (qint16))
|
670
|
+
3 — UInt16 (Sixteen bit unsigned integer (quint16))
|
671
|
+
4 — UInt32 (Thirty two bit unsigned integer (quint32))
|
672
|
+
5 — Int32 (Thirty two bit signed integer (qint32))
|
673
|
+
6 — Float32 (Thirty two bit floating point (float))
|
674
|
+
7 — Float64 (Sixty four bit floating point (double))
|
675
|
+
8 — CInt16 (Complex Int16)
|
676
|
+
9 — CInt32 (Complex Int32)
|
677
|
+
10 — CFloat32 (Complex Float32)
|
678
|
+
11 — CFloat64 (Complex Float64)
|
679
|
+
12 — Int8 (Eight bit signed integer (qint8))
|
680
|
+
"""
|
681
|
+
|
682
|
+
dtype = raster.GetRasterBand(1).DataType
|
683
|
+
|
684
|
+
if dtype in [1, 4]:
|
685
|
+
self.wolftype = WOLF_ARRAY_FULL_INTEGER
|
686
|
+
elif dtype ==6:
|
687
|
+
self.wolftype = WOLF_ARRAY_FULL_SINGLE
|
688
|
+
elif dtype == 7:
|
689
|
+
self.wolftype = WOLF_ARRAY_FULL_DOUBLE
|
690
|
+
else:
|
691
|
+
logging.error(_('The datatype of the raster is not supported -- {}'.format(dtype)))
|
692
|
+
logging.error(_('Please convert the raster to a supported datatype - or upgrade the code to support this datatype'))
|
693
|
+
logging.error(_('See : read_txt_header and import_geotif in wolf_array.py'))
|
694
|
+
return
|
652
695
|
return
|
653
696
|
|
654
697
|
if filename.endswith('.flt'):
|
@@ -2162,7 +2205,7 @@ class Ops_Array(wx.Frame):
|
|
2162
2205
|
self.myzones.showstructure()
|
2163
2206
|
return
|
2164
2207
|
|
2165
|
-
self.myzones.showstructure()
|
2208
|
+
self.myzones.showstructure()
|
2166
2209
|
|
2167
2210
|
def OnLoadvec(self, event:wx.MouseEvent):
|
2168
2211
|
""" Load vector file """
|
@@ -4666,9 +4709,76 @@ class WolfArray(Element_To_Draw, header_wolf):
|
|
4666
4709
|
|
4667
4710
|
if crop is not None :
|
4668
4711
|
if os.path.exists(fn):
|
4712
|
+
|
4713
|
+
tmpdx = self.dx
|
4714
|
+
|
4715
|
+
fn_crop = fn + '_crop.tif'
|
4716
|
+
if type(crop) is np.ndarray:
|
4717
|
+
pass
|
4718
|
+
elif type(crop) is list:
|
4719
|
+
pass
|
4720
|
+
else:
|
4721
|
+
if not self.wx_exists:
|
4722
|
+
logging.error(_('Crop must be a list or a numpy array with 4 values - xmin, xmax, ymin, ymax'))
|
4723
|
+
return
|
4724
|
+
|
4725
|
+
raster:gdal.Dataset
|
4726
|
+
raster = gdal.Open(fn)
|
4727
|
+
geotr = raster.GetGeoTransform()
|
4728
|
+
self.dx = geotr[1]
|
4729
|
+
self.dy = abs(geotr[5])
|
4730
|
+
|
4731
|
+
|
4732
|
+
newcrop = CropDialog(None)
|
4733
|
+
|
4734
|
+
if self.wx_exists:
|
4735
|
+
bounds = self.mapviewer.get_canvas_bounds()
|
4736
|
+
|
4737
|
+
newcrop.dx.Value = str(self.dx)
|
4738
|
+
newcrop.dy.Value = str(self.dy)
|
4739
|
+
|
4740
|
+
newcrop.dx.Enable(False)
|
4741
|
+
newcrop.dy.Enable(False)
|
4742
|
+
|
4743
|
+
newcrop.ox.Value = str(float((bounds[0] // 50.) * 50.))
|
4744
|
+
newcrop.ex.Value = str(float((bounds[2] // 50.) * 50.))
|
4745
|
+
newcrop.oy.Value = str(float((bounds[1] // 50.) * 50.))
|
4746
|
+
newcrop.ey.Value = str(float((bounds[3] // 50.) * 50.))
|
4747
|
+
|
4748
|
+
badvalues = True
|
4749
|
+
while badvalues:
|
4750
|
+
badvalues = False
|
4751
|
+
|
4752
|
+
ret = newcrop.ShowModal()
|
4753
|
+
if ret == wx.ID_CANCEL:
|
4754
|
+
newcrop.Destroy()
|
4755
|
+
return
|
4756
|
+
else:
|
4757
|
+
crop = [float(newcrop.ox.Value), float(newcrop.ex.Value),
|
4758
|
+
float(newcrop.oy.Value), float(newcrop.ey.Value)]
|
4759
|
+
|
4760
|
+
tmpdx = float(newcrop.dx.Value)
|
4761
|
+
tmpdy = float(newcrop.dy.Value)
|
4762
|
+
|
4763
|
+
if self.dx != tmpdx or self.dy != tmpdy:
|
4764
|
+
if tmpdx / self.dx != tmpdy / self.dy:
|
4765
|
+
badvalues = True
|
4766
|
+
|
4767
|
+
newcrop.Destroy()
|
4768
|
+
|
4669
4769
|
xmin, xmax, ymin, ymax = crop
|
4670
|
-
|
4671
|
-
|
4770
|
+
|
4771
|
+
with wx.FileDialog(None, _('Save the cropped file for later'), wildcard="Tiff files (*.tif)|*.tif",
|
4772
|
+
style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) as fileDialog:
|
4773
|
+
|
4774
|
+
if fileDialog.ShowModal() == wx.ID_CANCEL:
|
4775
|
+
return
|
4776
|
+
|
4777
|
+
fn_crop = fileDialog.GetPath()
|
4778
|
+
|
4779
|
+
|
4780
|
+
gdal.Translate(fn_crop, fn, projWin=[xmin, ymax, xmax, ymin])
|
4781
|
+
fn = fn_crop
|
4672
4782
|
|
4673
4783
|
raster:gdal.Dataset
|
4674
4784
|
raster = gdal.Open(fn)
|
@@ -6452,6 +6562,20 @@ class WolfArray(Element_To_Draw, header_wolf):
|
|
6452
6562
|
else:
|
6453
6563
|
newcrop = CropDialog(None)
|
6454
6564
|
|
6565
|
+
if self.mapviewer is not None:
|
6566
|
+
bounds = self.mapviewer.get_canvas_bounds()
|
6567
|
+
|
6568
|
+
newcrop.dx.Value = str(self.dx)
|
6569
|
+
newcrop.dy.Value = str(self.dy)
|
6570
|
+
|
6571
|
+
# newcrop.dx.Enable(False)
|
6572
|
+
# newcrop.dy.Enable(False)
|
6573
|
+
|
6574
|
+
newcrop.ox.Value = str(float((bounds[0] // 50.) * 50.))
|
6575
|
+
newcrop.ex.Value = str(float((bounds[2] // 50.) * 50.))
|
6576
|
+
newcrop.oy.Value = str(float((bounds[1] // 50.) * 50.))
|
6577
|
+
newcrop.ey.Value = str(float((bounds[3] // 50.) * 50.))
|
6578
|
+
|
6455
6579
|
badvalues = True
|
6456
6580
|
while badvalues:
|
6457
6581
|
badvalues = False
|
wolfhece/wolfresults_2D.py
CHANGED
@@ -3098,6 +3098,17 @@ class Wolfresults_2D(Element_To_Draw):
|
|
3098
3098
|
else:
|
3099
3099
|
return self.myblocks[getkeyblock(block,False)].waterdepth
|
3100
3100
|
|
3101
|
+
def get_top_for_block(self, block: Union[int, str]) -> WolfArray:
|
3102
|
+
"""
|
3103
|
+
Retourne la matrice de topographie pour un bloc spécifique
|
3104
|
+
|
3105
|
+
block : numéro du bloc; 1-based;
|
3106
|
+
"""
|
3107
|
+
if isinstance(block,str):
|
3108
|
+
return self.myblocks[block].top
|
3109
|
+
else:
|
3110
|
+
return self.myblocks[getkeyblock(block,False)].top
|
3111
|
+
|
3101
3112
|
def get_qx_for_block(self, block: Union[int, str]) -> WolfArray:
|
3102
3113
|
"""
|
3103
3114
|
Retourne la matrice de débit selon X pour un bloc spécifique
|
@@ -4116,7 +4127,7 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4116
4127
|
self.get_working_array()
|
4117
4128
|
self.updatepalette(whichpal)
|
4118
4129
|
|
4119
|
-
def danger_map(self, start:int=0, end:int=-1, every:int=1) -> Union[tuple[WolfArray, WolfArray, WolfArray], tuple[WolfArrayMB, WolfArrayMB, WolfArrayMB]]:
|
4130
|
+
def danger_map(self, start:int=0, end:int=-1, every:int=1) -> Union[tuple[WolfArray, WolfArray, WolfArray, WolfArray], tuple[WolfArrayMB, WolfArrayMB, WolfArrayMB, WolfArrayMB]]:
|
4120
4131
|
"""
|
4121
4132
|
Create Danger Maps
|
4122
4133
|
|
@@ -4124,7 +4135,7 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4124
4135
|
:param end: end time step - 0-based
|
4125
4136
|
:param every: step interval
|
4126
4137
|
|
4127
|
-
:return : tuple of WolfArray or WolfArrayMB - H, U_norm, Q_norm
|
4138
|
+
:return : tuple of WolfArray or WolfArrayMB - H, U_norm, Q_norm, Z
|
4128
4139
|
"""
|
4129
4140
|
|
4130
4141
|
# Number of time steps
|
@@ -4135,11 +4146,12 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4135
4146
|
# Init Danger Maps basde on results type
|
4136
4147
|
# If only one block --> WolfArray
|
4137
4148
|
# If only multiple blocks --> WolfArrayMB
|
4138
|
-
danger_map_matrix_h
|
4139
|
-
danger_map_matrix_v
|
4149
|
+
danger_map_matrix_h = self.as_WolfArray(copyarray=True)
|
4150
|
+
danger_map_matrix_v = self.as_WolfArray(copyarray=True)
|
4140
4151
|
danger_map_matrix_mom = self.as_WolfArray(copyarray=True)
|
4152
|
+
danger_map_matrix_z = self.as_WolfArray(copyarray=True)
|
4141
4153
|
|
4142
|
-
danger = [danger_map_matrix_h, danger_map_matrix_v, danger_map_matrix_mom]
|
4154
|
+
danger = [danger_map_matrix_h, danger_map_matrix_v, danger_map_matrix_mom, danger_map_matrix_z]
|
4143
4155
|
|
4144
4156
|
for curdanger in danger:
|
4145
4157
|
curdanger.nullvalue = 0.
|
@@ -4157,17 +4169,21 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4157
4169
|
wd = self.get_h_for_block(curblock)
|
4158
4170
|
qx = self.get_qx_for_block(curblock)
|
4159
4171
|
qy = self.get_qy_for_block(curblock)
|
4172
|
+
top = self.get_top_for_block(curblock)
|
4160
4173
|
|
4161
4174
|
ij = np.where(~wd.array.mask)
|
4162
4175
|
|
4163
4176
|
#
|
4164
4177
|
mom = np.zeros_like(wd.array)
|
4165
4178
|
v = np.zeros_like(wd.array)
|
4179
|
+
z = np.zeros_like(wd.array)
|
4180
|
+
|
4166
4181
|
mom[ij] = (qx.array[ij]**2.+qy.array[ij]**2.)**.5
|
4167
4182
|
v[ij] = mom[ij]/wd.array[ij]
|
4183
|
+
z[ij] = wd.array[ij] + top.array[ij]
|
4168
4184
|
|
4169
4185
|
# Comparison
|
4170
|
-
for curdanger, curcomp in zip(danger, [wd.array, v, mom]):
|
4186
|
+
for curdanger, curcomp in zip(danger, [wd.array, v, mom, z]):
|
4171
4187
|
ij = np.where((curdanger.array < curcomp) & (~wd.array.mask))
|
4172
4188
|
curdanger.array.data[ij] = curcomp[ij]
|
4173
4189
|
curdanger.array.mask[ij] = False
|
@@ -4177,17 +4193,21 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4177
4193
|
wd = self.get_h_for_block(curblock)
|
4178
4194
|
qx = self.get_qx_for_block(curblock)
|
4179
4195
|
qy = self.get_qy_for_block(curblock)
|
4196
|
+
top = self.get_top_for_block(curblock)
|
4180
4197
|
|
4181
4198
|
ij = np.where(~wd.array.mask)
|
4182
4199
|
|
4183
4200
|
#
|
4184
4201
|
mom = np.zeros_like(wd.array)
|
4185
4202
|
v = np.zeros_like(wd.array)
|
4203
|
+
z = np.zeros_like(wd.array)
|
4204
|
+
|
4186
4205
|
mom[ij] = (qx.array[ij]**2.+qy.array[ij]**2.)**.5
|
4187
4206
|
v[ij] = mom[ij]/wd.array[ij]
|
4207
|
+
z[ij] = wd.array[ij] + top.array[ij]
|
4188
4208
|
|
4189
4209
|
# Comparison
|
4190
|
-
for curdanger, curcomp in zip(danger, [wd.array, v, mom]):
|
4210
|
+
for curdanger, curcomp in zip(danger, [wd.array, v, mom, z]):
|
4191
4211
|
ij = np.where((curdanger.array < curcomp) & (~wd.array.mask))
|
4192
4212
|
curdanger.array.data[ij] = curcomp[ij]
|
4193
4213
|
curdanger.array.mask[ij] = False
|
@@ -4196,14 +4216,15 @@ class Wolfresults_2D(Element_To_Draw):
|
|
4196
4216
|
|
4197
4217
|
if self.nb_blocks>1:
|
4198
4218
|
for i in range(self.nb_blocks):
|
4199
|
-
danger_map_matrix_v[i].array.mask[:,:]
|
4219
|
+
danger_map_matrix_v[i].array.mask[:,:] = danger_map_matrix_h[i].array.mask[:,:]
|
4200
4220
|
danger_map_matrix_mom[i].array.mask[:,:] = danger_map_matrix_h[i].array.mask[:,:]
|
4221
|
+
danger_map_matrix_z[i].array.mask[:,:] = danger_map_matrix_h[i].array.mask[:,:]
|
4201
4222
|
else:
|
4202
|
-
danger_map_matrix_v.array.mask[:,:]
|
4223
|
+
danger_map_matrix_v.array.mask[:,:] = danger_map_matrix_h.array.mask[:,:]
|
4203
4224
|
danger_map_matrix_mom.array.mask[:,:] = danger_map_matrix_h.array.mask[:,:]
|
4225
|
+
danger_map_matrix_z.array.mask[:,:] = danger_map_matrix_h.array.mask[:,:]
|
4204
4226
|
|
4205
|
-
|
4206
|
-
return (danger_map_matrix_h, danger_map_matrix_v, danger_map_matrix_mom)
|
4227
|
+
return (danger_map_matrix_h, danger_map_matrix_v, danger_map_matrix_mom, danger_map_matrix_z)
|
4207
4228
|
|
4208
4229
|
def danger_map_only_h(self, start:int=0, end:int=-1, every:int=1) -> WolfArray:
|
4209
4230
|
"""
|
@@ -6,7 +6,7 @@ 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=
|
9
|
+
wolfhece/PyDraw.py,sha256=YlgDQm0xiJP0uWLCpLVFhjH9YPl3O7JyO-2tLYlqxqw,384535
|
10
10
|
wolfhece/PyGui.py,sha256=fqy8f3tLt7myJskVvspTQ_ZO7kaiSNKmcfFLrfr4w7M,103174
|
11
11
|
wolfhece/PyGuiHydrology.py,sha256=r8kcY2eGAQzSwVtLpyMUiBL5xBpMBsi7ovs0PgStGWw,14648
|
12
12
|
wolfhece/PyHydrographs.py,sha256=GKK8U0byI45H9O_e4LAOOi7Aw0Tg7Q0Lx322stPg5IQ,3453
|
@@ -16,7 +16,7 @@ wolfhece/PyPictures.py,sha256=-mJB0JL2YYiEK3D7_ssDkvYiMWK4ve9kXhozQXNeSx8,2216
|
|
16
16
|
wolfhece/PyTranslate.py,sha256=4appkmNeHHZLFmUtaA_k5_5QL-5ymxnbVN4R2OblmtE,622
|
17
17
|
wolfhece/PyVertex.py,sha256=dHTjyYYTn0F_NWerlAOBKHV79RUzEEtMJMldQtVc1Cs,40092
|
18
18
|
wolfhece/PyVertexvectors.py,sha256=4K0T74MUH-ycX79hFa2618vKVTu9qOSh49hlbKrydMg,224123
|
19
|
-
wolfhece/PyWMS.py,sha256=
|
19
|
+
wolfhece/PyWMS.py,sha256=pV7JdzbreQGXCg3E6PwllchEUYu2YiPZEIua2ppJorA,4304
|
20
20
|
wolfhece/RatingCurve.py,sha256=f6IGLS5aJBJD_t_k903m_yRZ60MzKNKanzD6njXZxa8,22200
|
21
21
|
wolfhece/RatingCurveData.py,sha256=5UvnIm89BwqjnEbLCcY3CA8WoFd_xHJbooNy62fX5iY,57660
|
22
22
|
wolfhece/RatingCurve_xml.py,sha256=vbLxSWwHPsCAsR13KaG5WVmVn_cha7-6cF4zj7Diiz8,33593
|
@@ -48,13 +48,13 @@ wolfhece/rain_SPWMI.py,sha256=YqsF-yFro3y_a6MfVRFfr-Rxi7NR1gl_i8VX7scmzes,13548
|
|
48
48
|
wolfhece/test_Results2DGPU.py,sha256=NOJ_hFXrcLSQXS1dtsqXRQltqIZtDSHMz_EgAJ2_FHU,307
|
49
49
|
wolfhece/textpillow.py,sha256=zEfLrKhfCDyMaVuQOUjHqz6MGKeQ4aewMxOsWi5-wKI,13832
|
50
50
|
wolfhece/tools_mpl.py,sha256=q8Yc4aukPPiUcEzREvZRM_em67XqXaahdoaNt0DETfE,266
|
51
|
-
wolfhece/wolf_array.py,sha256=
|
51
|
+
wolfhece/wolf_array.py,sha256=8cYHIwul4VVkSXwGqPMLaEv8n3c5cC0Ozp5xdfupUsI,342928
|
52
52
|
wolfhece/wolf_hist.py,sha256=JpRXvzJLUP-RkSkvth3DQWglgTMFI2ZEUDb4RYOfeeI,3284
|
53
53
|
wolfhece/wolf_texture.py,sha256=llQ7aV8scWXIkhpri9XjaPejzoBJsGfsln2ZnlRbFkU,16270
|
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=U42Rz8fWQ6Zb2nvzPGvj6eHz_i_RNkmK056AuLDSYgs,165557
|
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=pxI-blXjVWz8Af7dvteh6caxvhN-mCRsq-_4uSmye8s,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
|
@@ -228,6 +228,7 @@ wolfhece/models/shields_cst.pal,sha256=zUGFI6HiL0bsHeOzcWNih3F9cxXKXLLZYA5rtqRbz
|
|
228
228
|
wolfhece/models/walous_niv1.pal,sha256=mHMjCB-ja47mV3ZsvDOhS2CEK8YN6ewOkf1W7l7JQ8k,138
|
229
229
|
wolfhece/models/walous_niv2.pal,sha256=B5wt5-O88dpaiA6yR4uriOy0tfDVU_cms0Xr6Dw9ZGg,377
|
230
230
|
wolfhece/models/waterdepths.pal,sha256=8rcQfuZOeLKzYv5sARPkhpvZYc1OToj3ZukcbuRUgIY,136
|
231
|
+
wolfhece/models/white_black.pal,sha256=BKjVN1kuk1OtJB9S3uM5fxteWbggI3Pb8p9WdDptT4c,51
|
231
232
|
wolfhece/opengl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
232
233
|
wolfhece/opengl/gl_utils.py,sha256=-eH2WAWdLFr6mzEwN8XdfJfM8U2rgvRryCAqjH-zeys,66136
|
233
234
|
wolfhece/opengl/py3d.py,sha256=Ws2VM8TNHR4Tx_Ud14c38FEco3LZWevH7UvtSUt6osw,66451
|
@@ -267,8 +268,8 @@ wolfhece/sounds/sonsw2.wav,sha256=pFLVt6By0_EPQNt_3KfEZ9a1uSuYTgQSX1I_Zurv9Rc,11
|
|
267
268
|
wolfhece/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
268
269
|
wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa7tbNQ_SxqhpAZxhm-mTy4,14860
|
269
270
|
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.
|
271
|
+
wolfhece-2.1.19.dist-info/METADATA,sha256=nBRFLNjydXPkETNSMpS4ccjkMxDi8kgcghfRBWX9Vmg,2282
|
272
|
+
wolfhece-2.1.19.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
|
273
|
+
wolfhece-2.1.19.dist-info/entry_points.txt,sha256=AIu1KMswrdsqNq_2jPtrRIU4tLjuTnj2dCY-pxIlshw,276
|
274
|
+
wolfhece-2.1.19.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
|
275
|
+
wolfhece-2.1.19.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|