:py:mod:`wolfhece.wolfresults_2D` ================================= .. py:module:: wolfhece.wolfresults_2D .. autoapi-nested-parse:: Author: HECE - University of Liege, Pierre Archambeau Date: 2024 Copyright (c) 2024 University of Liege. All rights reserved. This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited. Module Contents --------------- .. py:data:: msg .. py:function:: outside_domain(val) Test if a value is outside the calculated domain .. py:function:: q_splitting(q_left, q_right) Splitting of the normal flow between two nodes .. py:function:: u_splitting(q_left, q_right, h_left, h_right) Splitting of the normal flow velocity between two nodes .. py:function:: _process_danger_map_chunk(chunk) .. py:class:: Props_Res_2D(parent: Wolfresults_2D, mapviewer=None) Bases: :py:obj:`wx.Frame` .. autoapi-inheritance-diagram:: wolfhece.wolfresults_2D.Props_Res_2D :parts: 1 :private-bases: Fenêtre de propriétésd'un Wolfresults_2D .. py:method:: get_mapviewer() Retourne une instance WolfMapViewer .. py:method:: get_linked_arrays() Pour compatibilité avec la gestion de vecteur et WolfMapViewer .. py:method:: set_GUI() Set the wx GUI .. py:method:: OnDefault_cmap(event: wx.MouseEvent) Load a default colormap .. py:method:: onclose(event: wx.CloseEvent) Hide the window instead of closing/detsroy it .. py:method:: onshow(event: wx.ShowEvent) Update the GUI when the window is shown .. py:method:: OnApplyTools(event: wx.MouseEvent) Apply modifications in the textctrl .. py:method:: update_palette() Update the colormap grid and plot .. py:method:: Onsavepal(event: wx.MouseEvent) Save the colormap to a file .. py:method:: Onloadpal(event) Read the colormap from a file .. py:method:: Onloaddefaultpal(event: wx.MouseEvent) Load default palette .. py:method:: Onpalimage(event) Export the colormap to an image .. py:method:: Onpaldistribute(event) Distribute uniformly the colormap values .. py:method:: Onupdatepal(event) Update the colormap from the grid .. py:method:: OnClickHistoUpdate(event: wx.MouseEvent) Click to update the histogram .. py:method:: OnClickColorPal(event: wx.MouseEvent) Click to open the color dialog box .. py:method:: select_node_by_node() .. py:class:: views_2D Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.wolfresults_2D.views_2D :parts: 1 :private-bases: Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: WATERDEPTH .. py:attribute:: WATERLEVEL .. py:attribute:: TOPOGRAPHY .. py:attribute:: QX .. py:attribute:: QY .. py:attribute:: QNORM .. py:attribute:: UX .. py:attribute:: UY .. py:attribute:: UNORM .. py:attribute:: HEAD .. py:attribute:: FROUDE .. py:attribute:: KINETIC_ENERGY .. py:attribute:: EPSILON .. py:attribute:: TURB_VISC_2D .. py:attribute:: TURB_VISC_3D .. py:attribute:: VECTOR_FIELD_Q .. py:attribute:: VECTOR_FIELD_U .. py:attribute:: U_SHEAR .. py:attribute:: SHIELDS_NUMBER .. py:attribute:: CRITICAL_DIAMETER_SHIELDS .. py:attribute:: CRITICAL_DIAMETER_IZBACH .. py:attribute:: CRITICAL_DIAMETER_SUSPENSION_50 .. py:attribute:: CRITICAL_DIAMETER_SUSPENSION_100 .. py:attribute:: QNORM_FIELD .. py:attribute:: UNORM_FIELD .. py:attribute:: WL_Q .. py:attribute:: WD_Q .. py:attribute:: WL_U .. py:attribute:: WD_U .. py:attribute:: T_WL_Q .. py:attribute:: T_WD_Q .. py:attribute:: T_WD_U .. py:method:: get_view(value) :classmethod: .. py:data:: VIEWS_SEDIMENTARY .. py:data:: VIEWS_COMPLEX .. py:data:: VIEWS_VECTOR_FIELD .. py:class:: Extractable_results Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.wolfresults_2D.Extractable_results :parts: 1 :private-bases: Generic enumeration. Derive from this class to define new enumerations. .. py:attribute:: H :value: () .. py:attribute:: Z :value: () .. py:attribute:: HEAD :value: () .. py:attribute:: FROUDE :value: () .. py:attribute:: VX :value: () .. py:attribute:: VY :value: () .. py:attribute:: V_NORM :value: () .. py:attribute:: QX :value: () .. py:attribute:: QY :value: () .. py:attribute:: TOP :value: () .. py:method:: get_from_key(key) :classmethod: .. py:method:: get_list() :classmethod: .. py:data:: ER_DIRECT_ACCESS .. py:class:: OneWolfResult(idx: int = 0, parent=None) Stockage des résultats d'un bloc de modèle WOLF2D .. py:property:: SelectionData :type: wolfhece.wolf_array.SelectionDataMB Return the data of the selection .. py:property:: sediment_diameter Diamètre des particules de sédiment [m] .. py:property:: sediment_density Densité des particules de sédiment [-] .. py:property:: current Vue courante .. py:property:: min_field_size .. py:method:: set_linkedvec(link: wolfhece.PyVertexvectors.vector) Set the linked vecteor -- used for masking outside the vector .. py:method:: set_epsilon(eps: float) Définit la valeur de l'epsilon pour le masquage des données. Toute valeur de waterdepth inférieure à eps sera masquée. see "filter_inundation" :param eps: valeur de l'epsilon .. py:method:: filter_inundation() Apply filter on array : - mask data below eps - mask data outisde linkedvec .. py:method:: filter_independent_zones(n_largest: int = 1) Apply filter on array : mask data outside n_largest independant zones .. py:method:: set_current(which: views_2D) Définition de la vue courante :param which: vue courante (voir enum views_2D) .. py:method:: set_opacity(alpha: float) Set the transparency of the array .. py:method:: get_norm_max() .. py:method:: update_zoom_2(newzoom) .. py:method:: update_zoom_vectorfield(factor) .. py:method:: update_arrowpixelsize_vectorfield(factor) .. py:method:: update_pal(curpal: wolfhece.PyPalette.wolfpalette, graypal=None, bluepal=None) Mise à jour de la palette :param curpal: palette courante :param graypal: palette grise :param bluepal: palette bleue .. py:method:: get_critdiam(which: int) -> wolfhece.wolf_array.WolfArray Calcul du dimètre critique :param which : 0 = Shields ; 1 = Izbach .. py:method:: get_u_shear() -> wolfhece.wolf_array.WolfArray Calcul de la vitesse de cisaillement .. py:method:: get_shieldsnumber() -> wolfhece.wolf_array.WolfArray Calcul du nombre de Shields .. py:method:: get_critsusp(which: int = 50) .. py:method:: plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None) Affichage des résultats .. py:method:: get_values_labels(i: int, j: int) Récupération des valeurs et labels pour affichage .. py:method:: delete_lists() Reset des listes OpenGL de la matrice/vue courante .. py:class:: Wolfresults_2D(fname: str = None, mold=None, eps=0.0, idx: str = '', plotted: bool = True, mapviewer=None, need_for_wx: bool = False, loader=None) Bases: :py:obj:`wolfhece.drawing_obj.Element_To_Draw` .. autoapi-inheritance-diagram:: wolfhece.wolfresults_2D.Wolfresults_2D :parts: 1 :private-bases: Manipulation des résultats d'un modèle WOLF2D en multiblocs La classe hérite de 'Element_To_Draw' afin d'être sûr de disposer des informations pour un éventuel affichage dans un viewer 'WolfMapViewer' ATTENTION : - la classe contient un dictionnaire 'myblocks' d'objets 'OneWolfResult' - les clés du dictionnaire sont de type 'block1', 'block2'... 'blockn' --> voir fonction 'getkeyblock' - les entrées ne sont PAS des matrices multiblocks 'WolfArrayMB' mais une classe 'OneWolfResult' contient plusieurs matrices pour chaque type de résultat (water depth, dischargeX, dischargeY, ...) - la classe se comporte donc un peu comme une généralisation d'une matrice 'WolfArrayMB' mais il ne s'agit pas d'une extension par polymorphisme - on retrouve cependant plusieurs routines similaires afin de faciliter l'intégration dans un viewer WX .. py:property:: all_dt .. py:property:: all_mostly_dry_mesh .. py:property:: all_clock_time .. py:property:: all_wet_meshes .. py:property:: SelectionData :type: wolfhece.wolf_array.SelectionDataMB Return the data of the selection .. py:property:: common_mask_MB :type: list[numpy.ndarray] Common mask for multiblock arrays .. py:property:: active_blocks :type: list[wolfhece.wolf_array.WolfArray] Return the active blocks .. py:property:: step_interval_results .. py:property:: nullvalue Get nullvalue from the first block .. py:property:: alpha .. py:property:: shading .. py:property:: altitudehill .. py:property:: azimuthhill .. py:property:: shaded .. py:property:: nb_blocks Nombre de blocs .. py:property:: sediment_diameter .. py:property:: sediment_density .. py:attribute:: myblocks :type: dict[str, OneWolfResult] .. py:attribute:: head_blocks :type: dict[str, wolfhece.wolf_array.header_wolf] .. py:attribute:: myparam :type: wolfhece.mesh2d.wolf2dprev.prev_parameters_simul .. py:attribute:: myblocfile :type: wolfhece.mesh2d.wolf2dprev.blocks_file .. py:attribute:: mymnap :type: wolfhece.wolf_array.WolfArrayMNAP .. py:method:: set_opacity(alpha: float) Set the transparency of the array .. py:method:: default16() Mise à jour de la palette par défaut .. py:method:: defaultblue() Mise à jour de la palette par défaut .. py:method:: defaultgrey() Mise à jour de la palette par défaut .. py:method:: get_bounds(abs=True) Return bounds in coordinates :param abs = if True, add translation to (x, y) (coordinate to global space) :return : tuple of two lists of two floats - ([xmin, xmax],[ymin, ymax]) .. py:method:: check_bounds_ij(i: int, j: int) Check if i and j are inside the array bounds .. py:method:: check_bounds_xy(x: float, y: float) Check if i and j are inside the array bounds .. py:method:: show_properties() Affichage des propriétés de la matrice .. py:method:: set_properties() Create : - Props_Res_2D (GUI) if mapviewer is not None .. py:method:: get_header(abs=True) -> wolfhece.wolf_array.header_wolf Récupération de l'entête de la matrice .. py:method:: as_WolfArray(copyarray: bool = True, force_mb=False) -> Union[wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArrayMB] Récupération d'une matrice MB ou Mono sur base du résultat courant :param copyarray : si True alors on copie les données :param force_mb : if True then return a WolfArrayMB even if there is only one block .. py:method:: load_default_colormap(which: str) Lecture d'une palette disponible dans le répertoire "models" .. py:method:: get_times_steps(nb: int = None) Récupération des temps réels et des pas de calcul de chaque résultat sur disque :param nb : nombre de résultats à lire - si None alors on lit tous les résultats :return : tuple (liste des temps, liste des pas de calcul) .. py:method:: find_minmax(update=False) Find spatial bounds .. py:method:: get_norm_max() Retourne la norme maximale du champ de débit ou de vitesse .. py:method:: update_zoom_2(newzoom) .. py:method:: update_zoom_factor() .. py:method:: update_arrowpixelsize_vectorfield(factor) .. py:method:: get_dxdy_min() Return the minimal size into blocks .. py:method:: get_dxdy_max() Return the maximal size into blocks .. py:method:: read_param_simul() Read simulation parameters from files .. py:method:: get_currentview() Return the current view .. py:method:: filter_inundation(eps: float = None, linkedvec: wolfhece.PyVertexvectors.vector = None) Apply filtering on array :param eps : mask data below eps :param linkedvec : mask data outside linkedvec .. py:method:: filter_independent_zones(n_largest: int = 1) Apply filtering on array .. py:method:: set_currentview(which=None, force_wx=False, force_updatepal: bool = False) Set the current view --> see 'views_2D' for supported values :param which : view to set :param force_wx : if True, a wx dialog will be shown to set the minimum size of the vector field :param force_updatepal : if True, the palette will be updated .. py:method:: allocate_ressources() Allocation de l'espace mémoire utile pour le stockage des résultats de chaque bloc .. py:method:: read_topography() Lecture de la topographie de modélisation .. py:method:: read_ini_mb() Lecture des conditions initiales .. py:method:: read_roughness_param() Lecture du frottement de modélisation .. py:method:: get_nbresults(force_update_timessteps=True) Récupération du nombre de pas sauvegardés --> utilisation de la librairie Fortran .. py:method:: read_oneblockresult_withoutmask(which_step: int = -1, whichblock: int = -1) Lecture d'un résultat pour un bloc spécifique --> utilisation de la librairie Fortran :param which_step : timestep ; 0-based; -1 == last one :param whichblock : block index .. py:method:: _read_oneblockresult_withoutmask_only_h(which_step: int = -1, whichblock: int = -1) Lecture d'un résultat pour un bloc spécifique --> utilisation de la librairie Fortran :param which_step : timestep ; 0-based; -1 == last one :param whichblock : block index .. py:method:: read_oneblockresult(which_step: int = -1, whichblock: int = -1) Lecture d'un résultat pour un bloc spécifique et application d'un masque sur base d'nu epsilon de hauteur d'eau which_step: result number to read ; 0-based; -1 == last one whichblock : block index ; 1-based .. py:method:: _read_oneblockresult_only_h(which_step: int = -1, whichblock: int = -1) Lecture d'un résultat pour un bloc spécifique et application d'un masque sur base d'nu epsilon de hauteur d'eau which_step: result number to read ; 0-based; -1 == last one whichblock : block index ; 1-based .. py:method:: read_oneresult(which: int = -1) Lecture d'un pas de sauvegarde :param which: result number to read; 0-based; -1 == last one .. py:method:: _read_oneresult_only_h(which: int = -1) Lecture d'un pas de sauvegarde :param which: result number to read; 0-based; -1 == last one .. py:method:: read_next() Lecture du pas suivant .. py:method:: _sanitize_result_step(which_step: int = -1) Sanitize result step index -- 0-based .. py:method:: _update_result_view() .. py:method:: set_hqxqy_as_initial_conditions(idx: int = None, as_multiblocks: bool = True) Set the result as IC :param idx : 0-based index .. py:method:: set_keps_as_initial_conditions(idx: int = None, as_multiblocks: bool = True) Set the turbulent result as IC :param idx : 0-based index .. py:method:: read_previous() Lecture du pas suivant .. py:method:: get_h_for_block(block: Union[int, str]) -> wolfhece.wolf_array.WolfArray Retourne la matrice de hauteur d'eau pour un bloc spécifique block : numéro du bloc; 1-based; .. py:method:: get_top_for_block(block: Union[int, str]) -> wolfhece.wolf_array.WolfArray Retourne la matrice de topographie pour un bloc spécifique block : numéro du bloc; 1-based; .. py:method:: get_qx_for_block(block: Union[int, str]) -> wolfhece.wolf_array.WolfArray Retourne la matrice de débit selon X pour un bloc spécifique block : numéro du bloc; 1-based; .. py:method:: get_qy_for_block(block: Union[int, str]) -> wolfhece.wolf_array.WolfArray Retourne la matrice de débit selon Y pour un bloc spécifique block : numéro du bloc; 1-based; .. py:method:: get_values_as_wolf(i: int, j: int, which_block: int = 1) Retourne les valeurs associées à des indices (i,j) et un numéro de block which_block : numéro du bloc; 1-based; *** ATTENTION : Les indices sont passés comme WOLF --> en numérotation Fortran (démarrage à 1 et non à 0) *** .. py:method:: get_values_turb_as_wolf(i: int, j: int, which_block: int = 1) Retourne les valeurs de turbulence associées à des indices (i,j) et un numéro de block which_block : numéro du bloc; 1-based; ATTENTION : Les indices sont passés comme WOLF --> en numérottaion Fortran (démarrage à 1 et non à 0) .. py:method:: get_header_block(which_block=1) -> wolfhece.wolf_array.header_wolf Obtention du header_wolf d'un block which_block : numéro du bloc; 1-based; .. py:method:: get_xy_infootprint_vect(myvect: wolfhece.PyVertexvectors.vector | shapely.geometry.Polygon, which_block=1) -> tuple[numpy.ndarray, numpy.ndarray] :return numpy array content les coordonnées (x,y) des mailles dans l'empreinte du vecteur .. py:method:: get_ij_infootprint_vect(myvect: wolfhece.PyVertexvectors.vector | shapely.geometry.Polygon, which_block=1) -> numpy.ndarray :returns: numpy array content les indices ij des mailles dans l'empreinte du vecteur .. py:method:: get_xy_inside_polygon(myvect: wolfhece.PyVertexvectors.vector | shapely.geometry.Polygon, usemask: bool = True, method: Literal[mpl, shapely] = 'shapely') Obtention des coordonnées contenues dans un polygone :param myvect: polygone :param usemask: restreint les éléments aux éléments non masqués de la matrice :param method: méthode de calcul ('mpl' == Matplotlib ou 'shapely') .. py:method:: get_xy_inside_polygon_mpl(myvect: wolfhece.PyVertexvectors.vector | shapely.geometry.Polygon, usemask: bool = True) Obtention des coordonnées contenues dans un polygone :param myvect: polygone :param usemask: restreint les éléments aux éléments non masqués de la matrice .. py:method:: get_xy_inside_polygon_shapely(myvect: wolfhece.PyVertexvectors.vector | shapely.geometry.Polygon, usemask: bool = True, strictly: bool = False) Obtention des coordonnées contenues dans un polygone :param usemask: restreint les éléments aux éléments non masqués de la matrice :param strictly: si True, les points sur le bord du polygone ne sont pas considérés comme à l'intérieur .. py:method:: get_xy_under_polyline(myvect: wolfhece.PyVertexvectors.vector) -> dict[str, (int, int)] Obtention des coordonnées (x,y) sous une polyligne avec séparation des points par bloc usemask = restreint les éléments aux éléments non masqués de la matrice .. py:method:: get_values_insidepoly(myvect: wolfhece.PyVertexvectors.vector | shapely.geometry.Polygon, usemask: bool = True, agglo: bool = True, getxy: bool = False, method: Literal[mpl, shapely] = 'mpl') Retourne les valeurs des mailles contenues dans un polygone Traite la matrice courante et l'altitude de fond si on est en vue 'views_2D.WATERLEVEL' :param myvect : polygone :param usemask (optional) restreint les éléments aux éléments non masqués de la matrice :param agglo (optional) agglomère le résultat en une seule liste plutôt que d'avoir autant de liste que de blocs :param getxy (optional) retourne en plus les coordonnées des points :return: valeurs, valeurs d'élévation, coordonnées des points (si getxy=True) .. py:method:: get_all_values_insidepoly(myvect: wolfhece.PyVertexvectors.vector, usemask: bool = True, agglo: bool = True, getxy: bool = False, method: Literal[mpl, shapely] = 'mpl') Récupération de toutes les valeurs dans un polygone :param myvect: polygone :param usemask: (optional) restreint les éléments aux éléments non masqués de la matrice :param agglo: (optional) agglomère le résultat en une seule liste plutôt que d'avoir autant de liste que de blocs :param getxy: (optional) retourne en plus les coordonnées des points :return: valeurs, coordonnées des points (si getxy=True) .. py:method:: get_all_values_underpoly(myvect: wolfhece.PyVertexvectors.vector, usemask: bool = True, agglo: bool = True, getxy: bool = False, integrate_q: bool = False) Récupération de toutes les valeurs sous la polyligne. Les valeurs retrounées sont identiques à la fonction "get_values_from_xy" soit (h,qx,qy,vx,vy,vabs,fr,h+top,top),(i+1,j+1,curblock.idx+1) :param myvect: polygone :param usemask :(optional) restreint les éléments aux éléments non masqués de la matrice :param getxy: (optional) retourne en plus les coordonnées des points :param agglo: (optional) agglomère le résultat en une seule liste plutôt que d'avoir autant de liste que de blocs :param integrate_q: (optional) pour intégrer les débits :return: valeurs, coordonnées des points (si getxy=True) .. py:method:: get_q_alongpoly(myvect: wolfhece.PyVertexvectors.vector, x_or_y: str = 'x', to_sum=True) alias .. py:method:: get_q_underpoly(myvect: wolfhece.PyVertexvectors.vector, x_or_y: str = 'x', to_sum=True) Récupération du débit sous un vecteur to_sum pour sommer les valeurs et multiplier par la taille de maille .. py:method:: get_q_alongpoly_with_neighbor(myvect: wolfhece.PyVertexvectors.vector, x_or_y: str = 'x', to_sum=True) Récupération du débit sous un vecteur mais uniquement si un voisin existe dans la direction d'intégration to_sum pour sommer les valeurs et multiplier par la taille de maille .. py:method:: get_q_alongpoly_raster_splitting(myvect: wolfhece.PyVertexvectors.vector, to_sum=True, to_rasterize=True) Récupération du débit sous un vecteur après avoir rasterisé selon les bords et appliqué le splitting WOLF aux flux Forcage préalable du vecteur slon la grille de calcul :param myvect : wolf polyline :param to_sum : pour sommer les valeurs et multiplier par la taille de maille :param to_rasterize : pour rasteriser le vecteur selon la grille de calcul .. py:method:: _plot_one_q(vect: wolfhece.PyVertexvectors.vector, x_or_y: str = 'x', absolute=True) -> float .. py:method:: _plot_one_q_raster_splitting(vect: wolfhece.PyVertexvectors.vector, absolute=True, to_rasterize=True) -> float .. py:method:: setup_cache(start_idx: int, end_idx: int = -1, only_h: bool = False) Setup cache for results #FIXME : not implemented for général 2D results -- just for GPU Defined here for compatibility .. py:method:: clear_cache() Clear cache #FIXME : not implemented for général 2D results -- just for GPU Defined here for compatibility .. py:method:: get_hydrographs(vect: Union[wolfhece.PyVertexvectors.vector, list[wolfhece.PyVertexvectors.vector], wolfhece.PyVertexvectors.zone], progress_callback=None) Get hydrograph across a vector :param vect: wolf polyline or list of wolf polylines or zone :param progress_callback: optional callback to update progress .. py:method:: export_hydrographs(vect: Union[wolfhece.PyVertexvectors.vector, list[wolfhece.PyVertexvectors.vector], wolfhece.PyVertexvectors.zone], filename: str | pathlib.Path, progress_callback=None) Export hydrograph across a vector as CSV file :param vect: wolf polyline or list of wolf polylines or zone :param filename: output filename :param progress_callback: optional callback to update progress .. py:method:: plot_q(vect: Union[wolfhece.PyVertexvectors.vector, list[wolfhece.PyVertexvectors.vector]], x_or_y: Union[str, list[str]] = 'border', toshow=False, absolute=True, figax=None) Plot discharge along vector :param vector : wolf polyline -- will be splitted according to spatial step size :param x_or_y : 'x' for qx, 'y' for qy - integration axis or 'border' for q normal at border :param toshow : show the plot :param absolute : plot absolute value of discharge :param figax : tuple of matplotlib figure and axis .. py:method:: plot_q_wx(vect: Union[wolfhece.PyVertexvectors.vector, list[wolfhece.PyVertexvectors.vector]], x_or_y: Union[str, list[str]] = 'border', toshow=False, absolute=True, fig: wolfhece.matplotlib_fig.Matplotlib_Figure = None) Plot discharge along vector :param vector : wolf polyline -- will be splitted according to spatial step size :param x_or_y : 'x' for qx, 'y' for qy - integration axis or 'border' for q normal at border :param toshow : show the plot :param absolute : plot absolute value of discharge :param figax : tuple of matplotlib figure and axis .. py:method:: get_values_xyorpoly_depr(xy: Union[list[float], wolfhece.PyVertexvectors.vector], h_or_z: Literal[h, z, head]) ** DEPRECATED : Will be removed in future version -- Please use get_values_xyorpoly instead ** Get water depth at one or multiple coordinates :param xy : list of coordinates :param h_or_z : 'h' for water depth, 'z' for bed elevation, 'head' for water head .. py:method:: plot_h(xy: Union[list[float], wolfhece.PyVertexvectors.vector], h_or_z: Literal[h, z, head], toshow=False, figax=None) **DEPRECATED : Will be removed in future version -- Please use plot_results_mpl instead** Plot water depth at one or multiple coordinates :param xy : list of coordinates :param h_or_z : 'h' for water depth, 'z' for bed elevation, 'head' for water head :param toshow : show the plot :param figax : tuple of matplotlib figure and axis .. py:method:: get_all_values_xyorpoly_series(xy: Union[list[float], wolfhece.PyVertexvectors.vector], for_steps: tuple[int] | list[int] = (0, -1, 1)) Get variables at one or multiple coordinates. :param xy : list of coordinates :param for_steps : tuple of start, end and step -- 0-based -- default is all steps (0,-1,1) :return: (times, steps), values -- numpy arrays .. py:method:: get_values_xyorpoly_series(xy: Union[list[float], wolfhece.PyVertexvectors.vector], which: Extractable_results, for_steps: tuple[int] | list[int] = (0, -1, 1)) Get water depth at one or multiple coordinates. :param xy : list of coordinates :param which : which results to plot -- see Extractable_results Enum :param for_steps : tuple of start, end and step -- 0-based -- default is all steps (0,-1,1) :return: (times, steps), values -- numpy arrays .. py:method:: plot_some_values(xy: Union[list[float], wolfhece.PyVertexvectors.vector], which: Extractable_results, toshow=False, figax=None, for_steps: tuple[int] | list[int] = (0, -1, 1), x_axis: Literal[time, step] = 'time') Plot some results at one or multiple coordinates defined by a vector or a list of coordinates or a polygon :param xy : list of coordinates or vector :param which : which results to plot -- see Extractable_results Enum :param toshow : show the plot :param figax : tuple of matplotlib figure and axis :param for_steps : tuple of start, end and step -- 0-based -- default is all steps (0,-1,1) .. py:method:: plot_violin_values(xy: Union[list[float], wolfhece.PyVertexvectors.vector], which: Extractable_results, toshow=False, figax=None, for_steps: tuple[int] | list[int] = (0, -1, 1), x_axis: Literal[time, step] = 'time') Plot some results at one or multiple coordinates defined by a vector or a list of coordinates or a polygon :param xy : list of coordinates or vector :param which : which results to plot -- see Extractable_results Enum :param toshow : show the plot :param figax : tuple of matplotlib figure and axis :param for_steps : tuple of start, end and step -- 0-based -- default is all steps (0,-1,1) .. py:method:: export_some_values_to_csv(xy: Union[list[float], wolfhece.PyVertexvectors.vector], which: Extractable_results, filename: str | pathlib.Path, for_steps: tuple[int] | list[int] = (0, -1, 1), erase_if_exists: bool = True, all_values: bool = GL_FRAGMENT_INTERPOLATION_OFFSET_BITS) Export some results at one or multiple coordinates defined by a vector or a list of coordinates or a polygon as CSV file .. py:method:: get_values_from_xy(x: float, y: float, aswolf: bool = True, integrate_q: bool = False) Retrouve les valeurs sur base de la coordonnée (x,y). Les valeurs retournées sont (h,qx,qy,vx,vy,vabs,fr,h+top,top), (i+1,j+1,curblock.idx+1) Si aucun résultat n'existe à l'emplacement souhaité, les valeurs sont (-1,-1,-1,-1,-1,-1,-1),('-','-','-') Le test de validité est basé sur la valeur de la hauteur d'eau strictement positive et topographie positive et non égale à 99999. :param x : coordonnée x :param y : coordonnée y :param aswolf : (optional) si True alors ajoute 1 à i et j pour se retrouver en numérotation VB6/Fortran :param integrate_q : (optional) si True alors intègre le débit sur la maille (multiplie par la taille de maille perpendiculaire au sens du débit) :return : tuple of values and indices .. py:method:: get_values_turb_from_xy(x: float, y: float, aswolf=True) Retrouve les valeurs de turbulence sur base de la coordonnée (x,y) aswolf : (optional) si True alors ajoute 1 à i et j pour se retrouver en numérotation VB6/Fortran .. py:method:: get_value(x: float, y: float, nullvalue=-1) Return the value of the current array at (X,Y) position :param x: x coordinate :param y: y coordinate :param nullvalue: value to return if no value is found .. py:method:: get_values_labels(x: float, y: float) Return the values and labels of the current view at (X,Y) position .. py:method:: get_value_elevation(x: float, y: float, nullvalue=-1) Return the value of the bed elevation at (X,Y) position .. py:method:: get_xy_from_ij(i: int, j: int, which_block: int = 1, aswolf: bool = False, abs: bool = True) Retourne les coordonnées (x,y) depuis les indices (i,j) et le numéro de block :param i: i index :param j: j index :param which_block: block number; 1-based; :param aswolf: True to add 1 to i and j to match the VB6/Fortran numbering format :param abs: True to return absolute coordinates .. py:method:: get_ij_from_xy(x: float, y: float, which_block: int = 1, aswolf=False, abs=True) Retrouve les indices d'un point (x,y) dans un bloc spécifique Utilise la routine du même nom dans la martrice 'waterdepth' :param x: x coordinate :param y: y coordinate :param which_block: block number; 1-based; :param aswolf: True to add 1 to i and j to match the VB6/Fortran numbering format :param abs: True to return absolute coordinates .. py:method:: _test_bounds_block(x: float, y: float, curblock: OneWolfResult) Teste les bornes d'un bloc versus les coordonnées (x,y) d'un point .. py:method:: enum_block_xy(x: float, y: float, aswolf=False, abs=True) Enumération des blocs contenant la coordonnée (x,y) aswolf : True ajoute 1 à i et j pour corresppondre au format de numérotation VB6/Fortran .. py:method:: get_blockij_from_xy(x: float, y: float, abs=True, aswolf=True) Retourne les indices i,j et le numéro du block depuis les coordonnées (x,y) aswolf : True ajoute 1 à i et j pour corresppondre au format de numérotation VB6/Fortran .. py:method:: check_plot() L'objet est coché/à traiter dans une fenêtre graphique 'WolfMapViewer' .. py:method:: uncheck_plot(unload=False) L'objet est décoché/pas à traiter dans une fenêtre graphique 'WolfMapViewer' .. py:method:: link_palette() Applique la même palette de couleur/colormap à tous les blocs .. py:method:: get_min_max(which: Literal[views_2D, views_2D, current]) Retourne la valeur min et max de la topo, de la hauteur d'eau ou de la matrice courante .. py:method:: get_working_array(onzoom=[]) Délimitation d'une portion de matrice sur base de bornes onzoom : Liste Python de type [xmin, xmax, ymin, ymax] .. py:method:: updatepalette(which=0, onzoom=[]) Mise à jour des palettes de couleur/colormaps palgray : niveaux de gris palblue : niveaux de bleu mypal : coloration paramétrique :param which: 0 :param onzoom: Liste Python de type [xmin, xmax, ymin, ymax] .. py:method:: delete_lists() Reset des listes OpenGL de la matrice courante .. py:method:: mimic_plotdata(plotting=False) Force la mise à jour de paramètres entre tous les blocs .. py:method:: plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None) Dessin OpenGL .. py:method:: fillonecellgrid(curscale, loci, locj, force=False) Dessin d'une fraction de la matrice pour tous les blocs .. py:method:: set_current(which) Change le type de résultat à présenter/traiter :param which: mode de visualisation --> see 'views_2D' for supported values .. py:method:: next_result() Lecture du pas suivant .. py:method:: reset_plot(whichpal=0) Reset du dessin .. py:method:: danger_map(start: int = 0, end: int = -1, every: int = 1, callback=None) -> Union[tuple[wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray], tuple[wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB]] Create Danger Maps :param start: start time step - 0-based :param end: end time step - 0-based :param every: step interval :param callback: optional callback to update progress :return : tuple of WolfArray or WolfArrayMB - H, U_norm, Q_norm, Z, Head .. py:method:: danger_map_multiprocess(start: int = 0, end: int = -1, every: int = 1, callback=None, nb_processors: int = -1) -> Union[tuple[wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray], tuple[wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB]] Create Danger Maps using multiprocessing :param start: start time step - 0-based :param end: end time step - 0-based :param every: step interval :param callback: optional callback to update progress .. py:method:: danger_map_only_h(start: int = 0, end: int = -1, every: int = 1) -> wolfhece.wolf_array.WolfArray Create Danger Maps :param start: start time step - 0-based :param end: end time step - 0-based :param every: step interval :return : tuple of WolfArray or WolfArrayMB - H, U_norm, Q_norm .. py:method:: export_as(outdir: str, fields: list[views_2D], which: Literal[geotiff, shape, numpy], multiband: bool = True) Export as geotiff or shapefile or numpy .. py:method:: export_as_shape(outdir: str = '', fn: str = '', myarrays: list[wolfhece.wolf_array.WolfArray] = [], descr: list[str] = [], mask: wolfhece.wolf_array.WolfArray = None) Export multiple arrays to shapefile :param outdir: output directory :param fn: filename -- .shp will be added if not present :param myarrays: list of Wolfarrays to export :param descr: list of descriptions :param mask: mask array -- export only where mask > 0 .. py:method:: export_as_geotif(outdir: str = '', fn: str = '', myarrays: list[wolfhece.wolf_array.WolfArray] = [], descr: list[str] = [], multiband: bool = True) Export results as geotiff :param outdir: output directory :param fn: filename -- .tif will be added if not present :param myarrays: list of Wolfarrays to export :param descr: list of descriptions -- Bands names .. py:method:: get_time_averaged_results(start: int = 0, end: int = -1, every: int = 1, time_averaging: bool = True, callback=None) -> Union[tuple[wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray, wolfhece.wolf_array.WolfArray], tuple[wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB, wolfhece.wolf_array.WolfArrayMB]] Get time averaged results (or simply, average over all saved indicies) :param start: start time step - 0-based :param end: end time step - 0-based :param every: step interval :param time_averaging: True -> Time-averaging, False -> Average over all saved indicies :param callback: optional callback to update progress :return : WolfArray - h, qx, qy