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
A wx.panel on which the matplolib figure is displayed.
- _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.
ax_cs_real: axis of the cross section plot (real profile)
ax_cs_anam: axis of the cross section plot (anamorphosed profile)
ax_img: axis of the image plot (satellite image)
ax_dis: axis of the discharge plot
ax_hsw: axis of the hydraulic section plot
- Returns:
tuple: (figure, ax_cs_real, ax_cs_anam, ax_img, ax_dis, ax_hsw)
- get_ax_real() matplotlib.axis.Axis[source]
This method returns the axis of the cross section plot (real profile).
- Returns:
ax_cs_real: axis of the cross section plot (real profile)
- get_ax_anamorphosed() matplotlib.axis.Axis[source]
This method returns the axis of the cross section plot (anamorphosed profile).
- Returns:
ax_cs_anam: axis of the cross section plot (anamorphosed profile)
- get_ax_image() matplotlib.axis.Axis[source]
This method returns the axis of the image plot (satellite image).
- Returns:
ax_img: axis of the image plot (satellite image)
- class wolfhece.GraphProfile.PlotCSAll(parent: wx.lib.agw.aui.AuiNotebook | None = None, id: int = -1, dpi: int = None, my_cross_sections: wolfhece.PyCrosssections.crosssections | None = None, my_profile: wolfhece.PyCrosssections.profile | None = None, **kwargs)[source]
Bases:
ProfilePanel
A class containing the necessary tools to draw the different graphs of a profile (Cross section).
- set_cs(my_profile: wolfhece.PyCrosssections.profile = None, vec: list[wolfhece.PyVertexvectors.vector] = [], Manning=0.04, plot=True) tuple[matplotlib.figure.Figure, matplotlib.axis.Axis, matplotlib.axis.Axis, matplotlib.axis.Axis, matplotlib.axis.Axis, matplotlib.axis.Axis][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.
- Parameters:
my_profile – profile, the profile to be displayed and modified
vec – list of vectors, the vectors to be displayed on the profile (ex: velocity vectors)
Manning – float, the Manning coefficient to be used for the computations of the hydraulic parameters
plot – bool, if True, the plots will be updated after setting the cross section. If False, the plots will not be updated (useful when setting a new profile and modifying it before updating the plots).
- update_UI(reset=True)[source]
Update the UI elements (sliders, text controls) according to the current profile and its parameters.
- Parameters:
reset – bool, if reset is True, the zones and copy of vertices are reset (useful when changing profile). If False, the zones and copy of vertices are not reset (useful when modifying the current profile without changing it).
- update_plots(update_image=False)[source]
Update all the plots of the figure. If update_image is True, the satellite image will be updated too (can be time consuming).
- 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 the Manning coefficient and update the Strickler coefficient accordingly. If a slope is given, it will be used for the computations of the hydraulic parameters, otherwise, the slope already defined in the class will be used.
- set_Strickler(kStrickler: float, slope: float = -99999)[source]
Set the Strickler coefficient and update the Manning coefficient accordingly. If a slope is given, it will be used for the computations of the hydraulic parameters, otherwise, the slope already defined in the class will be used.
- set_slope(newslope: float, nManning: float = -99999)[source]
Set the slope and update the hydraulic parameters accordingly. If a Manning coefficient is given, it will be used for the computations of the hydraulic parameters otherwise, the Manning coefficient already defined in the class will be used.
- 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)[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.
- 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.
- add_model(newsim: list)[source]
Add a new sim to the models list
- Parameters:
newsim – A list containing the model key (str), discharge (float), water depth (float), water level (float)
- modify_vertex()[source]
This method displays a new window containing the vertices of the active cross sections for modifications.
- 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.
- 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.
- 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_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.
- 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_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.
- class wolfhece.GraphProfile.DashboardCrossSection(*args, **kwargs)[source]
Bases:
PlotCSAll
This class contains the dashboard of the cross section interface. It inherits from PlotCSAll and contains the same methods and attributes. The dashboard is used to display the different graphs and tables of the cross section interface.
- class wolfhece.GraphProfile.windowsgrid(*args, callback=None, **kwargs)[source]
Bases:
wx.Frame
A class containing the different grids used for plotting the graphs.
- 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.
- class wolfhece.GraphProfile.ProfileNotebook(mapviewer=None, show=True, framesize=(1024, 768))[source]
Bases:
wx.Frame
Fenêtre contenant potentiellement plusieurs graphiques Matplotlib.
- 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 )
- curprofile: wolfhece.PyCrosssections.profile[source]