wolfhece.acceptability.acceptability_gui
Author: University of Liege, HECE Date: 2025
Copyright (c) 2025 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
- wolfhece.acceptability.acceptability_gui.nullvalue_for_hole(WA)[source]
Sets the null value for a WolfArray to 0 (as per the convention in the interpolation routine).
- wolfhece.acceptability.acceptability_gui.read_export_z_bin(fn_read, fn_write, fn_laststep)[source]
Reads the free surface altitude from a GPU simulation and exports it in binary format. Inputs:
fn_read_simu: the simulation file to read.
fn_laststep: the folder EXTRACTED_LAST_STEP defined in acceptability.
fn_write: the path to save the output in binary format.
- wolfhece.acceptability.acceptability_gui.riverbed_trace(fn_read_simu, fn_output, threshold)[source]
Recognizes the riverbed trace based on a simulation, where water depth above a given threshold is considered part of the riverbed. Inputs:
fn_read_simu: the simulation file to read.
fn_output: the location to save the riverbed trace as a .tiff file.
threshold: the water depth threshold above which the areas are considered riverbed.
- wolfhece.acceptability.acceptability_gui.empty_folder(folder)[source]
Empties the content of a directory if it exists.
- wolfhece.acceptability.acceptability_gui.mask_creation_data(mask_file, ground_file, output_file)[source]
- wolfhece.acceptability.acceptability_gui.MTN_And_mask_creation_all(fn_bathy, fn_mtn_cropped, fn_where_buildings, fn_mask_final)[source]
- wolfhece.acceptability.acceptability_gui.create_INPUT_TEMP_OUTPUT_forScenario(maindir, study_area, scenario, simu_gpu)[source]
Creates folder for a new study area or/and scenario. The last argument simu_gpu is used when loading simulation (indicates path to the simulation folder), if not used, indicate None to ignore it.
- wolfhece.acceptability.acceptability_gui.get_transform_and_crs(tif_file)[source]
For TIFF file manipulation, reads the CRS and the transform, and returns them.
- wolfhece.acceptability.acceptability_gui.create_shapefile_from_prop_tif(fn_tif, shapefile_path)[source]
Creates a shapefile of the study area based on the extent of an input TIFF file. Inputs:
fn_tif: the path to the input TIFF file.
shapefile_path: the location to save the output shapefile.
- wolfhece.acceptability.acceptability_gui.get_header_info(fn)[source]
Reads the headers from the file at path ‘fn’.
- wolfhece.acceptability.acceptability_gui.get_header_comparison(list_fn)[source]
Reads the headers from the files in list_fn and compares them. The result ‘comp’ is True if the headers are identical, and False otherwise.
- wolfhece.acceptability.acceptability_gui.display_info_header(self_dx, self_nbxy, self_O, fn)[source]
Displays the header at the path ‘fn’, and update the values displayed in the acceptability window.
- wolfhece.acceptability.acceptability_gui.update_info_header(self_dx, self_nbxy, self_O, fn)[source]
Upate the displayed header values by reading the simulations headers if exist.
- wolfhece.acceptability.acceptability_gui.search_for_modif_bath_and_copy(main_gpu, from_path, path_vuln)[source]
When loading gpu simulations for last step extraction, search for modified bath_ topography file, according to the structure coded in the scenarios manager. If they exist, their extent is copied to CHANGE_VULNE, called vuln_ and MNTmodifs_, to enable the user to modify it later. In addition, returns True if such files exist and False if they do not.
- wolfhece.acceptability.acceptability_gui.mapviewer_display(list_path)[source]
Load the output in the mapviewer on WOLF
- class wolfhece.acceptability.acceptability_gui.AcceptabilityGui(parent=None, width=1024, height=500)[source]
Bases:
wx.Frame
The main frame for the vulnerability/acceptability computation
Two options for the ‘Update Riverbed’ button: either the new riverbed trace file already exists and the user selects it, or it does not exist, and the user points to a no-overflow simulation, allowing the code to create the trace.
- OnHydrodynInput(e)[source]
A test to check if the FILLED water depths files exist. -If YES : the code can go on -If NO : either need to be computed, either the code will use the baseline ones
- OnLoadingSimu(e)[source]
Link between acceptability and simulations -Load a hydraulic scenarios from the scenario manager -Create scenario and study area if needed.
- OnDEM(e)[source]
Import and create the inputs for the interpolation routine holes.exe (name including ‘MNT_…’ and ‘MNT_…_with_mask’. See function MTN_And_mask_creation_all
- OnInterpolation(e)[source]
Interpolates the last extracted time steps present in LAST_STEP_EXTRACTED using the fast marching interpolation routine holes.exe, by creating a batch file while performing multiple checks on the required input files.
- OnToggle(e)[source]
Creates a toggle button to be activated if the scenarios vuln_ have to be taken into account.