wolfhece.GraphProfile

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

class wolfhece.GraphProfile.ProfilePanel(parent, id=-1, dpi=None, toolbar=True, **kwargs)[source]

Bases: wx.Panel

Inheritance diagram of wolfhece.GraphProfile.ProfilePanel

A wx.panel on which the matplolib figure is displayed.

figure: matplotlib.figure.Figure[source]
add_ax()[source]

This methods creates the axes of the Matplolib figure either 3d or 2d (defaults = five 2D axes).

get_fig_ax() tuple[matplotlib.figure.Figure, matplotlib.axis.Axis, matplotlib.axis.Axis, matplotlib.axis.Axis, matplotlib.axis.Axis, matplotlib.axis.Axis][source]

This method returns the active axes of the matplotlib figure.

class wolfhece.GraphProfile.PlotCSAll(parent: wx.lib.agw.aui.AuiNotebook, id=-1, dpi=None, my_cross_sections: wolfhece.PyCrosssections.crosssections = None, my_profile: wolfhece.PyCrosssections.profile = None, **kwargs)[source]

Bases: ProfilePanel

Inheritance diagram of wolfhece.GraphProfile.PlotCSAll

A class containing the necessary tools to draw the different graphs of a profile (Cross section).

init_UI()[source]

Init UI if wx.app is running Otherwise –> return

set_cs(my_profile: wolfhece.PyCrosssections.profile = None, vec: list[wolfhece.PyVertexvectors.vector] = [], Manning=0.04, plot=True) None[source]

This function sets the cross section (profile of interest in the list of cross sections provided as vectors) and initialise the slider positions as well as the values displayed on the wx panel.

update_UI(reset=True)[source]
update_plots(update_image=False)[source]
mapviewer_activector()[source]

This methods activates and colors the active profile in wolfhece.pydraw ,and therefore, in the wolfpy GUI too.

set_Manning(nManning: float, slope: float = -99999)[source]
set_Strickler(kStrickler: float, slope: float = -99999)[source]
set_slope(newslope: float, nManning: float = -99999)[source]
compute_relations(event: wx.Event)[source]

This method computes the discharges based on a choosen friction coefficient (Manning or Strickler) and a slope. The computations are trigged by wx.Events (user’s inputs in txt ctrl).

cs_setter(mycross: wolfhece.PyCrosssections.crosssections = None, active_profile: wolfhece.PyCrosssections.profile = None, compare: wolfhece.PyCrosssections.profile = None, mapviewer=None, plot=True)[source]

This method sets simultaneously the cross section (mycross : parent) and the profile (active vector : child) active in wolf GUI or defined by the user. If no profile is given, the method returns the profile corresponding to the first key(string) in the cross section dictionary. Moreover, if a comparison profile (compare) is given, the methods sets that profile as the reference against which modifications on the active profile are compared.

jump_to_cs(event: wx.Event)[source]

Based on the user’s input, the method jumps to the selected profile in the cross section.

movegenslider(event: wx.Event)[source]

Using wx.Event, this methods moves (up or down, left or right) the whole river bed (banks and bed) displayed on the figure.

movebanksslider(event: wx.Event)[source]

This function updates a position of the river bank(left, bed, or right) based on the user’s entry(sliding a slider or input of a float value).

movewaterdepth(event: wx.Event)[source]

This method increases or decreases the water depth plotted on graphs.

movewaterlevel(event: wx.Event)[source]

This method increases or decreases the water level plotted on graphs.

movewaterdis(event: wx.Event)[source]

This method selects and plots a specific discharges in the GUI based on the user’s input.

plot_profile(figax: tuple[matplotlib.figure.Figure, matplotlib.axis.Axis] = None)[source]

This method plots the geometric profiles on the first and third graph. The third graph is anamorphosed to allow comparisons with other graphs using the same scale.

plot_discharge(figax: tuple[matplotlib.figure.Figure, matplotlib.axis.Axis] = None)[source]

This method plots the discharge relationships of the active profile on the 5th axis of the matplotlib figure.

plot_hspw(figax: tuple[matplotlib.figure.Figure, matplotlib.axis.Axis] = None)[source]

The methods plots the hydraulic radius - H, the wetted area - S, the wetted perimeter - P and top width - W on sixth axis and last graph of the figure.

