wolfhece 2.0.17__py3-none-any.whl → 2.0.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/CpGrid.py +10 -13
- wolfhece/PyCrosssections.py +18 -13
- wolfhece/PyDraw.py +80 -8
- wolfhece/PyHydrographs.py +2 -2
- wolfhece/PyParams.py +113 -35
- wolfhece/PyPictures.py +48 -45
- wolfhece/PyVertex.py +149 -18
- wolfhece/PyVertexvectors.py +40 -33
- wolfhece/apps/curvedigitizer.py +4 -1
- wolfhece/apps/wolfcompare2Darrays.py +11 -7
- wolfhece/clientserver/clientserver.py +62 -0
- wolfhece/friction_law.py +39 -34
- wolfhece/ftp/downloader.py +8 -7
- wolfhece/gpuview.py +14 -13
- wolfhece/hydrology/Catchment.py +2 -2
- wolfhece/hydrology/PyWatershed.py +2 -2
- wolfhece/hydrology/SubBasin.py +13 -11
- wolfhece/hydrometry/kiwis_gui.py +9 -9
- wolfhece/irm_qdf.py +12 -10
- wolfhece/lazviewer/laz_viewer.py +4 -1
- wolfhece/mar/Interface_MAR_WOLF_objet.py +260 -161
- wolfhece/opengl/py3d.py +4 -4
- wolfhece/pyshields.py +4 -4
- wolfhece/pythonfortran/example_makendarray.py +46 -41
- wolfhece/pythonfortran/example_numpy_memory.py +87 -83
- wolfhece/pythonfortran/tools.py +1 -1
- wolfhece/scenario/imposebc_void.py +2 -3
- wolfhece/scenario/update_void.py +6 -6
- wolfhece/wolf_array.py +47 -18
- wolfhece/wolfresults_2D.py +2 -4
- {wolfhece-2.0.17.dist-info → wolfhece-2.0.19.dist-info}/METADATA +7 -1
- {wolfhece-2.0.17.dist-info → wolfhece-2.0.19.dist-info}/RECORD +36 -41
- wolfhece/apps/wolfBernoulli.py +0 -18
- wolfhece/bernoulli/ModelJockgrim.py +0 -226
- wolfhece/bernoulli/NetworkOpenGL.py +0 -6461
- wolfhece/bernoulli/ReadNeupotzData.py +0 -223
- wolfhece/bernoulli/opti_results_interactive_plot.py +0 -212
- wolfhece/debug.py +0 -8
- /wolfhece/{bernoulli → clientserver}/__init__.py +0 -0
- {wolfhece-2.0.17.dist-info → wolfhece-2.0.19.dist-info}/WHEEL +0 -0
- {wolfhece-2.0.17.dist-info → wolfhece-2.0.19.dist-info}/entry_points.txt +0 -0
- {wolfhece-2.0.17.dist-info → wolfhece-2.0.19.dist-info}/top_level.txt +0 -0
wolfhece/friction_law.py
CHANGED
@@ -2,21 +2,23 @@ import math
|
|
2
2
|
|
3
3
|
def f_barr_bathurst(k_sur_D,reynolds):
|
4
4
|
"""
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
5
|
+
Evaluation du coefficient de frottement par Barr-Bathurst
|
6
|
+
:param k_sur_D : rugosité relative [-]
|
7
|
+
:param reynolds : nombre de Reynolds [-] au sens des conduites circulaires --> ATTENTION quand cette fonction est utilisée pour des écoulements à surface libre : Re_prim = 4*Re
|
8
|
+
|
9
|
+
@author Louis Goffin
|
10
|
+
@author Pierre Archambeau
|
11
|
+
|
12
|
+
source : TFE O. Machiels - "P:\Documentations\TFE\2008 - O. Machiels"
|
13
|
+
|
14
|
+
La formule habituelle de Barr s'écrit en canalisation (p24 du TFE): \f$ \frac{1}{{\sqrt f }} = - 2\log \left[ {\frac{{4,518\log \left( {\frac{{{Re} }}{7}} \right)}}{{{Re} \left( {1 + \frac{{{{{Re} }^{0,52}}{{\left( {\frac{k}{D}} \right)}^{0,7}}}}{{29}}} \right)}} + \frac{k}{{3,7D}}} \right] \f$
|
15
|
+
|
16
|
+
Elle est étendue aux macro-rugosités via l'adjonction de la formule de Bathurst (!établie en surface libre!) (p27) : \f$ \sqrt {\frac{1}{f}} = - 1,987\log \frac{{{D_{84}}}}{{5,15h}} \f$
|
17
|
+
|
18
|
+
La jonction entre les 2 suit un polynôme : \f$ {\frac{1}{{\sqrt f }} = 1469,76{{\left( {\frac{k}{h}} \right)}^3} - 382,83{{\left( {\frac{k}{h}} \right)}^2} + 9,89\left( {\frac{k}{h}} \right) + 5,22\quad pour\quad 0,05 < \frac{k}{h} < 0,15} \f$
|
19
|
+
|
20
|
+
@remark Les bornes de validité des lois sont exprimées en k_sur_h, c'est-à-dire en 4*k_sur_D
|
21
|
+
|
20
22
|
"""
|
21
23
|
k_sur_h = 4.0*k_sur_D
|
22
24
|
|
@@ -43,19 +45,21 @@ def f_barr_bathurst(k_sur_D,reynolds):
|
|
43
45
|
|
44
46
|
def f_colebrook(k_sur_D,reynolds):
|
45
47
|
"""
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
Evaluation du coefficient de frottement par Colebrook
|
49
|
+
|
50
|
+
:param k_sur_D : rugosité relative [-]
|
51
|
+
:param reynolds : nombre de Reynolds [-] au sens des conduites circulaires --> ATTENTION quand cette fonction est utilisée pour des écoulements à surface libre : Re_prim = 4*Re
|
52
|
+
|
53
|
+
@author Pierre Archambeau
|
54
|
+
|
55
|
+
Formule implicite de Colebrook : \f$ \sqrt {\frac{1}{f}} = - 2\log \left[ {\frac{k}{{3,7D}} + \frac{{2,51}}{{Re \sqrt f }}} \right] = - 2\log \left[ {\frac{k}{{14,8{R_h}}} + \frac{{2,51}}{{Re \sqrt f }}} \right] \f$
|
56
|
+
|
57
|
+
Frottement laminaire en section circulaire \f$ \frac{64}{Re} \f$
|
58
|
+
|
59
|
+
Transition par combinaison linéaire entre \f$ 800<Re<1000 \f$
|
60
|
+
|
61
|
+
@remark Une transition est assurée entre laminaire et turbulent afin de pouvoir utiliser cette fonction dans des procédures itératives
|
62
|
+
du type Newton-Raphson qui supportent très mal les fonctions discontinues
|
59
63
|
|
60
64
|
"""
|
61
65
|
|
@@ -81,12 +85,13 @@ def f_colebrook(k_sur_D,reynolds):
|
|
81
85
|
|
82
86
|
def f_colebrook_pure(k_sur_D,reynolds):
|
83
87
|
"""
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
88
|
+
Evaluation du coefficient de frottement par Colebrook - pas de test si laminaire
|
89
|
+
:param k_sur_D : rugosité relative [-]
|
90
|
+
:param reynolds : nombre de Reynolds [-] au sens des conduites circulaires --> ATTENTION quand cette fonction est utilisée pour des écoulements à surface libre : Re_prim = 4*Re
|
91
|
+
|
92
|
+
@author Pierre Archambeau
|
93
|
+
|
94
|
+
Formule implicite de Colebrook : \f$ \sqrt {\frac{1}{f}} = - 2\log \left[ {\frac{k}{{3,7D}} + \frac{{2,51}}{{Re \sqrt f }}} \right] = - 2\log \left[ {\frac{k}{{14,8{R_h}}} + \frac{{2,51}}{{Re \sqrt f }}} \right] \f$
|
90
95
|
"""
|
91
96
|
|
92
97
|
# !TURBULENT
|
wolfhece/ftp/downloader.py
CHANGED
@@ -6,16 +6,15 @@ import re
|
|
6
6
|
MIT license: 2017 - Jwely
|
7
7
|
|
8
8
|
Example usage:
|
9
|
-
|
9
|
+
|
10
10
|
import ftplib
|
11
11
|
ftp = ftplib.FTP(mysite, username, password)
|
12
12
|
download_ftp_tree(ftp, remote_dir, local_dir)
|
13
|
-
```
|
14
13
|
|
15
14
|
The code above will look for a directory called "remote_dir" on the ftp host, and then duplicate the
|
16
15
|
directory and its entire contents into the "local_dir".
|
17
16
|
|
18
|
-
|
17
|
+
Note that if wget is an option, I recommend using that instead
|
19
18
|
|
20
19
|
"""
|
21
20
|
|
@@ -81,14 +80,14 @@ def _file_name_match_patern(pattern, name):
|
|
81
80
|
|
82
81
|
def _mirror_ftp_dir(ftp_handle, name, overwrite, guess_by_extension, pattern):
|
83
82
|
""" replicates a directory on an ftp server recursively """
|
84
|
-
|
83
|
+
|
85
84
|
ftp_handle.cwd(name)
|
86
85
|
files=[]
|
87
86
|
ftp_handle.dir(files.append)
|
88
87
|
files = [curf.split()[8] for curf in files]
|
89
88
|
for item in files:
|
90
89
|
if _is_ftp_dir(ftp_handle, item, guess_by_extension):
|
91
|
-
|
90
|
+
|
92
91
|
original_directory = os.getcwd() # remember working directory before function is executed
|
93
92
|
os.makedirs(item, exist_ok=True)
|
94
93
|
os.chdir(item) # change working directory to ftp mirror directory
|
@@ -106,14 +105,16 @@ def _mirror_ftp_dir(ftp_handle, name, overwrite, guess_by_extension, pattern):
|
|
106
105
|
def download_ftp_tree(ftp_handle, path, destination, pattern=None, overwrite=False, guess_by_extension=True):
|
107
106
|
"""
|
108
107
|
Downloads an entire directory tree from an ftp server to the local destination
|
108
|
+
|
109
109
|
:param ftp_handle: an authenticated ftplib.FTP instance
|
110
110
|
:param path: the folder on the ftp server to download
|
111
111
|
:param destination: the local directory to store the copied folder
|
112
112
|
:param pattern: Python regex pattern, only files that match this pattern will be downloaded.
|
113
113
|
:param overwrite: set to True to force re-download of all files, even if they appear to exist already
|
114
114
|
:param guess_by_extension: It takes a while to explicitly check if every item is a directory or a file.
|
115
|
-
|
116
|
-
|
115
|
+
|
116
|
+
If this flag is set to True, it will assume any file ending with a three character extension ".???" is
|
117
|
+
a file and not a directory. Set to False if some folders may have a "." in their names -4th position.
|
117
118
|
"""
|
118
119
|
path = path.lstrip("/")
|
119
120
|
original_directory = os.getcwd() # remember working directory before function is executed
|
wolfhece/gpuview.py
CHANGED
@@ -293,12 +293,12 @@ class VectorField(Element_To_Draw):
|
|
293
293
|
|
294
294
|
"""
|
295
295
|
Logique de calcul :
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
296
|
+
- on normalise les composantes vectorielles --> [0, 1]
|
297
|
+
- on redistribue les normes entre [minsize , 1.] --> minsize==1 => toutes les flèches sont de taille identique
|
298
|
+
- on recalcule les composantes vectorielles sur base de cette nouvelle norme
|
299
|
+
- lors du dessin, on multiplie le facteur de mise à l'échelle par (self.zoom_factor * self.zoom_2)
|
300
|
+
- le premier facteur tient compte de la mise à l'échelle globale du champ vectoriel sur base d'une combinaison de blocs --> Wolfresults_2D
|
301
|
+
- le second facteur est purement graphique et sert à augmenter/réduire la taille tout en gardent la proportionnalité
|
302
302
|
"""
|
303
303
|
|
304
304
|
self._set_data(x_extent, y_extent)
|
@@ -550,13 +550,14 @@ class VectorField(Element_To_Draw):
|
|
550
550
|
def update_geometry(self, model_bounds: Rectangle, grid_bounds: Rectangle,
|
551
551
|
nb_arrows_x: int, nb_arrows_y: int,
|
552
552
|
arrow_scale_x: float, arrow_scale_y: float, aspect_ratio: float):
|
553
|
-
"""
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
553
|
+
"""
|
554
|
+
Model bounds: the coordinates of the full model we draw (world coord)
|
555
|
+
Grid bounds : the coordinates over which the grid will be computed (world coord);
|
556
|
+
nb_arrows: number of vector to plot in x/y dimension
|
557
|
+
expected to be a subset of model bounds.
|
558
|
+
arrow_scale : scale factor for arrows (expected to be used to maintain
|
559
|
+
the arrow size constant on screen)
|
560
|
+
aspect_ration: to adapt to screen's aspect ratio.
|
560
561
|
"""
|
561
562
|
|
562
563
|
self._model_bounds = model_bounds
|
wolfhece/hydrology/Catchment.py
CHANGED
@@ -1384,8 +1384,8 @@ class Catchment:
|
|
1384
1384
|
Structure du dictionnaire
|
1385
1385
|
self.hyetoDict:
|
1386
1386
|
- Ordered To Nb: self.hyetoDict['Ordered To Nb'][nb] = iD
|
1387
|
-
|
1388
|
-
|
1387
|
+
- iD = hyeto nb of the file to read in the folder "Whole_basin". E.g.: the file "[iD]evap.hyeto"
|
1388
|
+
- nb = hyeto number sorted from 1 to nbHyeto. E.g.: if iD=['2', '5', '7'] => self.hyetoDict['Ordered To Nb'][2] = '5'
|
1389
1389
|
- Hyetos : self.hyetoDict['Hyetos'][nb]
|
1390
1390
|
- time: time array read in the .hyeto file
|
1391
1391
|
- rain: rain array read in the .hyeto file
|
@@ -303,8 +303,8 @@ class RiverSystem:
|
|
303
303
|
Incrément d'index depuis l'amont jusque l'exutoire final
|
304
304
|
Parcours des mailles rivières depuis tous les amonts et Incrémentation d'une unité
|
305
305
|
Résultat :
|
306
|
-
|
307
|
-
|
306
|
+
- tous les biefs en amont sont à 1
|
307
|
+
- Les autres biefs contiennent le nombre de biefs en amont
|
308
308
|
|
309
309
|
Indice de Strahler
|
310
310
|
"""
|
wolfhece/hydrology/SubBasin.py
CHANGED
@@ -1018,17 +1018,19 @@ class SubBasin:
|
|
1018
1018
|
|
1019
1019
|
|
1020
1020
|
def compute_hydro(self):
|
1021
|
-
"""
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1021
|
+
"""
|
1022
|
+
This procedure computes the total hydrograph and raw hydrograph of subbasin
|
1023
|
+
|
1024
|
+
The total hydrograph $q_{tot} is obtained with the formula:
|
1025
|
+
\f[
|
1026
|
+
q_{tot} = \sum q_{\text{inlets}} + q_{\text{me}}$
|
1027
|
+
\f]
|
1028
|
+
, with $q_{\text{me}}$ the hydrograph of the subbasin alone.
|
1029
|
+
|
1030
|
+
Internal variable changed: outFlowRaw, outFlow, inletsRaw
|
1031
|
+
CAUTION:
|
1032
|
+
- Discussion about the ceil or the floor for the timeDelay indice!!!
|
1033
|
+
- UPDATE 2023.1 now the outFlow are not delayed anymore !!!! -> IMPORTANT UPDATE
|
1032
1034
|
|
1033
1035
|
"""
|
1034
1036
|
if(len(self._outFlow)==0):
|
wolfhece/hydrometry/kiwis_gui.py
CHANGED
@@ -14,15 +14,15 @@ import logging
|
|
14
14
|
#Test de la présence de la fonction de traduction i18n "gettext" et définition le cas échéant pour ne pas créer d'erreur d'exécution
|
15
15
|
import os
|
16
16
|
import gettext
|
17
|
-
if os.path.exists(os.path.dirname(__file__)+'\\..\\locales'):
|
18
|
-
|
19
|
-
|
20
|
-
else:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
# if os.path.exists(os.path.dirname(__file__)+'\\..\\locales'):
|
18
|
+
# t = gettext.translation('base', localedir=os.path.dirname(__file__)+'\\..\\locales', languages=['fr'])
|
19
|
+
# t.install()
|
20
|
+
# else:
|
21
|
+
# try:
|
22
|
+
# t = gettext.translation('base', localedir='wolfhece\\locales', languages=['fr'])
|
23
|
+
# t.install()
|
24
|
+
# except:
|
25
|
+
# pass
|
26
26
|
|
27
27
|
_=gettext.gettext
|
28
28
|
|
wolfhece/irm_qdf.py
CHANGED
@@ -162,7 +162,8 @@ class MontanaIRM():
|
|
162
162
|
return fig,ax
|
163
163
|
|
164
164
|
class Qdf_IRM():
|
165
|
-
"""
|
165
|
+
"""
|
166
|
+
Gestion des relations QDF calculées par l'IRM
|
166
167
|
|
167
168
|
Exemple d'utilisation :
|
168
169
|
|
@@ -178,11 +179,11 @@ class Qdf_IRM():
|
|
178
179
|
myqdf = qdf.Qdf_IRM(name='Jalhay')
|
179
180
|
|
180
181
|
Les données sont ensuite disponibles dans les propriétés, qui sont des "dataframes" pandas (https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) :
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
182
|
+
- qdf : les relation Quantité/durée/fréquence
|
183
|
+
- standarddev : l'écart-type de l'erreur
|
184
|
+
- confintlow : la valeur inférieure de l'intervalle de confiance (-2*stddev)
|
185
|
+
- confintup : la valeur supérieure de l'intervalle de confiance (+2*stddev)
|
186
|
+
- montanacoeff : les coeffciients de Montana
|
186
187
|
|
187
188
|
Il est par exemple possible d'accéder aux coefficients de Montana via l'une de ces lignes ou une combinaison :
|
188
189
|
|
@@ -285,8 +286,9 @@ class Qdf_IRM():
|
|
285
286
|
def plot_idf(self,T=None,which='All',color=[27./255.,136./255.,245./255.]):
|
286
287
|
"""
|
287
288
|
Plot IDF relations on a new figure
|
288
|
-
|
289
|
-
|
289
|
+
|
290
|
+
:param T : the return period (based on RT constants)
|
291
|
+
:param which : information to plot
|
290
292
|
- 'Montana'
|
291
293
|
- 'QDFTable'
|
292
294
|
- 'All'
|
@@ -325,8 +327,8 @@ class Qdf_IRM():
|
|
325
327
|
def plot_qdf(self,T=None,which='All',color=[27./255.,136./255.,245./255.]):
|
326
328
|
"""
|
327
329
|
Plot QDF relations on a new figure
|
328
|
-
T : the return period (based on RT constants)
|
329
|
-
which : information to plot
|
330
|
+
:param T : the return period (based on RT constants)
|
331
|
+
:param which : information to plot
|
330
332
|
- 'Montana'
|
331
333
|
- 'QDFTable'
|
332
334
|
- 'All'
|
wolfhece/lazviewer/laz_viewer.py
CHANGED
@@ -33,6 +33,7 @@ class Colors_Lazviewer(Enum):
|
|
33
33
|
ORTHO_2012_2013 = 2013
|
34
34
|
ORTHO_2015 = 2015
|
35
35
|
ORTHO_2021 = 2021
|
36
|
+
ORTHO_2023 = 2023
|
36
37
|
ORTHO_2006_2007 = 2006
|
37
38
|
CODE_2013 = 0
|
38
39
|
CODE_2023 = 2
|
@@ -93,7 +94,7 @@ class Classification_LAZ():
|
|
93
94
|
self.test_wx()
|
94
95
|
|
95
96
|
if self._choose_colors is None and self.wx_exists:
|
96
|
-
self._choose_colors = Wolf_Param(None, _('Colors of classification LAZ 2023'), w=600, h=800, to_read=False, withbuttons=True, toShow=False)
|
97
|
+
self._choose_colors = Wolf_Param(None, _('Colors of classification LAZ 2023'), w=600, h=800, to_read=False, withbuttons=True, toShow=False, force_even_if_same_default=True)
|
97
98
|
self._choose_colors.callback = self.callback_colors
|
98
99
|
self._choose_colors.callbackdestroy = self.callback_destroy
|
99
100
|
self._choose_colors.hide_selected_buttons()
|
@@ -987,6 +988,8 @@ def get_colors(las:laspy.LasData, which_colors:Colors_Lazviewer, imsize=2000, fn
|
|
987
988
|
mycat='IMAGERIE/ORTHO_2021'
|
988
989
|
elif which_colors==Colors_Lazviewer.ORTHO_2006_2007.value:
|
989
990
|
mycat='IMAGERIE/ORTHO_2006_2007'
|
991
|
+
elif which_colors==Colors_Lazviewer.ORTHO_2023.value:
|
992
|
+
mycat='IMAGERIE/ORTHO_2023_ETE'
|
990
993
|
|
991
994
|
if type(las) is laspy.LasData:
|
992
995
|
x = las.x
|