wolfhece 2.1.28__py3-none-any.whl → 2.1.30__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 +3 -3
- wolfhece/PyPalette.py +8 -0
- wolfhece/acceptability/acceptability.py +154 -126
- wolfhece/acceptability/func.py +151 -58
- wolfhece/apps/splashscreen.py +15 -1
- wolfhece/apps/version.py +1 -1
- wolfhece/libs/WolfOGL.c +2684 -1866
- wolfhece/libs/WolfOGL.pyx +18 -1
- wolfhece/libs/verify_license.cp310-win_amd64.pyd +0 -0
- wolfhece/libs/wolfogl.cp310-win_amd64.pyd +0 -0
- wolfhece/models/vulnerability.pal +25 -0
- wolfhece/wolf_array.py +1 -0
- {wolfhece-2.1.28.dist-info → wolfhece-2.1.30.dist-info}/METADATA +2 -1
- {wolfhece-2.1.28.dist-info → wolfhece-2.1.30.dist-info}/RECORD +17 -16
- {wolfhece-2.1.28.dist-info → wolfhece-2.1.30.dist-info}/WHEEL +1 -1
- wolfhece/acceptability/acceptability1.py +0 -211
- {wolfhece-2.1.28.dist-info → wolfhece-2.1.30.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.1.28.dist-info → wolfhece-2.1.30.dist-info}/top_level.txt +0 -0
wolfhece/libs/WolfOGL.pyx
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
from libc.math cimport pow
|
2
|
+
from .verify_license import VerifyLicense
|
2
3
|
from cython.view cimport array as cvarray
|
3
4
|
cimport cython
|
4
5
|
import numpy as np
|
5
6
|
cimport numpy as np
|
7
|
+
import sys
|
8
|
+
|
6
9
|
cdef extern from "GL\gl.h" nogil:
|
7
10
|
enum: __gl_h_
|
8
11
|
enum: GL_TYPEDEFS_2_0
|
@@ -1552,6 +1555,20 @@ cdef extern from "GL\gl.h" nogil:
|
|
1552
1555
|
void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GLfloat *value)
|
1553
1556
|
|
1554
1557
|
|
1558
|
+
def init():
|
1559
|
+
try:
|
1560
|
+
VerifyLicense.increment()
|
1561
|
+
except Exception as e:
|
1562
|
+
print(e)
|
1563
|
+
sys.exit(1)
|
1564
|
+
|
1565
|
+
def powermode(options):
|
1566
|
+
try:
|
1567
|
+
VerifyLicense.verify()
|
1568
|
+
except Exception as e:
|
1569
|
+
print(e)
|
1570
|
+
sys.exit(1)
|
1571
|
+
|
1555
1572
|
@cython.boundscheck(False) # Deactivate bounds checking
|
1556
1573
|
@cython.wraparound(False) # Deactivate negative indexing.
|
1557
1574
|
cpdef mapColor(float zValue, double[:] colorValues, int paletteSize, double[:,:] colorPalette, int cstcmap):
|
@@ -1565,7 +1582,7 @@ cpdef mapColor(float zValue, double[:] colorValues, int paletteSize, double[:,:]
|
|
1565
1582
|
if zValue <= colorValues[0]:
|
1566
1583
|
return colorPalette[0,:]
|
1567
1584
|
elif (zValue >= colorValues[paletteSize-1]):
|
1568
|
-
return colorPalette[-1,:]
|
1585
|
+
return colorPalette[paletteSize-1,:]
|
1569
1586
|
else:
|
1570
1587
|
for i in range(1,paletteSize):
|
1571
1588
|
if zValue <= colorValues[i]:
|
Binary file
|
Binary file
|
wolfhece/wolf_array.py
CHANGED
@@ -4177,6 +4177,7 @@ class WolfArray(Element_To_Draw, header_wolf):
|
|
4177
4177
|
:param mask_source: mask to link to the data
|
4178
4178
|
|
4179
4179
|
"""
|
4180
|
+
# wolfogl.powermode('ON')
|
4180
4181
|
|
4181
4182
|
Element_To_Draw.__init__(self, idx, plotted, mapviewer, need_for_wx)
|
4182
4183
|
header_wolf.__init__(self)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: wolfhece
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.30
|
4
4
|
Author-email: Pierre Archambeau <pierre.archambeau@uliege.be>
|
5
5
|
License: AGPL-v3 License
|
6
6
|
Project-URL: Homepage, https://uee.uliege.be/hece
|
@@ -13,6 +13,7 @@ Classifier: Topic :: Scientific/Engineering :: Physics
|
|
13
13
|
Requires-Python: <3.11,>=3.10
|
14
14
|
Description-Content-Type: text/markdown
|
15
15
|
Requires-Dist: wxpython
|
16
|
+
Requires-Dist: cryptography
|
16
17
|
Requires-Dist: jax
|
17
18
|
Requires-Dist: triangle
|
18
19
|
Requires-Dist: numpy
|
@@ -6,11 +6,11 @@ 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=rF_TaicOrLMk122Mflc82kyz0DoJ-ldWgeYrMkjNIOY,390213
|
10
10
|
wolfhece/PyGui.py,sha256=8UWyaYwiHD9juDbPs__pmCXIDoM8r9_bGKLf29xVGZI,103140
|
11
11
|
wolfhece/PyGuiHydrology.py,sha256=r8kcY2eGAQzSwVtLpyMUiBL5xBpMBsi7ovs0PgStGWw,14648
|
12
12
|
wolfhece/PyHydrographs.py,sha256=GKK8U0byI45H9O_e4LAOOi7Aw0Tg7Q0Lx322stPg5IQ,3453
|
13
|
-
wolfhece/PyPalette.py,sha256
|
13
|
+
wolfhece/PyPalette.py,sha256=-F3E2dyGNMHCZa3xTd_StNYOQZv9fPGO051Z0TtvEqo,25885
|
14
14
|
wolfhece/PyParams.py,sha256=R3AWcb7Mhixwnw4iONSN4gk1DOXKcJR2lj7jaIml4B8,97085
|
15
15
|
wolfhece/PyPictures.py,sha256=-mJB0JL2YYiEK3D7_ssDkvYiMWK4ve9kXhozQXNeSx8,2216
|
16
16
|
wolfhece/PyTranslate.py,sha256=4appkmNeHHZLFmUtaA_k5_5QL-5ymxnbVN4R2OblmtE,622
|
@@ -48,7 +48,7 @@ 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=lgo1SQaiEZe7yF1vUuH1SyKsK6lT2ccT0WM7cGTxhDg,355711
|
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
|
@@ -58,11 +58,10 @@ wolfhece/wolfresults_2D.py,sha256=wF-wIyqpTrUJX_fT-QCVuNxLZCgUsqK9ptGz8izpyIQ,16
|
|
58
58
|
wolfhece/xyz_file.py,sha256=aQOcTHkHRhXHxL_WxTHwzygp6e47San7SHSpxKQU0dw,5457
|
59
59
|
wolfhece/acceptability/Parallels.py,sha256=wpCdwkqR6PAFeRkV5TvSSL33Vf368j-bvYcl7D1Y-sc,3695
|
60
60
|
wolfhece/acceptability/__init__.py,sha256=hfgoPKLDpX7drN1Vpvux-_5Lfyc_7feT2C2zQr5v-Os,258
|
61
|
-
wolfhece/acceptability/acceptability.py,sha256=
|
62
|
-
wolfhece/acceptability/acceptability1.py,sha256=rf1Bu2JuyOPwMxvez7z5vCXrePAV486hyVM5g1f40g4,13045
|
61
|
+
wolfhece/acceptability/acceptability.py,sha256=xhLwqVqUjlBm29yQK23cr9pr87Z5PB3Lzr1Kw8DA5D4,24145
|
63
62
|
wolfhece/acceptability/acceptability_gui.py,sha256=zzbHd_e90fLhbgrdBlnWmBWBO8ZBwb8vikhl-2Rdy0M,12020
|
64
63
|
wolfhece/acceptability/cli.py,sha256=pIh9hIbM5RQFh3EBQJB2jWJ8F2M4l-D6qGoewXROE1M,7102
|
65
|
-
wolfhece/acceptability/func.py,sha256=
|
64
|
+
wolfhece/acceptability/func.py,sha256=z4CI2OYtVa1vfC_v5dEhgG3uA1IijppfwewJMBDPt6g,61192
|
66
65
|
wolfhece/apps/ManageParams.py,sha256=heg5L4fMn0ettR7Bad_Q680o_JWnTbe3WFkL_9IziAk,312
|
67
66
|
wolfhece/apps/Optimisation_hydro.py,sha256=mHazBazTUGyxPbHPXhaQim8vqIeOOuKPjH0B48VWduA,374
|
68
67
|
wolfhece/apps/WolfPython.png,sha256=K3dcbeZUiJCFNwOAAlGMaRGLJ56yM8WD2I_0bk0xT1g,104622
|
@@ -72,8 +71,8 @@ wolfhece/apps/__init__.py,sha256=OzzKItATWV0mDkz_LC2L3w5sgT2rt8ExXXCbR_FwvlY,24
|
|
72
71
|
wolfhece/apps/check_install.py,sha256=jrKR-njqnpIh6ZJqvP6KbDUPVCfwTNQj4glQhcyzs9o,630
|
73
72
|
wolfhece/apps/curvedigitizer.py,sha256=avWERHuVxPnJBOD_ibczwW_XG4vAenqWS8W1zjhBox8,4898
|
74
73
|
wolfhece/apps/isocurrent.py,sha256=4XnNWPa8mYUK7V4zdDRFrHFIXNG2AN2og3TqWKKcqjY,3811
|
75
|
-
wolfhece/apps/splashscreen.py,sha256=
|
76
|
-
wolfhece/apps/version.py,sha256=
|
74
|
+
wolfhece/apps/splashscreen.py,sha256=EjEjZGuWV-8ZfHhnFH4XLrrtB-YpzPDVhFzRrjgFUzI,2624
|
75
|
+
wolfhece/apps/version.py,sha256=DOnhV0acM8wlohylXhs6wwbgGzeJWQwuSC3SgXqFsRg,388
|
77
76
|
wolfhece/apps/wolf.py,sha256=gqfm-ZaUJqNsfCzmdtemSeqLw-GVdSVix-evg5WArJI,293
|
78
77
|
wolfhece/apps/wolf2D.py,sha256=gWD9ee2-1pw_nUxjgRaJMuSe4kUT-RWhOeoTt_Lh1mM,267
|
79
78
|
wolfhece/apps/wolf_logo.bmp,sha256=ruJ4MA51CpGO_AYUp_dB4SWKHelvhOvd7Q8NrVOjDJk,3126
|
@@ -173,8 +172,8 @@ wolfhece/lazviewer/viewer/viewer.exe,sha256=pF5nwE8vMWlEzkk-SOekae9zpOsPhTWhZbqa
|
|
173
172
|
wolfhece/lazviewer/viewer/viewer.py,sha256=8_MQCaQOS0Z_oRPiGoRy1lq-aCirReX3hWEBjQID0ig,24665
|
174
173
|
wolfhece/libs/MSVCP140.dll,sha256=2GrBWBI6JFuSdZLIDMAg_qKcjErdwURGbEYloAypx3o,565640
|
175
174
|
wolfhece/libs/WolfDll.dll,sha256=E8SeV0AHVXW5ikAQuVtijqIvaYx7UIMeqvnnsmTMCT8,132934144
|
176
|
-
wolfhece/libs/WolfOGL.c,sha256=
|
177
|
-
wolfhece/libs/WolfOGL.pyx,sha256=
|
175
|
+
wolfhece/libs/WolfOGL.c,sha256=Dm_4cI9NHFAMhs4cskjcQStpeIYjedOrHPqlcHeQVAk,1753700
|
176
|
+
wolfhece/libs/WolfOGL.pyx,sha256=YmA3NPLt9zPo-UarGnz33dFdSmAc2Vaul5I1_0EWYKo,80278
|
178
177
|
wolfhece/libs/api-ms-win-crt-heap-l1-1-0.dll,sha256=r0euvgZa8vBFoZ8g7H5Upuc8DD6aUQimMJWnIyt1OBo,19720
|
179
178
|
wolfhece/libs/api-ms-win-crt-math-l1-1-0.dll,sha256=ol0GVN6wzqGu8Ym6IXTQ8TvfUvCY06nsNtFeS_swxJk,27912
|
180
179
|
wolfhece/libs/api-ms-win-crt-runtime-l1-1-0.dll,sha256=NxpEq5FhSowm0Vm-uHKntD9WnLX6yK2pms6Y8mSjtQM,23304
|
@@ -201,7 +200,8 @@ wolfhece/libs/svml_dispmd.dll,sha256=GdwVZSC_XYiNpVVUqTqxAcYAf4zP6tr-E1N-3skVS7s
|
|
201
200
|
wolfhece/libs/vcomp100.dll,sha256=NKvXc8hc4MrFa9k8ErALA6OmldGfR3zidaZPCZhMVJI,57168
|
202
201
|
wolfhece/libs/vcruntime140.dll,sha256=YYMpkONk3KW_osYdkw8ArKrm0aqjEwOSQDRVrpoRJaU,89880
|
203
202
|
wolfhece/libs/vcruntime140_1.dll,sha256=FVS1gClo_bJwWmfLthWF6VYLnkKdBDpap0LvPJu_tr8,37240
|
204
|
-
wolfhece/libs/
|
203
|
+
wolfhece/libs/verify_license.cp310-win_amd64.pyd,sha256=-lobNXvqiN7vNl7zzrZWOBPsGW13qT77JWiSy2D3FCk,92672
|
204
|
+
wolfhece/libs/wolfogl.cp310-win_amd64.pyd,sha256=K6HTq5bFSRv9y-k6wbdO4qMPJcZQKvozCYThsltx6Yk,286720
|
205
205
|
wolfhece/libs/wolfpy.cp310-win_amd64.pyd,sha256=6omqEaxmQll-Gg24e90wVomAB9rO_tyyOES2FewXn58,36457472
|
206
206
|
wolfhece/libs/zlib1.dll,sha256=E9a0e62VgmG1A8ohZzhVCmmfGtbyXxXu4aFeADTNJ30,77824
|
207
207
|
wolfhece/libs/GL/gl.h,sha256=IhsS_fOLa8GW9MpiLZebe9QYRy6uIB_qK_uQMWMOoeg,46345
|
@@ -234,6 +234,7 @@ wolfhece/models/diff3.pal,sha256=qk-yGgJr_FHdW7p7i93GFsH9ClT0dl5nqa9G1lLh7Z0,50
|
|
234
234
|
wolfhece/models/red.pal,sha256=W6oeIjDCoGCsJDZPH2K4jfyfPmCMlH9rfRi4PTs-n28,33
|
235
235
|
wolfhece/models/shields.pal,sha256=TwPhfaly2j3ZRM5ahlz7xH19NArZlalxYNy1L_UnJoA,166
|
236
236
|
wolfhece/models/shields_cst.pal,sha256=zUGFI6HiL0bsHeOzcWNih3F9cxXKXLLZYA5rtqRbzcs,90
|
237
|
+
wolfhece/models/vulnerability.pal,sha256=Fevrc_9owywLhbPMBunXDcrGXPJhARo9iSV1eOq3roA,106
|
237
238
|
wolfhece/models/walous_niv1.pal,sha256=mHMjCB-ja47mV3ZsvDOhS2CEK8YN6ewOkf1W7l7JQ8k,138
|
238
239
|
wolfhece/models/walous_niv2.pal,sha256=B5wt5-O88dpaiA6yR4uriOy0tfDVU_cms0Xr6Dw9ZGg,377
|
239
240
|
wolfhece/models/waterdepths.pal,sha256=8rcQfuZOeLKzYv5sARPkhpvZYc1OToj3ZukcbuRUgIY,136
|
@@ -279,8 +280,8 @@ wolfhece/ui/wolf_multiselection_collapsiblepane.py,sha256=yGbU_JsF56jsmms0gh7mxa
|
|
279
280
|
wolfhece/ui/wolf_times_selection_comparison_models.py,sha256=wCxGRnE3kzEkWlWA6-3X8ADOFux_B0a5QWJ2GnXTgJw,4709
|
280
281
|
wolfhece/wintab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
281
282
|
wolfhece/wintab/wintab.py,sha256=8A-JNONV6ujgsgG3lM5Uw-pVgglPATwKs86oBzzljoc,7179
|
282
|
-
wolfhece-2.1.
|
283
|
-
wolfhece-2.1.
|
284
|
-
wolfhece-2.1.
|
285
|
-
wolfhece-2.1.
|
286
|
-
wolfhece-2.1.
|
283
|
+
wolfhece-2.1.30.dist-info/METADATA,sha256=3IcGhCz-MaGj4jP2HATNkudS-Ae869L61Ec7nyjt5rE,2356
|
284
|
+
wolfhece-2.1.30.dist-info/WHEEL,sha256=rWxmBtp7hEUqVLOnTaDOPpR-cZpCDkzhhcBce-Zyd5k,91
|
285
|
+
wolfhece-2.1.30.dist-info/entry_points.txt,sha256=MAG6NrF64fcxiVNb2g1JPYPGcn9C0HWtqqNurB83oX0,330
|
286
|
+
wolfhece-2.1.30.dist-info/top_level.txt,sha256=EfqZXMVCn7eILUzx9xsEu2oBbSo9liWPFWjIHik0iCI,9
|
287
|
+
wolfhece-2.1.30.dist-info/RECORD,,
|
@@ -1,211 +0,0 @@
|
|
1
|
-
# import pandas as pd
|
2
|
-
# import Parallels
|
3
|
-
# import os
|
4
|
-
# import func
|
5
|
-
# from osgeo import gdal
|
6
|
-
# import fiona
|
7
|
-
# import glob
|
8
|
-
# import numpy as np
|
9
|
-
# import geopandas as gpd
|
10
|
-
|
11
|
-
# def Vulnerability2(main_dir, resolution):
|
12
|
-
# os.chdir(main_dir)
|
13
|
-
# print("STEP2: convert vectors to raster based on their vulnerability values")
|
14
|
-
# layer = fiona.listlayers(os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg")
|
15
|
-
# database = os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg"
|
16
|
-
# extent = os.getcwd()+"//INPUT//STUDY_AREA//Bassin_SA.shp"
|
17
|
-
# pixel=resolution
|
18
|
-
# attribute = "Vulne"
|
19
|
-
# parallel_v2r(layer, database, extent, attribute, pixel)
|
20
|
-
# attribute = "Code"
|
21
|
-
# parallel_v2r(layer, database, extent, attribute, pixel)
|
22
|
-
|
23
|
-
# def base_data_creation(main_dir, Original_gdb, Study_Area, CaPa_Walloon, PICC_Walloon):
|
24
|
-
# #Change the directory
|
25
|
-
# os.chdir(main_dir)
|
26
|
-
# # Step 1, Clip GDB data
|
27
|
-
# file_path=os.getcwd()+"//INPUT//DATABASE//"+str(Original_gdb)
|
28
|
-
# Study_Area=os.getcwd()+"//INPUT//STUDY_AREA//"+str(Study_Area)
|
29
|
-
# data_type="OpenfileGDB"
|
30
|
-
# number_procs = 8
|
31
|
-
# output_gpkg = os.getcwd()+"//TEMP//DATABASES//SA_database.gpkg"
|
32
|
-
# paths = pd.read_csv(os.getcwd()+"//INPUT//CSVs//Vulnerability_matrix_new1.csv", sep=",", encoding='latin-1')
|
33
|
-
# paths["subfolder"]=None
|
34
|
-
# x, y = paths.shape
|
35
|
-
# for i in range(x):
|
36
|
-
# a=paths["Path"][i].split('/')
|
37
|
-
# paths["subfolder"][i]=a[1]
|
38
|
-
# layers = paths["subfolder"].to_list()
|
39
|
-
# Parallels.parallel_gpd_clip(layers, file_path, Study_Area, output_gpkg, data_type, number_procs)
|
40
|
-
# # Step 2, Clip Cadaster data
|
41
|
-
# file_path=os.getcwd()+"//INPUT//DATABASE//"+str(CaPa_Walloon)
|
42
|
-
# data_type='GPKG'
|
43
|
-
# number_procs = 8
|
44
|
-
# output_gpkg = os.getcwd()+"//TEMP//DATABASES//SA_CaPa.gpkg"
|
45
|
-
# layers = ["CaBu", "CaPa"]
|
46
|
-
# Parallels.parallel_gpd_clip(layers, file_path, Study_Area, output_gpkg, data_type, number_procs)
|
47
|
-
# # Step 3, Clip PICC data
|
48
|
-
# file_path=os.getcwd()+"//INPUT//DATABASE//"+str(PICC_Walloon)
|
49
|
-
# data_type='OpenfileGDB'
|
50
|
-
# number_procs = 8
|
51
|
-
# output_gpkg = os.getcwd()+"//TEMP//DATABASES//SA_PICC.gpkg"
|
52
|
-
# layers=['CONSTR_BATIEMPRISE']
|
53
|
-
# Parallels.parallel_gpd_clip(layers, file_path, Study_Area, output_gpkg, data_type, number_procs)
|
54
|
-
# #Step 4, create database based on changes in report
|
55
|
-
# input_database=os.getcwd()+"//TEMP//DATABASES//SA_database.gpkg"
|
56
|
-
# layers = fiona.listlayers(os.getcwd()+"//TEMP//DATABASES//SA_database.gpkg")
|
57
|
-
# walous = ["WALOUS_2018_LB72_112", "WALOUS_2018_LB72_31", "WALOUS_2018_LB72_32", "WALOUS_2018_LB72_331",
|
58
|
-
# "WALOUS_2018_LB72_332", "WALOUS_2018_LB72_333", "WALOUS_2018_LB72_34"]
|
59
|
-
# data_type="GPKG"
|
60
|
-
# PICC = gpd.read_file(os.getcwd()+"//TEMP//DATABASES//SA_PICC.gpkg", driver="GPKG", layer = 'CONSTR_BATIEMPRISE')
|
61
|
-
# CaPa = gpd.read_file(os.getcwd()+"//TEMP//DATABASES//SA_CaPa.gpkg", driver='GPKG', layer= 'CaPa')
|
62
|
-
# output_database = os.getcwd()+"//TEMP//DATABASES//SA_database_final.gpkg"
|
63
|
-
# for i in range(len(layers)):
|
64
|
-
# print(i)
|
65
|
-
# func.data_modification(input_database, data_type, layers[i], walous, output_database, PICC, CaPa)
|
66
|
-
# func.shp_to_raster(os.getcwd()+"//INPUT//DATABASE//CE_IGN_TOP10V/CE_IGN_TOP10V.shp", os.getcwd()+"//TEMP//DATABASES//CE_IGN_TOP10V.tiff")
|
67
|
-
# #Pre-processing for Vulnerability
|
68
|
-
# layers = fiona.listlayers(os.getcwd()+"//TEMP//DATABASES//SA_database_final.gpkg")
|
69
|
-
# paths = pd.read_csv(os.getcwd()+"//INPUT//CSVs//Vulnerability_matrix_new1.csv", sep=",", encoding='latin-1')
|
70
|
-
# paths[["name", "name1"]] = paths["Path"].str.split("/", expand=True)
|
71
|
-
# names = paths["name1"].to_list()
|
72
|
-
# list_shp = list(set(names).difference(layers))
|
73
|
-
# print("Excluded layers due to no features in shapefiles:")
|
74
|
-
# print(list_shp)
|
75
|
-
# paths1 =paths[~paths["name1"].isin(list_shp)]
|
76
|
-
# a,b = paths1.shape
|
77
|
-
# print("STEP1: Saving the database for Vulnerability with attributes Vulne and Code")
|
78
|
-
# for i in range(a):
|
79
|
-
# shp = gpd.read_file(os.getcwd()+"//TEMP//DATABASES//SA_database_final.gpkg",
|
80
|
-
# driver='GPKG',
|
81
|
-
# layer=paths1["name1"][i])
|
82
|
-
# x, y = shp.shape
|
83
|
-
# if x > 0:
|
84
|
-
# shp["Path"] = paths["name1"][i]
|
85
|
-
# shp["Vulne"] = paths["Vulne"][i]
|
86
|
-
# shp["Code"] = paths["Code"][i]
|
87
|
-
# shp = shp[["geometry", "Path", "Vulne","Code"]]
|
88
|
-
# shp.to_file(os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg",
|
89
|
-
# driver='GPKG',
|
90
|
-
# layer=paths["name1"][i])
|
91
|
-
# print("STEP2: convert vectors to raster based on their vulnerability values")
|
92
|
-
# layer = fiona.listlayers(os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg")
|
93
|
-
# database = os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg"
|
94
|
-
# extent = os.getcwd()+"//INPUT//STUDY_AREA//Bassin_SA.shp"
|
95
|
-
# attribute = "Vulne"
|
96
|
-
# Parallels.parallel_v2r(layer, database, extent, attribute)
|
97
|
-
# attribute = "Code"
|
98
|
-
# Parallels.parallel_v2r(layer, database, extent, attribute)
|
99
|
-
# #
|
100
|
-
# def Vulnerability(main_dir,sc,AOI):
|
101
|
-
# print("Starting VULNERABILITY computations at 1 m resolution")
|
102
|
-
# os.chdir(main_dir)
|
103
|
-
# # layers = fiona.listlayers(os.getcwd()+"//TEMP//DATABASES//SA_database_final.gpkg")
|
104
|
-
# # # load the paths from csv with Vulne values
|
105
|
-
# # paths = pd.read_csv(os.getcwd()+"//INPUT//CSVs//Vulnerability_matrix_new1.csv", sep=",", encoding='latin-1')
|
106
|
-
# # paths[["name", "name1"]] = paths["Path"].str.split("/", expand=True)
|
107
|
-
# # #names = paths["name1"].to_list()
|
108
|
-
# # # loop for loading all shapefiles with the names matching with vulnerability matrix
|
109
|
-
# # names = paths["name1"].to_list()
|
110
|
-
# # list_shp = list(set(names).difference(layers))
|
111
|
-
# # print("Excluded layers due to no features in shapefiles:")
|
112
|
-
# # print(list_shp)
|
113
|
-
# # paths1 =paths[~paths["name1"].isin(list_shp)]
|
114
|
-
# # a,b = paths1.shape
|
115
|
-
# # print("STEP1: Saving the database for Vulnerability with attributes Vulne and Code")
|
116
|
-
# # for i in range(a):
|
117
|
-
# # shp = gpd.read_file(os.getcwd()+"//TEMP//DATABASES//SA_database_final.gpkg",
|
118
|
-
# # driver='GPKG',
|
119
|
-
# # layer=paths1["name1"][i])
|
120
|
-
# # x, y = shp.shape
|
121
|
-
# # if x > 0:
|
122
|
-
# # shp["Path"] = paths["name1"][i]
|
123
|
-
# # shp["Vulne"] = paths["Vulne"][i]
|
124
|
-
# # shp["Code"] = paths["Code"][i]
|
125
|
-
# # shp = shp[["geometry", "Path", "Vulne","Code"]]
|
126
|
-
# # shp.to_file(os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg",
|
127
|
-
# # driver='GPKG',
|
128
|
-
# # layer=paths["name1"][i])
|
129
|
-
# # print("STEP2: convert vectors to raster based on their vulnerability values")
|
130
|
-
# # layer = fiona.listlayers(os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg")
|
131
|
-
# # database = os.getcwd()+"//TEMP//DATABASES//SA_database_final_V.gpkg"
|
132
|
-
# # extent = os.getcwd()+"//INPUT//STUDY_AREA//Bassin_SA.shp"
|
133
|
-
# # attribute = "Vulne"
|
134
|
-
# # Parallels.parallel_v2r(layer, database, extent, attribute)
|
135
|
-
# # attribute = "Code"
|
136
|
-
# # Parallels.parallel_v2r(layer, database, extent, attribute)
|
137
|
-
# bu = glob.glob(os.getcwd()+"//INPUT//REMOVED_BUILDINGS//Scenario"+str(sc)+"//*.shp")
|
138
|
-
# if len(bu)>0:
|
139
|
-
# bu_PICC = os.getcwd()+"//INPUT//REMOVED_BUILDINGS//Scenario"+str(sc)+"//Removed_Buildings_PICC.shp"
|
140
|
-
# bu_CaBu = os.getcwd()+"//INPUT//REMOVED_BUILDINGS//Scenario"+str(sc)+"//Removed_Buildings_CaBu.shp"
|
141
|
-
# func.shp_to_raster(bu_PICC, os.getcwd()+"//TEMP//REMOVED_BUILDINGS//Scenario"+str(sc)+"//Removed_Buildings_PICC.tiff")
|
142
|
-
# func.shp_to_raster(bu_CaBu, os.getcwd()+"//TEMP//REMOVED_BUILDINGS//Scenario"+str(sc)+"//Removed_Buildings_CaBu.tiff")
|
143
|
-
# else:
|
144
|
-
# print("No buildings were removed in water depth analysis OR No shapefiles in INPUT/REMOVED_BUILDINGS/Scenario"+str(sc))
|
145
|
-
# print("STEP3: Generate Vulnerability rasters 1m")
|
146
|
-
# attribute="Vulne"
|
147
|
-
# Output_tiff = os.getcwd()+"//TEMP//VULNERABILITY//Scenario"+str(sc)+"//Vulnerability_SA.tiff"
|
148
|
-
# func.Comp_Vulnerability(Output_tiff, attribute,sc)
|
149
|
-
# attribute = "Code"
|
150
|
-
# Output_tiff = os.getcwd()+"//TEMP//VULNERABILITY//Scenario"+str(sc)+"//Vulnerability_Code_SA.tiff"
|
151
|
-
# print(Output_tiff)
|
152
|
-
# func.Comp_Vulnerability(Output_tiff, attribute,sc)
|
153
|
-
# print("STEP4: Save Vulnerability files for the area of interest")
|
154
|
-
# func.match_vuln_modrec(os.getcwd() + "//TEMP//DATABASES//CE_IGN_TOP10V/CE_IGN_TOP10V.tiff",
|
155
|
-
# os.getcwd() + "//TEMP//Masked/River_extent.tiff", os.getcwd()+"//INPUT//WATER_DEPTH//Scenario"+str(sc)+"//T1000.tif")
|
156
|
-
# func.match_vuln_modrec(os.getcwd() + "//TEMP//VULNERABILITY//Scenario"+str(sc)+"//Vulnerability_SA.tiff",
|
157
|
-
# os.getcwd() + "//OUTPUT//VULNERABILITY//Scenario"+str(sc)+"Vulnerability_"+str(AOI)+".tiff", os.getcwd()+"//INPUT//WATER_DEPTH//Scenario"+str(sc)+"//T1000.tif")
|
158
|
-
# func.match_vuln_modrec(os.getcwd() + "//TEMP//VULNERABILITY//Scenario"+str(sc)+"//Vulnerability_Code_SA.tiff",
|
159
|
-
# os.getcwd() + "//OUTPUT//VULNERABILITY//Scenario"+str(sc)+"//Vulnerability_Code"+str(AOI)+".tiff", os.getcwd()+"//INPUT//WATER_DEPTH//Scenario"+str(sc)+"//T1000.tif")
|
160
|
-
|
161
|
-
# def Vulnerability2(main_dir, attribute):
|
162
|
-
# os.chdir(main_dir)
|
163
|
-
# Output_tiff = os.getcwd()+"//OUTPUT//VULNERABILITY//Vulnerability_Code.tiff"
|
164
|
-
# func.Comp_Vulnerability(Output_tiff, attribute)
|
165
|
-
# #func.match_vuln_modrec(os.getcwd() + "//TEMP//DATABASES//CE_IGN_TOP10V/CE_IGN_TOP10V.tiff",
|
166
|
-
# # os.getcwd() + "//TEMP//Masked/River_extent.tiff")
|
167
|
-
# #func.match_vuln_modrec(os.getcwd() + "//OUTPUT//VULNERABILITY//Vulnerability.tiff",
|
168
|
-
# # os.getcwd() + "//TEMP//Masked/Vulnerability_extent.tiff")
|
169
|
-
# #func.match_vuln_modrec(os.getcwd() + "//OUTPUT//VULNERABILITY//Vulnerability_Code.tiff",
|
170
|
-
# # os.getcwd() + "//TEMP//Masked/Vulnerability_Code_extent.tiff")
|
171
|
-
|
172
|
-
# def acceptability(main_dir,area_of_interest):
|
173
|
-
# os.chdir(main_dir)
|
174
|
-
# Vulne = gdal.Open(os.getcwd() + "//TEMP//Masked/Vulnerability_extent.tiff")
|
175
|
-
# Vulne = Vulne.GetRasterBand(1).ReadAsArray()
|
176
|
-
# riv = gdal.Open(os.getcwd() + "//TEMP//Masked/River_extent.tiff")
|
177
|
-
# riv = riv.GetRasterBand(1).ReadAsArray()
|
178
|
-
# list1 = ["2", "5", "15", "25", "50", "100", "1000"]
|
179
|
-
# # sample for saving the raster
|
180
|
-
# # mod1 = rasterio.open("G://00_GT_Resilience//Simulations_Theux//Scen_"+str(scen)+"//Theux_1.3K_sim_T1000_h.tif")
|
181
|
-
# Qfile = pd.read_csv(os.getcwd() + "//INPUT//CSVs//Book2.csv")
|
182
|
-
# # run vul-mod for 4 return intervals
|
183
|
-
# x = glob.glob(os.getcwd() + "//INPUT//WATER_DEPTH//*.tiff")
|
184
|
-
# Area_interest = area_of_interest
|
185
|
-
# for i in range(len(list1)):
|
186
|
-
# mod = gdal.Open(x[i])
|
187
|
-
# mod = mod.GetRasterBand(1).ReadAsArray()
|
188
|
-
# mod[mod == 0] = np.nan
|
189
|
-
# mod[riv == 1] = np.nan
|
190
|
-
# func.VulMod(Qfile, mod, Vulne, list1[i], Area_interest)
|
191
|
-
# ax=locals()
|
192
|
-
# list1=["2","5", "15","25", "50", "100", "1000"]
|
193
|
-
# qs= glob.glob(os.getcwd()+"//TEMP//Q_files//*.tiff")
|
194
|
-
# for i in range(len(list1)):
|
195
|
-
# ax["vm"+str(i)] = gdal.Open(qs[i])
|
196
|
-
# ax["vm"+str(i)] = ax["vm"+str(i)].GetRasterBand(1).ReadAsArray()
|
197
|
-
# #Remove nans from other Q files for final acceptability computation
|
198
|
-
# for i in range(len(list1)-1):
|
199
|
-
# ax["vm"+str(i)+str(1)] = np.nan_to_num(ax["vm"+str(i)], nan=0)
|
200
|
-
# ax["vm"+str(i)+str(1)][np.isnan(ax["vm"+str(len(list1))])] = np.nan
|
201
|
-
# pond = pd.read_csv(os.getcwd()+"//INPUT//CSVs//Ponderation.csv")
|
202
|
-
# comb = vm6*float(pond.iloc[6,1]) + vm51*float(pond.iloc[5,1]) + vm41*float(pond.iloc[4,1]) + vm31*float(pond.iloc[3,1]) + vm21*float(pond.iloc[2,1]) + vm11*float(pond.iloc[1,1]) +vm01*float(pond.iloc[0,1])
|
203
|
-
# dst_filename = os.getcwd()+"//OUTPUT//ACCEPTABILITY//Acceptability"+str(area_of_interest)+".tiff"
|
204
|
-
# y_pixels, x_pixels = comb.shape # number of pixels in x
|
205
|
-
# driver = gdal.GetDriverByName('GTiff')
|
206
|
-
# dataset = driver.Create(dst_filename, x_pixels, y_pixels, gdal.GDT_Float32, 1, options=["COMPRESS=LZW"])
|
207
|
-
# dataset.GetRasterBand(1).WriteArray(comb.astype(np.float32))
|
208
|
-
# input_raster = os.getcwd()+"//OUTPUT//ACCEPTABILITY//Acceptability"+str(area_of_interest)+".tiff"
|
209
|
-
# output_raster = os.getcwd()+"//OUTPUT//ACCEPTABILITY//Acceptability"+str(area_of_interest)+"_100m.tiff"
|
210
|
-
# Agg = gdal.Warp(output_raster, input_raster, xRes=100, yRes=100, resampleAlg='Average')
|
211
|
-
# Agg = None
|
File without changes
|
File without changes
|