plot_cs()[source]

This method plots 6 matplotlib graphs of the active profile. In order to do so, it uses the stored self graphs defined by other plotting methods. Storing the graphs avoid unnecessary repetitions of plots each time the method is called.

plot_up(event: wx.Event)[source]

This function plots the upstream’s cross section by upgrading the current cross section with the next upstream.

plot_down(event: wx.Event)[source]

This function plots the downstream’s cross section by upgrading the current cross section with the next downsrtream.

add_model(newsim)[source]

Add a new sim to the sims dictionnary

reset_models()[source]

Reset the sims dictionnary

simulations(event: wx.Event)[source]

This method displays on the profile and on the discharge graphs, the hydraulic characteristics in the numerical simulations. Also, it triggers a new window containing a table (grid) of the displayed values. FIXME add a plot method for 2D and 1D results.

_update_sims()[source]
modify_vertex()[source]

This method displays a new window containing the vertices of the active cross sections for modifications.

show_vertices(event: wx.Event)[source]
update_profile(event: wx.Event)[source]

This method allows the update of the profile plot - if the profile vertices are modified or - or if a structure is drawn (projected) on the profile.

_reset_profile_vertices()[source]
update_profile_from_sz(event: wx.Event)[source]

Mise à jour depuis un CpGrid

_update_profile_callback()[source]
project_zones_on_trace(new_zones: wolfhece.PyVertexvectors.Zones = None, reset_vec=True)[source]
add_vec(vec: wolfhece.PyVertexvectors.vector, reset_first=False)[source]

This method projects a vector on the profile traces and appends the projection to the list utilised to plot the structures.

populate_xy_from_sz()[source]

This method populate xy colum based on s and z entries.

add_zones(event: wx.Event)[source]

This method creates a new zones and displays its structure on the screen.

_update_drawings()[source]
_draw_on_profile(event: wx.Event)[source]

This method display a grid where vertor can be encoded and drawn on the figure.

get_copy_compare()[source]

This method creates a new panel containing a copy of the active profile.

harmonize_profiles()[source]

This method harmonizes the profiles characteristic (vertices). The method inserts missing vertices on both profiles to allow their comparison.

class wolfhece.GraphProfile.windowsgrid(*args, callback=None, **kwargs)[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.GraphProfile.windowsgrid

A class containing the different grids used for plotting the graphs.

_update_buttons()[source]
update_grid_vert(my_profile: wolfhece.PyCrosssections.profile, ref: wolfhece.PyCrosssections.profile = None, title: str = None, callback=None)[source]
set_grid_sz(my_profile: wolfhece.PyCrosssections.profile, ref: wolfhece.PyCrosssections.profile = None, title: str = None, callback=None)[source]
set_grid_vert(my_profile: wolfhece.PyCrosssections.profile, ref: wolfhece.PyCrosssections.profile = None, title: str = None, callback=None, call1=None, call2=None)[source]

This method displays a grid containing the active profile vertices. Also,the method contains a grid with the profile of reference for simultaneous insertion of vertices.

_evaluate_s()[source]

Compute and fill the s coordinates in the profile grid.

set_grid_sims(models, title: str = None, callback=None)[source]

This method displays a wx.grid containing the numerical models data.

get_vals_sims()[source]
Quit(event: wx.Event)[source]

This method closes the wx.Frame containing the grid.

class wolfhece.GraphProfile.ProfileNotebook(mapviewer=None, show=True, framesize=(1024, 768))[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.GraphProfile.ProfileNotebook

Fenêtre contenant potentiellement plusieurs graphiques Matplotlib.

OnClose(event)[source]

This method closes the notebook.

modify_cs(event)[source]

This method creates a new panel containing a copy of the active profile.

The copy is used to modify the profile and to compare the modifications with the original profile.

add(name='plot')[source]

Ajout d’un onglet au notebook L’onglet contient une Figure Matplotlib On retourne la figure du nouvel onglet

class wolfhece.GraphProfile.ProfileWithoutGUI(fcrossection='', fsupport='', format='')[source]

This class launches the notebook without passing through the wolfpy GUI.

Useful for scripts commands (an example is provide in )

plot_prof(index='', cross=None, active_vector=None)[source]

This method launches the notebook without any wolf GUI.