:py:mod:`wolfhece.Model1D` ========================== .. py:module:: wolfhece.Model1D .. autoapi-nested-parse:: Author: HECE - University of Liege, Pierre Archambeau, Utashi Ciraane Docile 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:class:: Constants Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.Model1D.Constants :parts: 1 :private-bases: Constants used in this module. .. py:attribute:: BANK_WIDTH :value: 1 .. py:attribute:: CENTERED_TEXT .. py:attribute:: DPI :value: 60 .. py:attribute:: FRAMESIZE :value: (960, 540) .. py:attribute:: GENERAL_FONTSIZE :value: 'small' .. py:attribute:: GRAVITATION :value: 9.81 .. py:attribute:: NULL .. py:attribute:: PRECISION :value: ':#.20F' .. py:attribute:: SEPARATOR :value: '\t' .. py:attribute:: TRANSPARENCY_FLOOD :value: 1 .. py:attribute:: TRANSPARENCY_RIVER :value: 1 .. py:class:: Titles Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.Model1D.Titles :parts: 1 :private-bases: Titles used in this module. .. py:attribute:: BRANCH .. py:attribute:: WX .. py:class:: Colors Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.Model1D.Colors :parts: 1 :private-bases: Colors used in this module. .. py:attribute:: BED :value: 'black' .. py:attribute:: FLOODED_ALL :value: 'red' .. py:attribute:: FLOODED_LEFT :value: 'green' .. py:attribute:: FLOODED_RIGHT :value: 'yellow' .. py:attribute:: LEFT_BANK :value: 'red' .. py:attribute:: MATPLOTLIB_CYCLE .. py:attribute:: PROPOSED .. py:attribute:: RIGHT_BANK :value: 'blue' .. py:attribute:: RIVER_COLOR :value: 'cyan' .. py:attribute:: TQDM :value: 'cyan' .. py:attribute:: WX :value: 'white' .. py:class:: fileExtensions Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfhece.Model1D.fileExtensions :parts: 1 :private-bases: File extensions used in this module. .. py:attribute:: AINI :value: '.aini' .. py:attribute:: BANKS :value: '.banks' .. py:attribute:: BREADTH :value: '.breadth' .. py:attribute:: CL :value: '.cl' .. py:attribute:: CVG :value: '.cvg' .. py:attribute:: DEPTH :value: '.depth' .. py:attribute:: DIAM :value: '.diam' .. py:attribute:: GTV :value: '.gtv' .. py:attribute:: HELP :value: '.help' .. py:attribute:: HINI :value: '.hini' .. py:attribute:: INF :value: '.inf' .. py:attribute:: INFIL :value: '.infil' .. py:attribute:: LENGHTSVECZ :value: '_lengths.vecz' .. py:attribute:: LENGTHS :value: '.lengths' .. py:attribute:: PARAMETERS :value: '.param' .. py:attribute:: PTV :value: '.ptv' .. py:attribute:: QINI :value: '.qini' .. py:attribute:: ROUGHNESS :value: '.rough' .. py:attribute:: TOP :value: '.top' .. py:attribute:: VECTOR2D :value: '.vec' .. py:attribute:: VECTOR3D :value: '.vecz' .. py:attribute:: WIDTH :value: '' .. py:attribute:: ZINI :value: '.zini' .. py:class:: Creator_1D Class for the creation of 1D modelS. This object contains the methods operations performed in the creation of 1D models. They consist of the following operations: - Concatenation of information in 1 and 2 dimensions, - Extraction of information from 2D data if provided, - Creation of a 1D model (simulation). .. todo:: 1) FIXME Create unittests for methods in this class, .. todo:: 2) FIXME Fasten the methods in this class using multiprocess. .. py:method:: match_ends_2vectors(zones1: wolfhece.PyVertexvectors.Zones, zones2: wolfhece.PyVertexvectors.Zones, id1: int = 0, id2: int = 0) -> wolfhece.PyVertexvectors.Zones Aligns the vertices of 2 successive zone containing each 3 vectors (1 vector and its 2 parallels). The idea is to match the end of each vector with the beginning of its corresponding in the other zone. :param zones1: First vector, :type zones1: Zones :param zones2: Second vector, :type zones2: Zones :param id1: Position in `.myzones` of the zone containing the vectors, defaults to 0 :type id1: int, optional :param id2: Position in `.myzones` of the zone containing the vectors, defaults to 0 :type id2: int, optional :return: The 2 zones with the aligned vertices. :rtype: Zones .. py:method:: delete_overlaps_2vectors(zones1: wolfhece.PyVertexvectors.Zones, zones2: wolfhece.PyVertexvectors.Zones, id1: int = 0, id2: int = 0, buffer: int = None) -> wolfhece.PyVertexvectors.Zones Delete overlapping vertices of 2 successive Vectors, containng each 3 vectors (1 vector and its 2 parallels). :param zones1: First vector, :type zones1: Zones :param zones2: second vector, :type zones2: Zones :param id1: Position in `.myzones` of the zone containing the vectors, defaults to 0 :type id1: int, optional :param id2: Position in `.myzones` of the zone containing the vectors, defaults to 0 :type id2: int, optional :param buffer: number of vertices to process on each vector starting from the end of the vector (None means all vertices are processed), defaults to None :type buffer: int, optional :return: The vectors with the deleted overlaps. :rtype: Zones .. todo:: 1) FIXME Generalize the method to work with any number of vectors. .. todo:: 2) FIXME iS there a way to perform this operation geometrically with shapely line string? .. todo:: 3) FIXME Create unittests for this method. .. py:method:: connect_2vectors(zones1: wolfhece.PyVertexvectors.Zones, zones2: wolfhece.PyVertexvectors.Zones, id1: int = 0, id2: int = 0) -> wolfhece.PyVertexvectors.Zones Connect (link) 2 vectors extremity of 2 successive zones containing each 3 vectors (1 vectors and its 2 parallels) and, return a new zone with the concatenations. :param zones1: First vector :type zones1: Zones :param zones2: Second :type zones2: Zones :param id1: Position in .myzones of the zone containing the vectors, defaults to 0 :type id1: int, optional :param id2: Position in .myzones of the zone containing the vectors, defaults to 0 :type id2: int, optional :return: return a new vector which is the concatenation of the 2 first ones. :rtype: Zones .. py:method:: concatenate_2_zones(zones1: wolfhece.PyVertexvectors.Zones, zones2: wolfhece.PyVertexvectors.Zones, id1: int = 0, id2: int = 0, buffer: int = None, save_as: str = None) -> wolfhece.PyVertexvectors.Zones Return the concatenation of 2 vectors file (Zones) containing each 3 vectors (1 vector and its 2 parallels) after: - matching their ends, - deleting the overlaps and, - connecting the vectors. :param zones1: first vector :type zones1: Zones :param zones2: second vector :type zones2: Zones :param id1: Position in .myzones of the zone containing the vectors, defaults to 0 :type id1: int, optional :param id2: Position in .myzones of the zone containing the vectors, defaults to 0 :type id2: int, optional :param buffer: While deleting overlaps, this is the number of vertices to process on each vector starting from the end of the vector (None means all vertices are processed),defaults to None, defaults to None :type buffer: int, defaults to None :param save_as: File path of the new vector, defaults to None :type save_as: str, optional :return: _description_ :rtype: the vector containing the concatenation of the 2 first ones. .. py:method:: read_zones_paths(file_list: list[str]) -> list[wolfhece.PyVertexvectors.Zones] Return a list of vectors(`Zones`) objects, from a list of given file paths of vectors(`Zones`). :param file_list: List of file paths of vectors, :type file_list: list[str] :return: the list of vectors(`Zones`) objects. :rtype: list[Zones] .. py:method:: concatenate_listof_zones(file_list: list[str] = None, zones_list: list[wolfhece.PyVertexvectors.Zones] = None, id1: int = 0, id2: int = 0, buffer: int = None, save_as: str = None) -> wolfhece.PyVertexvectors.Zones Return a zones which is the concatenation of a sorted list of zones containing each 3 vectors (1 vector and its 2 parallels) after: - matching their ends, - deleting the overlaps and, - connecting the vectors. :param file_list: list of given file paths, defaults to None :type file_list: list[str], optional :param zones_list: vectors(`Zones`) objects, defaults to None :type zones_list: list[Zones], optional :param id1: Position in .myzones of the zone containing the vectors, defaults to 0 :type id1: int, optional :param id2: Position in .myzones of the zone containing the vectors, defaults to 0 :type id2: int, optional :param buffer: _description_, defaults to None :type buffer: While deleting overlaps, this is the number of vertices to process on each vector starting from the end of the vector (None means all vertices are processed),defaults to None :param save_as: _description_, defaults to None :type save_as: File path of the new vector, optional :raises Exception: With a GUI, to warn the user that the list of zones is missing. :raises Exception: Without GUI, to warn the user that the list of zones is missing. :return: A vector (Zones) containing the concatenation of all the vectors. :rtype: Zones .. py:method:: create_Zonesfromzones(zone_list: list[wolfhece.PyVertexvectors.zone], save_as: str = '') -> wolfhece.PyVertexvectors.Zones Return a vector (`Zones`) from a list of zones (`Zone`). :param zone_list: list of zones :type zone_list: list[zone] :param save_as: File path to the vector file, defaults to '' :type save_as: str, optional :return: The vector (`Zones`) containing the list of zones. :rtype: Zones .. py:method:: create_branches(zones_group: list[list[wolfhece.PyVertexvectors.Zones]], save_as: str = '') -> wolfhece.PyVertexvectors.Zones Create branches(`Zone`) from a list of vectors('Zones'). FIXME: This method is not used in the current version of the software. FIXME: It could be implemented in the future but with a dictionary instead of a list. :param zones_group: list of list of vectors per branch :type zones_group: list[list[Zones]] :param save_as: File path to the folder where the new information is saved, defaults to '' :type save_as: str, optional :return: Concatenation of all the branches(List of `Zones`) :rtype: Zones .. py:method:: create_branches_from_list_of_zones(zones_list: list[wolfhece.PyVertexvectors.Zones], id=1, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Generate branches from a list of vectors (`Zones`). The concept here is to loop on all vectors and then to add each zone contained in those vectors to a new zone that will be returned. FIXME: Remove Id from all methods and delete the parameter from the method signature. :param zones_list: List of vectors (`Zones`). :type zones_list: list[Zones] :param id: Depreciated, defaults to 1 :type id: int, optional :param save_as: File path to the new vector(`Vector`), defaults to '' :type save_as: str, optional :return: The new vector (`Zones`) containing all zones. :rtype: Zones .. py:method:: create_polygons(zones: wolfhece.PyVertexvectors.Zones, discretization: float = 1, howmanypoly: int = 1, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Return polygons created from parallels and vectors. :param zones: The vector ('Zones'), :type zones: Zones :param discretization: discretization steps between profiles, defaults to 1 :type discretization: float, optional :param howmanypoly: Number of polygons, defaults to 1 :type howmanypoly: int, optional :param save_as: Path to the new vector(`Vector`) file, defaults to '' :type save_as: str, optional :return: _description_ :rtype: Zones .. py:method:: create_branches_sections(zones: wolfhece.PyVertexvectors.Zones, discretization: float = 1, save_as='') -> wolfhece.PyVertexvectors.Zones Create sections on model skeleton (river branches) and return a Zones containing all sections per zone. :param zones: `Zones` containing the vectors :type zones: Zones :param discretization: Distance between sections, defaults to 1 :type discretization: float, optional :param save_as: File path where the new section are saved as vector, defaults to '' :type save_as: str, optional :return: `Zones` containing all sections. :rtype: Zones .. py:method:: create_river_sections(zones: wolfhece.PyVertexvectors.Zones, id: int = 0, discretization: float = 1, save_as: str = '', plot_check=False) -> wolfhece.PyVertexvectors.Zones From 2 parallels (river banks), a vector (river bed) and a discretization step this method generates and returns the corresponding profiles (river sections) as a Zones object. @The paralles and vectors shoulb stored in the same Zone and their index should follow this format: - 0: Left bank - 1: River bed - 2: Right bank :param zones: `Zones` containing the parallels :type zones: Zones :param id: index of the object `Zone` containing `vectors`, defaults to 0 :type id: int, optional :param discretization: Distance between sections, defaults to 1 :type discretization: float, optional :param save_as: File path of the new Zones , defaults to '' :type save_as: str, optional :param plot_check: if the results should be plotted or not, defaults to False :type plot_check: bool, optional :return: The new Zones containing the profiles (sections). :rtype: Zones .. todo:: 1) FIXME create a test for this method .. todo:: 2) FIXME Think about a faster way to create the profiles .. todo:: 3) FIXME Break this method into smaller methods .. py:method:: create_support_from_sections(sections: wolfhece.PyVertexvectors.Zones, save_as: str) -> wolfhece.PyVertexvectors.Zones Create supports from sections (midline). The supports are the midpoints of the sections. :param sections: `Zones` containing the sections :type sections: Zones :param save_as: File path of the new Zones, defaults to '' :type save_as: str, optional :return: The new Zones containing the supports. :rtype: Zones .. todo:: 1) FIXME create a test for this method .. todo:: 2) FIXME Think about a faster way to create the supports .. todo:: 3) FIXME could it replace the current method for the cration of bed in wolfpy? .. py:method:: save_only_vec(zones: wolfhece.PyVertexvectors.Zones, id: int = 1, id_vec: int = 1, save_as: str = '', format: str = '') -> wolfhece.PyVertexvectors.Zones Save only one vector from a Zones object. :param zones: `Zones` containing the vector :type zones: Zones :param id: Index of the zone containing the vector, defaults to 1 :type id: int, optional :param id_vec: Index of the vector in the zone, defaults to 1 :type id_vec: int, optional :param save_as: File path of the new vector, defaults to '' :type save_as: str, optional :param format: Format of the new vector, defaults to '' :type format: str, optional :return: The new Zones containing the vector. :rtype: Zones .. py:method:: refine_vector_from_2D(vect: wolfhece.PyVertexvectors.vector, discretization=1) -> list Refine a vector based on a given discretization step. Returns a python list. :param vect: Vector to refine :type vect: vector :param discretization: Discret :type discretization: float :return: List of points :rtype: list .. py:method:: remove_zone(zones: wolfhece.PyVertexvectors.Zones, id: int = 0) -> wolfhece.PyVertexvectors.Zones Remove a zone from a Zones object. :param zones: `Zones` containing the zone to remove :type zones: Zones :param id: Index of the zone to remove, defaults to 0 :type id: int, optional :return: The new Zones without the removed zone. :rtype: Zones .. py:method:: place_minimum_altitude(zones: wolfhece.PyVertexvectors.Zones, filename: str, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Return a Zones object in which all altitudes below a defined treshold for specific vectors (sections specified in a csv file) are raised to the new altitudes. :param zones: Zones object containing the vectors :type zones: Zones :param filename: .csv file containing the sections and their minimum altitudes, first column is the section name and second column is the minimum altitude. :type filename: str :param save_as: path to the the file where the modified Zones will be saved if no path is given the results is not saved but only returned , defaults to '' :type save_as: str, optional :return: New Zones object with the modified altitudes :rtype: Zones .. py:method:: change_minimum_altitude(zones: wolfhece.PyVertexvectors.Zones, filename: str, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Return a Zones object in which all altitudes below a defined treshold for specific vectors (sections specified in a csv file) are raised to the new altitudes. :param zones: Zones object containing the vectors :type zones: Zones :param filename: .csv file containing the sections and their minimum altitudes, first column is the section name and second column is the minimum altitude. :type filename: str :param save_as: path to the the file where the modified Zones will be saved if no path is given the results is not saved but only returned , defaults to '' :type save_as: str, optional :return: New Zones object with the modified altitudes :rtype: Zones .. py:method:: __change_minimum_altitude(zones: wolfhece.PyVertexvectors.Zones, filename: str, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Return a Zones object in which all altitudes below a defined treshold for specific vectors (sections specified in a csv file) are raised to the new altitudes. :param zones: Zones object containing the vectors :type zones: Zones :param filename: .csv file containing the sections and their minimum altitudes, first column is the section name and second column is the minimum altitude. :type filename: str :param save_as: path to the the file where the modified Zones will be saved if no path is given the results is not saved but only returned , defaults to '' :type save_as: str, optional :return: New Zones object with the modified altitudes :rtype: Zones .. py:method:: reverse_sense_zones(zones: wolfhece.PyVertexvectors.Zones, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Reverse the sense of the vectors in a Zones object. :param zones: Zones object containing the vectors :type zones: Zones :param save_as: path to the the file where the modified Zones will be saved if no path is given the results is not saved but only returned , defaults to '' :type save_as: str, optional :return: New Zones object with the reversed vectors :rtype: Zones .. py:method:: v_shape_cross_section(cross_sections: wolfhece.PyCrosssections.crosssections, profile_name: str, increment: float = None, zmax: float = None, save_as: str = '') -> wolfhece.PyCrosssections.crosssections Create a V shape profile from a given profile in a cross section object and return the new cross section object. .. py:method:: v_shape(prof: wolfhece.PyCrosssections.profile, increment=None, zmax=None) -> wolfhece.PyCrosssections.profile .. py:method:: transform_to_rectangular_shape(prof: wolfhece.PyCrosssections.profile, nb_vertices: int, zmin: float = None, zmax: float = None) .. py:method:: rectangular_shape_cross_section(cross_sections: wolfhece.PyCrosssections.crosssections, profile_name: str, nb_vertices: int, zmin: float = None, zmax: float = None, save_as: str = '') -> wolfhece.PyCrosssections.crosssections Create a rectangular shape profile from a given profile in a cross section object and return the new cross section object. .. py:method:: v_shape_vector(prof: wolfhece.PyVertexvectors.vector, increment=None, zmax=None) -> wolfhece.PyVertexvectors.vector .. py:method:: _v_shape(prof: wolfhece.PyCrosssections.profile, increment=None, zmax=None) -> wolfhece.PyCrosssections.profile .. py:method:: plot_zones(zones_list: list[wolfhece.PyVertexvectors.Zones], id: int = 0) -> None Plot the `vector` objecs in a list of `Zones` on a matplotlib figure. :param zones_list: List of vector files (`Zones`) :type zones_list: list[Zones] :param id: Index of the zone containing the vector object in all `Zones`, defaults to 0 :type id: int, optional .. todo:: 1) FIXME Add detailed information (legends, title, an so on) to the plot. .. todo:: 2) FIXME Think about a test for this method. could it be used in GUI? .. py:method:: plot_separated_zones(zones_list: list[wolfhece.PyVertexvectors.Zones], id: int = 0) -> None Plot each `vector`object ina list of `Zones` on a specific graph of a matplotlib figure. :param zones_list: _description_ :type zones_list: list[Zones] :param id: _description_, defaults to 0 :type id: int, optional .. todo:: 1) FIXME Add detailed information (legends, title, an so on) to the plot. .. todo:: 2) FIXME Think about a test for this method. could it be used in GUI? .. py:method:: plot_parallels_width(zones: wolfhece.PyVertexvectors.Zones, id: int = 0, discretization: float = 1, Figure_title: str = 'Width between vectors', ticks_spacing: int = 1000, fig_width=30, fig_height=10, color='red', linewidth=2, x_unit='$m$', y_unit='$m$') -> None Plot the distance between 2 parallels (for instance river width) as a function of their mid-vector length. - Id : zone index - The discretization step is chosen by the user. .. note:: The procedure is the following: - From the 3 vectors of the zone, the center vector is discretized based on the discretization step provided by the user (1 length unit by default). - The number of points is calculated as the length of the center vector divided by the discretization step. - The number of points selected is the smallest integer greater than the division result. - The newpoints are then projected on the left and right vectors. - The distance between the left and right vectors is then calculated, and plotted as a function of the distance along the center vector, after a postprocessing check using subtrings and vectors. :param zones: `Zones` object containing the vectors, :type zones: Zones :param id: Zones in which the vectors are stored, defaults to 0 :type id: int, optional :param discretization: After how many unit a disctance should be sampled, defaults to 1 :type discretization: float, optional :param Figure_title: Title to be displayed on the figure, defaults to '' :type Figure_title: str, optional :param ticks_spacing: Discretization of the x axis, defaults to 1000 :type ticks_spacing: int, optional .. note:: FIXME Should be an option in GUI and check whether the substring step is necessary. .. todo:: 1) FIXME Add detailed information (legends, title, an so on) to the plot. .. todo:: 2) FIXME Think about a test for this method. could it be used in GUI? .. py:method:: refine_array_by_2(array: wolfhece.wolf_array.WolfArray) -> wolfhece.wolf_array.WolfArray Return a remeshed WolfArray in which the cells size is divided by 2. :param array: WolfArray to refine :type array: WolfArray :return: Remeshed WolfArray :rtype: WolfArray .. py:method:: refine_array(array: wolfhece.wolf_array.WolfArray, discretize: int = 2) -> wolfhece.wolf_array.WolfArray Refine (divide) the cell size of a Wolfarray and return the new array. - @ The logarithm of discretize in base 2 must be an integer. :param array: WolfArray to refine :type array: WolfArray :param discretize: Discretization step, defaults to 2 :type discretize: int, optional :return: New WolfArray :rtype: WolfArray .. py:method:: concatenate_2_wolfarrays(array1: wolfhece.wolf_array.WolfArray, array2: wolfhece.wolf_array.WolfArray) -> wolfhece.wolf_array.WolfArray Return the concatenation of 2 WolfArrays. :param array1: First WolfArray :type array1: WolfArray :param array2: Second WolfArray :type array2: WolfArray :return: Concatenated WolfArray :rtype: WolfArray .. py:method:: merge_wolfarrays(arrays: list[wolfhece.wolf_array.WolfArray], save_as: str = '') -> wolfhece.wolf_array.WolfArray " Return a wolfArray which is the concatenation of the given list of WolfArrays. :param arrays: List of WolfArrays :type arrays: list[WolfArray] :param save_as: File path of the new WolfArray, defaults to '' :type save_as: str, optional :return: Concatenated WolfArray :rtype: WolfArray .. py:method:: new_array_from_vrt(array: wolfhece.wolf_array.WolfArray, vrt_file: str, file_out: str = '', wolfarray_not_tif=True, save: bool = True) -> wolfhece.wolf_array.WolfArray Return a new WolfArray extracted from a VRT file. - The new array is extracted based on the bounds of the given WolfArray. - the new array is either saved on `.tif` or bin `.format`. :param array: WolfArray from which the bounds are copied (mask) :type array: WolfArray :param vrt_file: file path to the VRT file from which the new array is extracted :type vrt_file: str :param file_out: File path of the new WolfArray, file_out is provided ('' by default) a folder of the mask (given array) is used to store the output under the same name as the previous but with a prefix `new_` added, defaults to '' :type file_out: str, optional :param load: If the new WolfArray should be loaded or not, defaults to True :type load: bool, optional :param wolfarray_not_tif: If the new WolfArray should be saved as a `.bin` file or `.tif` file, defaults to True :type wolfarray_not_tif: bool, optional :return: New WolfArray :rtype: WolfArray .. py:method:: get_arrays_from_vrt(arrays: list[wolfhece.wolf_array.WolfArray], vrt_file: str, wolfarray_not_tif=True, save=True) -> list[wolfhece.wolf_array.WolfArray] Return a list of WolfArrays extracted from a VRT file. - The new arrays are extracted based on the bounds of the given WolfArrays. - The new arrays are either saved on `.tif` or bin `.format`. ! The new arrays are saved in the same folder as the previous one. :param arrays: List of WolfArrays from which the bounds are copied (masks) :type arrays: list[WolfArray] :param vrt_file: file path to the VRT file from which the new arrays are extracted :type vrt_file: str :param wolfarray_not_tif: If the new WolfArrays should be saved as a `.bin` file or `.tif` file, defaults to True :type wolfarray_not_tif: bool, optional :return: List of new WolfArrays :rtype: list[WolfArray] .. py:method:: get_values_from_array(zones: wolfhece.PyVertexvectors.Zones, array: wolfhece.wolf_array.WolfArray, save_as: str, filter_null=False, selection=True, tif=False) -> wolfhece.PyVertexvectors.Zones Get the values from an array based on a given Zones (vectors), - In each zone, the vector are first refined based on the array cells size. - a new Zones with its vectors value filled is returned. :param zones: `Zones` containing the vectors :type zones: Zones :param array: `WolfArray` containing the values :type array: WolfArray :param save_as: File path of the new Zones, defaults to '' :type save_as: str, optional :param filter_null: If the null values should be filtered or not, defaults to False :type filter_null: bool, optional :param selection: If the values should be selected or not, defaults to True :type selection: bool, optional :param tif: If the array is a tif file or not, defaults to False :type tif: bool, optional :return: The new Zones with its vectors value filled. :rtype: Zones .. py:method:: update_z_value(znes: wolfhece.PyVertexvectors.Zones, array: wolfhece.wolf_array.WolfArray, save_as: str) -> wolfhece.PyVertexvectors.Zones Update the z value of the vertices in a Zones object based on the values of a WolfArray. :param znes: `Zones` containing the vectors :type znes: Zones :param array: `WolfArray` containing the values :type array: WolfArray :param save_as: File path of the new Zones, defaults to '' :type save_as: str, optional :return: The new Zones with updated z values. :rtype: Zones .. py:method:: save_as_1D_crossections(zones: wolfhece.PyVertexvectors.Zones, format='zones', save_as: str = '', return_list=True) -> list[wolfhece.PyCrosssections.crosssections] Save each `Zone` in `Zones` as a cross sections file and, return a list of cross sections. /!\ The `Zones` should contain the river sections to be transformed into cross sections. :param zones: `Zones` containing the vectors :type zones: Zones :param format: Format of the new cross sections file, defaults to 'zones' :type format: str, optional :param save_as: File path where the new cross sections are saved, defaults to '' :type save_as: str, optional :param return_list: If the method should return a list of cross sections or not, defaults to True :type return_list: bool, optional :return: List of cross sections :rtype: list[crosssections] .. py:method:: create_profiles(zones: wolfhece.PyVertexvectors.Zones, topo: wolfhece.wolf_array.WolfArray, discretization: int = 1, save_as: str = '', tif=False) -> wolfhece.PyVertexvectors.Zones Create profiles from river sections and topography. - The method creates the river sections from the `Zones` and discretization step. - It then creates the supports (midline vectors) from the sections. - It updates the z value of the supports based on the topography. - The method returns the profiles as a `Zones`. - The profiles are saved as a .vecz file. - The method also returns the profiles as a list of cross sections. :param zones: `Zones` containing the vectors :type zones: Zones :param topo: `WolfArray` containing the topography :type topo: WolfArray :param discretization: Distance between sections, defaults to 1 :type discretization: int, optional :param save_as: File path of the new Zones, defaults to '' :type save_as: str, optional :param tif: If the array is a tif file or not, defaults to False :type tif: bool, optional :return: The profiles as a Zones :rtype: Zones .. py:method:: sort_crossections_list(crosses: list[wolfhece.PyCrosssections.crosssections], zones: wolfhece.PyVertexvectors.Zones, vector_id: int = 1) -> list[list[wolfhece.PyCrosssections.profile]] This methods sort cross sections. - The method returns a list of list of profiles. - The profiles are sorted based on the given vectors in the `Zones`. :param crosses: List of cross sections :type crosses: list[crosssections] :param zones: `Zones` containing the vectors :type zones: Zones :param vector_id: Index of the vector in the zone, defaults to 1 :type vector_id: int, optional :return: List of list of profiles :rtype: list[list[profile]] .. py:method:: sort_all_cross_section_in_one_list(mycross: wolfhece.PyCrosssections.crosssections, zones: wolfhece.PyVertexvectors.Zones, id: int = 1) -> list Return all sorted profiles based on the given vectors in only one list. :param mycross: `crosssections` containing the profiles :type mycross: crosssections :param zones: `Zones` containing the vectors :type zones: Zones :param id: Index of the vector in the zone, defaults to 1 :type id: int, optional :return: List of all profiles sorted based on the given vector :rtype: list .. py:method:: get_sorted_cross_sections_name(mycross: wolfhece.PyCrosssections.crosssections, zones: wolfhece.PyVertexvectors.Zones, id: int = 1) -> list Return a list of names of all profiles sorted based on the given vector. :param mycross: `crosssections` containing the profiles :type mycross: crosssections :param zones: `Zones` containing the vectors :type zones: Zones :param id: Index of the vector in the zone, defaults to 1 :type id: int, optional :return: List of all profiles names sorted based on the given vector :rtype: list .. py:method:: get_sorted_cells_name(mycross: wolfhece.PyCrosssections.crosssections, zones: wolfhece.PyVertexvectors.Zones, id: int = 1) -> list Return a list of names of all profiles sorted based on the given vector. :param mycross: `crosssections` containing the profiles :type mycross: crosssections :param zones: `Zones` containing the vectors :type zones: Zones :param id: Index of the vector in the zone, defaults to 1 :type id: int, optional :return: List of all profiles names sorted based on the given vector :rtype: list .. py:method:: crossection_from_list(profiles: list[list[wolfhece.PyCrosssections.profile]], save_as: str = '') -> wolfhece.PyCrosssections.crosssections Create and return a cross section object `crosssections` from a list of profiles. :param profiles: List of profiles :type profiles: list[list[profile]] :param save_as: File path of the new cross section object, defaults to '' :type save_as: str, optional :return: New cross section :rtype: crosssections .. py:method:: add_2_crossections(crosssections1: wolfhece.PyCrosssections.crosssections, crosssections2: wolfhece.PyCrosssections.crosssections, prefixes: list[str, str] = ['1', '2'], save_as: str = '') -> wolfhece.PyCrosssections.crosssections Concatenate 2 cross sections and return the concatenation as a new cross section file. :param crosssections1: First cross section :type crosssections1: crosssections :param crosssections2: Second cross section :type crosssections2: crosssections :param prefixes: Prefixes for the cross sections, defaults to ["1","2"] :type prefixes: list[str,str], optional :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: New cross section :rtype: crosssections .. py:method:: create_Zones_from_vectors(vectors: list[wolfhece.PyVertexvectors.vector]) -> wolfhece.PyVertexvectors.Zones Return a Zones from a list of vectors. :param vectors: List of vectors :type vectors: list[vector] :return: New Zones :rtype: Zones .. py:method:: create_cross_sections_from_vectors(profiles: list[wolfhece.PyCrosssections.profile]) -> wolfhece.PyCrosssections.crosssections Create and Return a cross section object (`crosssections`) from a list of profiles. :param profiles: List of profiles :type profiles: list[profile] :return: New cross section :rtype: crosssections .. py:method:: extrapolate_extremities(crossections: wolfhece.PyCrosssections.crosssections, added_height: float = 0, save_as: str = '') -> wolfhece.PyCrosssections.crosssections Return a new cross section with the extremities of each profile extrapolated. :param crossections: `crosssections` containing the profiles :type crossections: crosssections :param added_height: Height to add to the extremities, defaults to 0 :type added_height: float, optional :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: New cross section with the extremities extrapolated :rtype: crosssections .. py:method:: delete_profile(mycross: wolfhece.PyCrosssections.crosssections, profile_keys: list, save_as: str = '') Return a new cross section file were the given profiles have been removed. - The profile keys are the names of the profiles to remove. :param mycross: `crosssections` containing the profiles :type mycross: crosssections :param profile_keys: List of profiles keys to remove :type profile_keys: list :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: New cross section with the given profiles removed :rtype: crosssections .. py:method:: roughness_from_polygons(array: wolfhece.wolf_array.WolfArray, zones: wolfhece.PyVertexvectors.Zones, mode: Literal[mean, median, min, max, Creator_1D.roughness_from_polygons.value] = 'mean', value: float = 0.04) -> list[list[float]] Associate a roughness (friction) value to each cross section. The value is selected from the 2D cells in between the cross section of interest and the next one, according to the chosen mode and the polygon file `Zones`. The different modes are: - mean, - median, - min, - max, - value. If value is selected, the given value is forced on all crossections. :param array: WolfArray containing the values :type array: WolfArray :param zones: Zones containing the vectors :type zones: Zones :param mode: Mode to select the roughness value, defaults to 'mean' :type mode: typing.Literal['mean', 'median', 'min', 'max', 'value'], optional :param value: Value to force, defaults to 0.04 :type value: float, optional :return: List of lists of roughnesses value :rtype: list[list[float]] .. py:method:: roughness_from_profiles(array: wolfhece.wolf_array.WolfArray, crosses: list[list[wolfhece.PyCrosssections.profile]], mode: Literal[mean, median, min, max, Creator_1D.roughness_from_profiles.value] = 'mean', value: float = 0.04) -> list[list[float]] Associate a roughness (friction) value to each cross section. The value is selected from the cells under the cross section of interest according to the chosen mode. The different modes are: - mean, - median, - min, - max, - value. If value is selected, the given value is forced on all crossections. :param array: WolfArray containing the values :type array: WolfArray :param crosses: List of cross sections :type crosses: list[list[profile]] :param mode: Mode to select the roughness value, defaults to 'mean' :type mode: typing.Literal['mean', 'median', 'min', 'max', 'value'], optional :param value: Value to force, defaults to 0.04 :type value: float, optional :return: List of lists of roughnesses value :rtype: list[list[float]] .. py:method:: roughness_from_value(crosses: list[list[wolfhece.PyCrosssections.profile]], value: float = 0.04) -> list[list[float]] Return a list of lists of roughnesses value. The method forces the given value on all crossections. :param crosses: List of cross sections :type crosses: list[list[profile]] :param value: Value to force, defaults to 0.04 :type value: float, optional :return: List of lists of roughnesses value :rtype: list[list[float]] .. py:method:: ic_relations_hspw(crosses: list[list[wolfhece.PyCrosssections.profile]], h: float = None, zval: float = None) -> numpy.ndarray Return the HSPW relations (Initial Conditions) of all profiles as a numpy arrray for a given water depth or a given altitude. np.array :param crosses: List of cross sections :type crosses: list[list[profile]] :param h: Water depth, defaults to None :type h: float, optional :param zval: Altitude, defaults to None :type zval: float, optional :return: HSPW relations (Initial Conditions) of all profiles :rtype: np.ndarray .. py:method:: plot_graph_crossections(mycross: wolfhece.PyCrosssections.crosssections, vect: wolfhece.PyVertexvectors.vector = None, profile_name=1, width=30, height=15) Return a graph on the GraphNotebook format. The graph contains the profile characteristics (Spatial location, sections, discharges relations, HSPW relations, etc.). :param mycross: `crosssections` containing the profiles :type mycross: crosssections :param vect: `vector` containing the profiles in case the profiles should be sorted, defaults to None :type vect: vector, optional :param profile_name: Index of the profile, defaults to 1 :type profile_name: int, optional :return: Figure containing a plot of the profile charactersitics. :rtype: Figure .. py:method:: create_directory(save_as: str, directory_name: str) -> str Creates and return a directory based on the inputs: - save_as: a computer path and, - directory_name: a desired directory name. :param save_as: Computer path :type save_as: str :param directory_name: Desired directory name :type directory_name: str :return: Directory path :rtype: str .. py:method:: create_simulation_directory(save_as: str, directory_name: str = 'simul') -> str Create and return a simulation directory. :param save_as: Computer path :type save_as: str :param directory_name: Desired directory name :type directory_name: str :return: Simulation directory :rtype: str .. py:method:: initialize_file(save_as: str, format: str, directory_name: str = 'simul') -> str Create a new file based on: - The provided directory or self.directory and, - the given extension. :param save_as: Computer path :type save_as: str :param format: File extension :type format: str :param directory_name: Desired directory name, defaults to 'simul' :type directory_name: str, optional :return: File path :rtype: str .. py:method:: count_lists_in_list(lst: list[list], nodes_1D=False) -> int Return the sum of lengths of lists in a list. - /!\ Attention for 1D nodes (nodes_1D), the number of nodes is the number of crossections minus one. :param lst: List of lists :type lst: list[list] :param nodes_1D: If the nodes are 1D, defaults to False :type nodes_1D: bool, optional :return: Sum of lengths of lists in a list :rtype: int .. py:method:: write_file_from_listof_profiles(file: str, data: list[list[wolfhece.PyCrosssections.profile]], index: list[int], force_last=False) -> None Writer of a file from a list of profiles. Wolf Template for writing file based on a list of profiles. #FIXME ackward method :param file: File path :type file: str :param data: List of profiles :type data: list[list[profile]] :param index: Index of the profiles :type index: list[int] :param force_last: If the last profile should be forced, defaults to False :type force_last: bool, optional :return: None :rtype: None .. py:method:: _write_relations_profiles(crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) -> None /!\ Has been deprecated. - Write the HSPW (Heigh, wetted Section, wetted Perimeter, top Width)relations of each profile in each cross section as a file; - Write one corresponding .ptv file (matches profile index to the corresponding profile number); - Write one corresponding .gtv file (maches profile number to the correponding relation files). :param crosses: List of cross sections :type crosses: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: __write_relations_profiles(crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) -> None /!\ Has been deprecated. - Write the HSPW (Height, wetted Section, wetted Perimeter, top Width)relations of each profile in each cross section as a file; - Write one corresponding .ptv file (matches profile index to the corresponding profile number); - Write one corresponding .gtv file (maches profile number to the correponding relation files). .. py:method:: write_relations_profiles(crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) -> None - Write the HSPW (Heigh, wetted Section, wetted Perimeter, top Width)relations of each profile in each cross section as a file; - Write one corresponding .ptv file (matches profile index to the corresponding profile number); - Write one corresponding .gtv file (maches profile number to the correponding relation files). :param crosses: List of cross sections :type crosses: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: None :rtype: None .. todo:: FIXME make robust tests for all cases .. py:method:: write_banks_file(crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) -> list[list[wolfhece.PyCrosssections.profile]] write banks (.banks) file in the given directory. - if a directory is not provided, a file named simul.banks is created. :param crosses: List of cross sections :type crosses: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: List of cross sections :rtype: list[list[profile]] .. py:method:: write_file_from_np_array(file: str, data: numpy.ndarray, index: list[int], desc='Writing:', force_last=False, q: float = 0.0, nb_updates: int = 0) -> None Write a file from a numpy array. Wolf Template for writing file based on a numpy array. :param file: File path :type file: str :param data: Numpy array :type data: np.ndarray :param index: Index of the array :type index: list[int] :param desc: Description, defaults to 'Writing:' :type desc: str, optional :param force_last: If the last value should be forced, defaults to False :type force_last: bool, optional :param q: Discharge, defaults to 0. :type q: float, optional :param nb_updates: Number of updates, defaults to 0 :type nb_updates: int, optional :return: None :rtype: None .. py:method:: write_ini_files(ic: numpy.ndarray, save_as: str, q: float = None, nb_updates: int = 0, file_choice: list[str] = ['.hini', '.zini', '.aini']) -> None Write all the intial condition files (.aini, .zini, .hini), - if a discharge (q) is provided, .qini is also writen. :param ic: Initial conditions :type ic: np.ndarray :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param q: Discharge, defaults to None :type q: float, optional :param nb_updates: Number of updates, defaults to 0 :type nb_updates: int, optional :param file_choice: List of file extensions, defaults to ['.hini', '.zini', '.aini'] :type file_choice: list[str], optional :return: None :rtype: None .. py:method:: write_lengthsvecz_file(crosses: list[list[wolfhece.PyCrosssections.profile]], discretization: float, save_as: str) -> wolfhece.PyVertexvectors.Zones Write the length vecz file. The file is mainly use for plotting purposes. :param crosses: List of cross sections :type crosses: list[list[profile]] :param discretization: Discret :type discretization: float :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: Zones :rtype: Zones .. py:method:: delete_line_in_txt_file(file_path: str, line_to_delete: str) Delete a known line in a text file. :param file_path: File path :type file_path: str :param line_to_delete: Line to delete :type line_to_delete: str .. py:method:: write_line_in_txt_file(file_path: str, line_to_write: str) Write a line in a text file. :param file_path: File path :type file_path: str :param line_to_write: Line to write :type line_to_write: str .. py:method:: correct_parameters(directory='', from_steady=False) Correct the parameters files by deleting the line 'Limiteur 7' in the .param file and 'Limiteur 7 Type de limitation des reconstruction en lineaire (integer1)' in the .param.default file. :param directory: Directory path, defaults to '' :type directory: str, optional .. note:: FIXME delete from_steady arguments wherever it's still implemented in this module. .. py:method:: write_parameters(save_as: str, max_iter: int = 100000000, max_time: float = 255600.0, round_time: float = 0.0, local_time_step: int = 0, start_time: float = 0.0, write_freq: int = 3600, write_type: int = 2, reconstruction: int = 1, rk_model: int = 2, rk_coeff: float = 0.5, courant_number: float = 0.25, froude_max: float = 20, friction_law: int = 3, Verbosity: int = 1) -> None Write the file containing the simulation parameters of a wolf 1D model. .. note:: with the implementation of Pyparams object in the Wolf module, this method is deprecating. :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param max_iter: Maximum iteration, defaults to 100000000 :type max_iter: int, optional :param max_time: Maximum time, defaults to 255600.0 :type max_time: float, optional :param round_time: Round time, defaults to 0.00000000000000000000e-02 :type round_time: float, optional :param local_time_step: Local time step, defaults to 0 :type local_time_step: int, optional :param start_time: Start time, defaults to 0.00000000000000000000e-02 :type start_time: float, optional :param write_freq: Write frequency, defaults to 3600 :type write_freq: int, optional :param write_type: Write type, defaults to 2 :type write_type: int, optional :param reconstruction: Reconstruction, defaults to 1 :type reconstruction: int, optional :param rk_model: RK model, defaults to 2 :type rk_model: int, optional :param rk_coeff: RK coefficient, defaults to 0.5 :type rk_coeff: float, optional :param courant_number: Courant number, defaults to 0.25 :type courant_number: float, optional :param froude_max: Froude max, defaults to 20 :type froude_max: float, optional :param friction_law: Friction law, defaults to 3 :type friction_law: int, optional :param Verbosity: Verbosity, defaults to 1 :type Verbosity: int, optional .. py:method:: _read_hydrograph_from_textfile(file: str) -> list[list[list, list]] Read a hydrograph from a text file. :param file: File path :type file: str :return: Hydrograph :rtype: list[list[list,list]] .. py:method:: _write_infiltrations(selected_profiles: list[str], crosses: list[list[wolfhece.PyCrosssections.profile]], hydrographs: list[list[list, list]], save_as: str, writing_method: Literal[continuous, stepwise] = 'continuous', epsilon: float = 0.01) Write the infiltration files (.inf, .infil, .tv). - if a writing method is not provided, the default is continuous. .. note:: FIXME a dict combining hydrographs and selected profiles could be more useful. :param selected_profiles: Selected profiles :type selected_profiles: list[str] :param crosses: List of cross sections :type crosses: list[list[profile]] :param hydrographs: Hydrographs :type hydrographs: list[list[list,list]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param writing_method: Writing method, defaults to 'continuous' :type writing_method: Literal['continuous', 'stepwise'], optional :param epsilon: Epsilon, defaults to 0.01 :type epsilon: float, optional .. py:method:: read_hydrograph_from_textfile(file: str) -> list[list[list, list]] Return a hydrograph from a text file. /!\ The file should be on the wolf hydrograph format. :param file: File path :type file: str :return: Hydrograph :rtype: list[list[list,list]] .. py:method:: write_infiltrations_from_dict(crosses: list[list[wolfhece.PyCrosssections.profile]], hydrographs: dict[str, Union[wolfhece.PyHydrographs.Hydrograph, list, tuple]], save_as: str, writing_method: Literal[continuous, stepwise] = 'continuous', epsilon: float = 0.01) Write the infiltration files (.inf, .infil, .tv). .. note:: FIXME a dict combining hydrographs and selected profiles could be more useful. :param crosses: List of cross sections :type crosses: list[list[profile]] :param hydrographs: Hydrographs :type hydrographs: dict[str, Union[Hydrograph, list,tuple]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param writing_method: Writing method, defaults to 'continuous' :type writing_method: Literal['continuous', 'stepwise'], optional :param epsilon: Epsilon, defaults to 0.01 :type epsilon: float, optional .. py:method:: write_infiltrations(selected_profiles: list[str], crosses: list[list[wolfhece.PyCrosssections.profile]], hydrographs: Union[list[wolfhece.PyHydrographs.Hydrograph], list[list[list, list]]], save_as: str, writing_method: Literal[continuous, stepwise] = 'continuous', epsilon: float = 0.01) - Write the infiltration files (.inf, .infil, .tv) and, - Apply the preprocessing mode to the hydrographs before writing them. /!\ if a writing method is not provided, the default is continuous. :param selected_profiles: Selected profiles :type selected_profiles: list[str] :param crosses: List of cross sections :type crosses: list[list[profile]] :param hydrographs: Hydrographs :type hydrographs: Union[list[Hydrograph], list[list[list,list]]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param writing_method: Writing method, defaults to 'continuous' :type writing_method: Literal['continuous', 'stepwise'], optional :param epsilon: Epsilon, defaults to 0.01 :type epsilon: float, optional .. py:method:: select_one_profile(profile_name: str, crosses: list[list[wolfhece.PyCrosssections.profile]]) -> list[int, int, int] Return the selected profile. :raise: if the profile is not found, an exception is raised. :param profile_name: Profile name :type profile_name: str :param crosses: List of cross sections :type crosses: list[list[profile]] :return: Selected profile :rtype: list[int,int,int] .. py:method:: select_profiles(profiles_names: list[str], crosses: list[wolfhece.PyCrosssections.profile]) -> list[list[int, int, int]] Return a list of lists containing the respective indices of the selected profiles. :param profiles_names: Profiles names :type profiles_names: list[str] :param crosses: List of cross sections :type crosses: list[profile] :return: Selected profiles :rtype: list[list[int, int,int]] .. py:method:: write_cvg_file(selected_profiles: list[str], crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) -> None Specify the node for the code verbosity in the shell (.cvg_file). .. note:: with the implementation of Pyparams object in the Wolf module, this method is deprecating. :param selected_profiles: Selected profiles :type selected_profiles: list[str] :param crosses: List of cross sections :type crosses: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: write_cvgn_file(selected_profiles: list[str], crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) Write the file for Code verbosity on nodes (cvgn.file). .. note:: with the implementation of Pyparams object in the Wolf module, this method is deprecating. :param selected_profiles: Selected profiles :type selected_profiles: list[str] :param crosses: List of cross sections :type crosses: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: write_vector_files(cross: list[list[wolfhece.PyCrosssections.profile]], save_as: str, banksbed: wolfhece.PyVertexvectors.Zones = None, which_type: Literal[vec, vecz, both] = 'both') Write 3 vectors files. - A 3D vector connecting all profiles bed in each zone, - A 2D vector connecting all profiles bed in each zone, - A length file (for plotting purpose) :param cross: List of cross sections :type cross: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param banksbed: Banks and bed, defaults to None :type banksbed: Zones, optional :param which_type: Which type, defaults to 'both' :type which_type: Literal['vec','vecz','both'], optional :return: Zones :rtype: Zones .. py:method:: set_banksbed_vertex_from_ls(prof: wolfhece.PyCrosssections.profile, ls: tuple[shapely.ops.LineString]) Set the banks and bed from a LineString. :param prof: Profile :type prof: profile :param ls: LineString :type ls: tuple[LineString] .. py:method:: set_banksbed_vectors(zones: wolfhece.PyVertexvectors.Zones) -> tuple[shapely.ops.LineString] Set the banks and bed from a Zones. :param zones: Zones :type zones: Zones :return: tuple[LineString] :rtype: tuple[LineString] .. py:method:: find_banksbed(prof: wolfhece.PyCrosssections.profile, banks: wolfhece.PyVertexvectors.Zones) Find the banks and bed (`vector`) from a profile (`profile`) and a Zones. The banks and bed points are the intersection between the profile and the bed and banks . :param prof: Profile :type prof: profile :param banks: Banks :type banks: Zones .. py:method:: write_lengths_file(crosses: list[list[wolfhece.PyCrosssections.profile]], discretization: float, save_as: str) -> None Write the lengths file `.lengths` of a 1D model. :param crosses: List of cross sections :type crosses: list[list[profile]] :param discretization: Discretization :type discretization: float :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: write_roughnesses(roughnesses: list[list[float]], save_as) -> None Write the roughnesses file `.rough` of 1D model. :param roughnesses: Roughnesses :type roughnesses: list[list[float]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: save_sorted_crosssesctions(sorted_cross: list[list[wolfhece.PyCrosssections.profile]], save_as: str) Save the sorted cross sections. :param sorted_cross: Sorted cross sections :type sorted_cross: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: test_intersection_linestring_and_profile(ls: shapely.ops.LineString, prof: wolfhece.PyCrosssections.profile) Test the intersection between a LineString and a profile. :param ls: LineString :type ls: LineString :param prof: Profile :type prof: profile :return: True if there is no intersection, False otherwise :rtype: bool .. py:method:: delete_intesections_profile_vectors(cross_sections: wolfhece.PyCrosssections.crosssections, zones: wolfhece.PyVertexvectors.Zones, save_as: str = '', id_zone=0) -> wolfhece.PyCrosssections.crosssections Delete the profiles in cross-sections file that are intersecting the vectors contained in a Zones. :param cross_sections: Cross sections :type cross_sections: crosssections :param zones: Zones :type zones: Zones :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param id_zone: Id of the zone, defaults to 0 :type id_zone: int, optional .. py:method:: create_profile_from_vector(vect: wolfhece.PyVertexvectors.vector, topo_array: wolfhece.wolf_array.WolfArray) -> wolfhece.PyCrosssections.profile Create a new profile from a vector and a topographic array. :param vect: Vector :type vect: vector :param topo_array: Topography array :type topo_array: WolfArray :return: Profile :rtype: profile .. py:method:: insert_profiles_from_2D_zones(cross_sections: wolfhece.PyCrosssections.crosssections, zones: wolfhece.PyVertexvectors.Zones, topo_array: wolfhece.wolf_array.WolfArray, save_as='') -> wolfhece.PyCrosssections.crosssections Concatenate a `Zones` of 2D vectors to a `crosssections` file and return a new `crosssections` file as the result of the concatenation. :param cross_sections: Cross sections :type cross_sections: crosssections :param zones: Zones :type zones: Zones :param topo_array: Topography array :type topo_array: WolfArray :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: Cross sections :rtype: crosssections .. py:method:: insert_cross_sections_from_zones(cross_sections: wolfhece.PyCrosssections.crosssections, zones: wolfhece.PyVertexvectors.Zones, topo_array: wolfhece.wolf_array.WolfArray, save_as='') -> wolfhece.PyCrosssections.crosssections Concatenate a `Zones` of 2D vectors to a `crosssections` file after deleting the profiles that are intersecting the vectors contained in the `Zones`. Return a new `crosssections` file which is the result of the concatenation. :param cross_sections: Cross sections :type cross_sections: crosssections :param zones: Zones :type zones: Zones :param topo_array: Topography array :type topo_array: WolfArray :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: Cross sections :rtype: crosssections .. py:method:: extend_parallels(vect: wolfhece.PyVertexvectors.vector, left_distance: float, right_distance: float, save_as: str = '') -> wolfhece.PyVertexvectors.Zones Extend the distance between parallels of a vector and return a new `Zones` file. :param vect: Vector (bed) :type vect: vector :param left_distance: Left distance (left bank) :type left_distance: float :param right_distance: Right distance (right bank) :type right_distance: float :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :return: Zones :rtype: Zones .. py:method:: write_generic_file(save_as) Write a generic file for the 1D model. The generic file is an essential pre-requiste for the Fortran code inorder to read the model files. :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: convert_type_boundary_condition(type_bc: Union[int, str]) Convert the type of boundary conditions written as string into integer readable by the FORTRAN code (executable). - Type of BC, value ----------------- - waterdepth -> 1 - waterlevel -> 2 - discharge -> 3 - froude -> 4 - free -> 5 - impervious -> 99 - junction -> 100 - mobile_dam -> 127 .. py:method:: write_cl_file(crosses: list[list[wolfhece.PyCrosssections.profile]], cl_value: dict[str:(str, str, float)], save_as: str) Write the file of boundary conditions (.cl file). cl value(`profile name`: (`upstream or downstream`, `type of boundary condition` , `value of boundary condition`)) - Type of BC, value ----------------- - waterdepth -> 1 - waterlevel -> 2 - discharge -> 3 - froude -> 4 - free -> 5 - impervious -> 99 - junction -> 100 - mobile_dam -> 127 :param crosses: List of cross sections :type crosses: list[list[profile]] :param cl_value: Boundary conditions values :type cl_value: dict[str:(str,str,float)] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: write_width_file(crosses: list[list[wolfhece.PyCrosssections.profile]], width: float, save_as: str) Write the width file (.width file). - The width is constant for all the profiles Only used for rectangular channels. /!\ The width is the same for all the profiles /!\ The width is the same for all the zones :param crosses: List of cross sections :type crosses: list[list[profile]] :param width: Width :type width: float :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: write_top_file(crosses: list[list[wolfhece.PyCrosssections.profile]], save_as: str) Write the topographic file (`.top`). :param crosses: List of cross sections :type crosses: list[list[profile]] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. py:method:: write_batch_simulations(directory_of_executable: str, simulations_path: list[str], batch_name: str = 'batch_all_simuls', wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.write_batch_simulations.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli') -> str Write a bat file (`.bat`) for all simulations. A .bat file contains a small commmand used to call the executable and run the simulations. :param directory_of_executable: Directory of the executable :type directory_of_executable: str :param simulations_path: Simulations paths :type simulations_path: list[str] :param batch_name: Batch name, defaults to 'batch_all_simuls' :type batch_name: str, optional :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'precomputation' :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :return: Batch file :rtype: str .. py:method:: write_batch_file(directory_of_executable: str, directory_simulation: str, simulation_name: str, wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.write_batch_file.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', different_names=False, new_name: str = '') -> str Write a batch file (.bat file). A .bat file contains a small commmand used to call the executable and run the simulations. :param directory_of_executable: Directory of the executable :type directory_of_executable: str :param directory_simulation: Directory of the simulation :type directory_simulation: str :param simulation_name: Simulation name :type simulation_name: str :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'precomputation :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :param different_names: Different names, defaults to False :type different_names: bool, optional :param new_name: New name, defaults to '' :type new_name: str, optional :return: Batch file :rtype: str .. py:method:: run_bat_files(batch_file: str, communicate=False) Run the .bat file in a windows shell to start the computations (simulation). :param batch_file: Batch file :type batch_file: str :param communicate: Communicate, defaults to False :type communicate: bool, optional .. py:method:: _run_batch_file(batch_file: str, communicate=False) Run the .bat file in a windows shell to start the computations (simulation). :param batch_file: Batch file :type batch_file: str :param communicate: Communicate, defaults to False :type communicate: bool, optional FIXME Deprecated. .. py:method:: run_batch_file_multiprocess(communicate=False) Run the .bat file in a windows shell to start the computations (simulation). FIXME still not working. .. note:: Find a way to implement it. :param batch_file: Batch file :type batch_file: str :param communicate: Communicate, defaults to False :type communicate: bool, optional .. py:method:: _run_batch_file(batch_file: str) Run the .bat file in a windows shell to start the computations (simulation). :param batch_file: Batch file :type batch_file: str .. py:method:: run_everything(batch_file) Run the .bat file in a windows shell to start the computations (simulation). :param batch_file: Batch file :type batch_file: str .. py:method:: _run_bat_files(bat_file, force_cwd=False, initial_condition=False) Run the .bat file in a windows shell to start the computations (simulation). :param batch_file: Batch file :type batch_file: str :param force_cwd: Force current working directory, defaults to False :type force_cwd: bool, optional .. py:method:: write_help_file(save_as: str) -> None Write the help file. Contains the list of mandatory and optional files to create a 1D model. :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional .. todo: FIXME implement a test before launching the model based on this list. .. py:method:: remove_directory(directory: str) -> None Delete a directory (folder). :param directory: Directory path :type directory: str .. py:method:: find_1D_binary_results(directory: str) -> tuple[str] /!\ This method has been deprecated. Return a tuple containing the paths to the model: - Head file (binary file containing the necessary information to interpret the results -> number of time steps, coordinates, simulated times, real times); - Depth file (binary file containing the computed depths at each time step); - Discharge file (binary file containing the computed discharges at each time step); - Wetted sections file (binary file containing the wetted sections for each time step). :param directory: Directory :type directory: str :return: Paths to the model :rtype: tuple[str] .. py:method:: read_1D_binary_results(results: list[str]) -> tuple[numpy.ndarray] /!\ This method has been deprecated. Check the the class` Wolfresults_1D` for the new implementation. Return a tuple containing the simulated results as numpy arrays in this order: - 0. Nodes coordinates (np.ndarray), - 1. Water depths (np.ndarray), - 2. Discharges (np.ndarray), - 3. Wetted sections (np.ndarray), - 5. real times - 6. Simulated times .. py:method:: plot_1D_results(results: tuple[numpy.ndarray], save_as: str = '', figure_size=(20, 10), first_time_step=1, animations=True, max_ylimits=(0.9, 0.9, 2.5, 1.5, 1, 1), landmark: wolfhece.PyVertexvectors.Zones = None, banks: wolfhece.PyVertexvectors.Zones = None, dpi: float = Constants.DPI.value) -> None /!\ This method has been deprecated. Check the the class` Wolfresults_1D` for the new implementation. Plot the results of 1D model either: - as a gif (evolution of all parameters) Starting from a particular time step (firt_time_step) or, - As a picture (only the first time step). @ The counting of time steps starts from 1, and negative counting (from the back) works too. @ In case a bad time steps is passed, the last time step will be plotted. @ max_ylimits allows the resizing of the maximum y limits of each of the 4 plots respectively. - For instance, the maximum ylim for discharges (third plot) = max(discharges) + (2.5 * max(discharges)) :param results: Results :type results: tuple[np.ndarray] :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param figure_size: Figure size, defaults to (20,10) :type figure_size: tuple, optional :param first_time_step: First time step, defaults to 1 :type first_time_step: int, optional :param animations: Animations, defaults to True :type animations: bool, optional :param max_ylimits: Maximum y limits, defaults to (0.9, 0.9, 2.5, 1.5, 1, 1) :type max_ylimits: tuple, optional :param landmark: Landmark, defaults to None :type landmark: Zones, optional :param banks: Banks, defaults to None :type banks: Zones, optional :param dpi: Dpi, defaults to Constants.DPI.value :type dpi: float, optional .. py:method:: plot_hydrograph_nodes(results: tuple[numpy.ndarray], which_nodes: list[int] = [0, -1], save_as: str = '', figure_size=(20, 10)) /!\ This method has been deprecated. Check the the class` Wolfresults_1D` for the new implementation. Plot the hydrographs of the nodes. :param results: Results :type results: tuple[np.ndarray] :param which_nodes: Which nodes, defaults to [0,-1] :type which_nodes: list[int], optional :param save_as: File path of the new cross section, defaults to '' :type save_as: str, optional :param figure_size: Figure size, defaults to (20,10) :type figure_size: tuple, optional .. py:method:: write_simulation_files_from_crosssections(folder_path: str, cross_sections: wolfhece.PyCrosssections.crosssections, parallels: wolfhece.PyVertexvectors.Zones, banks: wolfhece.PyVertexvectors.Zones, boundary_conditions: dict, roughness: Union[float, wolfhece.wolf_array.WolfArray], hydrographs: list[list[list]], exe_file: str, topography: wolfhece.wolf_array.WolfArray = None, initial_discharge: float = None, simulation_name: str = 'simul', discretisation: float = 10.0, extrapolation_of_extremities: float = 100.0, initial_depth: float = 1.0, write_in: Literal[iterations, Creator_1D.write_simulation_files_from_crosssections.times] = 'times', output_frequency: int = 900, polygon_number: int = 1, code_verbosity_profile: list = [1], simulation_time: int = None, roughness_option: Literal[under_profile, under_polygons] = 'under_profile', roughness_selection: Literal[min, mean, median, max] = 'mean', file_type_initial_cond: Literal[.aini, .hini, .zini] = '.aini', infiltration_profiles: list = ['1'], wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.write_simulation_files_from_crosssections.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', run_simulation: Literal[yes, no] = 'no', writing_type_infiltration: Literal[continuous, stepwise] = 'continuous', epsilon_infiltration: float = 0.01, new_directory='', force_steady=True) -> tuple Write the simulation files (the 1D model) from the cross sections and the other parameters with one line of code. :param folder_path: Folder path :type folder_path: str :param cross_sections: Cross sections :type cross_sections: crosssections :param parallels: Parallels :type parallels: Zones :param banks: Banks :type banks: Zones :param boundary_conditions: Boundary conditions :type boundary_conditions: dict :param roughness: Roughness :type roughness: Union[float,WolfArray] :param hydrographs: Hydrographs :type hydrographs: list[list[list]] :param exe_file: Exe file :type exe_file: str :param topography: Topography, defaults to None :type topography: WolfArray, optional :param initial_discharge: Initial discharge, defaults to None :type initial_discharge: float, optional :param simulation_name: Simulation name, defaults to 'simul' :type simulation_name: str, optional :param discretisation: Discretisation, defaults to 10. :type discretisation: float, optional :param extrapolation_of_extremities: Extrapolation of extremities, defaults to 100. :type extrapolation_of_extremities: float, optional :param initial_depth: Initial depth, defaults to 1. :type initial_depth: float, optional :param write_in: Write in, defaults to 'times' :type write_in: Literal['iterations', 'times'], optional :param output_frequency: Output frequency, defaults to 900 :type output_frequency: int, optional :param polygon_number: Polygon number, defaults to 1 :type polygon_number: int, optional :param code_verbosity_profile: Code verbosity profile, defaults to [1] :type code_verbosity_profile: list, optional :param simulation_time: Simulation time, defaults to None :type simulation_time: int, optional :param roughness_option: Roughness option, defaults to 'under_profile' :type roughness_option: Literal['under_profile', 'under_polygons'], optional :param roughness_selection: Roughness selection, defaults to 'mean' :type roughness_selection: Literal['min','mean','median','max'], optional :param file_type_initial_cond: File type initial cond, defaults to '.aini' :type file_type_initial_cond: Literal['.aini','.hini','.zini'], optional :param infiltration_profiles: Infiltration profiles, defaults to ['1'] :type infiltration_profiles: list, optional :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'precomputation' :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :param run_simulation: Run simulation, defaults to 'no' :type run_simulation: Literal['yes', 'no'], optional :param writing_type_infiltration: Writing type infiltration, defaults to 'continuous' :type writing_type_infiltration: Literal['continuous', 'stepwise'], optional :param epsilon_infiltration: Epsilon infiltration, defaults to 0.01 :type epsilon_infiltration: float, optional :param new_directory: New directory, defaults to '' :type new_directory: str, optional :param force_steady: Force steady, defaults to True :type force_steady: bool, optional :return: tuple :rtype: tuple .. py:method:: find_file_from_extension(directory: str, file_extension: str) -> str Return a file in a directory based on its extension. :param directory: file path to the folder :type directory: str :param file_extension: file extension :type file_extension: str :return: file path .. py:method:: start_from_steady_state(directory: str, plot=True) Compute the steady state solution and update the initial conditions based on the results. :param directory: directory (simulation folder) :type directory: str :param plot: wheter the process should open a matplotlib figure containing the steady state solution or not, defaults to True :type plot: bool, optional .. py:method:: update_initial_conditions_from_results(directory: str, time_step: int = 1, plot: bool = True) .. py:method:: log_message(message: str) Message for the user. :param message: message :type message: str .. py:method:: create_multiple_simulations_from_csv(csv_filename: str, folder_path: str, cross_sections: wolfhece.PyCrosssections.crosssections, parallels: wolfhece.PyVertexvectors.Zones, banks: wolfhece.PyVertexvectors.Zones, boundary_conditions: dict, roughness: Union[float, wolfhece.wolf_array.WolfArray], hydrographs: list[list[list]], exe_file: str, topography: wolfhece.wolf_array.WolfArray = None, initial_discharge: float = None, simulation_name: str = 'simul', discretisation: float = 10.0, extrapolation_of_extremities: float = 100.0, initial_depth: float = 1.0, write_in: Literal[iterations, times] = 'times', output_frequency: int = 900, polygon_number: int = 1, code_verbosity_profile: list = [1], simulation_time: int = None, roughness_option: Literal[under_profile, under_polygons] = 'under_profile', roughness_selection: Literal[min, mean, median, max] = 'mean', file_type_initial_cond: Literal[.aini, .hini, .zini] = '.aini', infiltration_profiles: list = ['1'], wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.create_multiple_simulations_from_csv.steady] = 'steady', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', run_simulation: Literal[yes, no] = 'no', force_steady=True) Create multiple simulations from a csv file. :param csv_filename: Csv filename :type csv_filename: str :param folder_path: Folder path :type folder_path: str :param cross_sections: Cross sections :type cross_sections: crosssections :param parallels: Parallels :type parallels: Zones :param banks: Banks :type banks: Zones :param boundary_conditions: Boundary conditions :type boundary_conditions: dict :param roughness: Roughness :type roughness: Union[float,WolfArray] :param hydrographs: Hydrographs :type hydrographs: list[list[list]] :param exe_file: Exe file :type exe_file: str :param topography: Topography, defaults to None :type topography: WolfArray, optional :param initial_discharge: Initial discharge, defaults to None :type initial_discharge: float, optional :param simulation_name: Simulation name, defaults to 'simul' :type simulation_name: str, optional :param discretisation: Discretisation, defaults to 10. :type discretisation: float, optional :param extrapolation_of_extremities: Extrapolation of extremities, defaults to 100. :type extrapolation_of_extremities: float, optional :param initial_depth: Initial depth, defaults to 1. :type initial_depth: float, optional :param write_in: Write in, defaults to 'times' :type write_in: Literal['iterations', 'times'], optional :param output_frequency: Output frequency, defaults to 900 :type output_frequency: int, optional :param polygon_number: Polygon number, defaults to 1 :type polygon_number: int, optional :param code_verbosity_profile: Code verbosity profile, defaults to [1] :type code_verbosity_profile: list, optional :param simulation_time: Simulation time, defaults to None :type simulation_time: int, optional :param roughness_option: Roughness option, defaults to 'under_profile' :type roughness_option: Literal['under_profile', 'under_polygons'], optional :param roughness_selection: Roughness selection, defaults to 'mean' :type roughness_selection: Literal['min','mean','median','max'], optional :param file_type_initial_cond: File type initial cond, defaults to '.aini' :type file_type_initial_cond: Literal['.aini','.hini','.zini'], optional :param infiltration_profiles: Infiltration profiles, defaults to ['1'] :type infiltration_profiles: list, optional :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'steady' :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :param run_simulation: Run simulation, defaults to 'no' :type run_simulation: Literal['yes', 'no'], optional :param force_steady: Force steady, defaults to True :type force_steady: bool, optional .. py:method:: read_csv_as_dataframe(filename: str, column_names: list = None, sep=',', header: int = 0) -> pandas.DataFrame Read a csv file and return a pandas dataframe. :param filename: Filename :type filename: str :param column_names: Column names, defaults to None :type column_names: list, optional :param sep: Separator, defaults to ',' :type sep: str, optional :param header: Header, defaults to 0 :type header: int, optional :return: Pandas dataframe :rtype: pd.DataFrame .. py:method:: read_csv_as_infiltrations(filename: str, sep=',', header: int = 0) -> list[dict] Read a csv file and return a list containing the infiltrations(hydrographs and profiles). :param filename: Filename :type filename: str :param sep: Separator, defaults to ',' :type sep: str, optional :param header: Header, defaults to 0 :type header: int, optional :return: List of infiltrations :rtype: list[dict] .. py:method:: create_simulations_from_csv(csv_filename: str, folder_path: str, cross_sections: wolfhece.PyCrosssections.crosssections, parallels: wolfhece.PyVertexvectors.Zones, banks: wolfhece.PyVertexvectors.Zones, boundary_conditions: dict, roughness: Union[float, wolfhece.wolf_array.WolfArray], exe_file: str, hydrographs: list[list[list]] = None, topography: wolfhece.wolf_array.WolfArray = None, initial_discharge: float = None, simulation_name: str = 'simul', discretisation: float = 10.0, extrapolation_of_extremities: float = 100.0, initial_depth: float = 1.0, write_in: Literal[iterations, times] = 'times', output_frequency: int = 900, polygon_number: int = 1, code_verbosity_profile: list = [1], simulation_time: int = None, roughness_option: Literal[under_profile, under_polygons] = 'under_profile', roughness_selection: Literal[min, mean, median, max] = 'mean', file_type_initial_cond: Literal[.aini, .hini, .zini] = '.aini', infiltration_profiles: list = ['1'], wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.create_simulations_from_csv.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', run_simulation: Literal[yes, no] = 'no', writing_type_infiltration: Literal[continuous, stepwise] = 'continuous', epsilon_infiltration: float = 0.01, force_steady=True) -> None Create simulations from a csv file. :param csv_filename: Csv filename :type csv_filename: str :param folder_path: Folder path :type folder_path: str :param cross_sections: Cross sections :type cross_sections: crosssections :param parallels: Parallels :type parallels: Zones :param banks: Banks :type banks: Zones :param boundary_conditions: Boundary conditions :type boundary_conditions: dict :param roughness: Roughness :type roughness: Union[float,WolfArray] :param exe_file: Exe file :type exe_file: str :param hydrographs: Hydrographs, defaults to None :type hydrographs: list[list[list]], optional :param topography: Topography, defaults to None :type topography: WolfArray, optional :param initial_discharge: Initial discharge, defaults to None :type initial_discharge: float, optional :param simulation_name: Simulation name, defaults to 'simul' :type simulation_name: str, optional :param discretisation: Discretisation, defaults to 10. :type discretisation: float, optional :param extrapolation_of_extremities: Extrapolation of extremities, defaults to 100. :type extrapolation_of_extremities: float, optional :param initial_depth: Initial depth, defaults to 1. :type initial_depth: float, optional :param write_in: Write in, defaults to 'times' :type write_in: Literal['iterations', 'times'], optional :param output_frequency: Output frequency, defaults to 900 :type output_frequency: int, optional :param polygon_number: Polygon number, defaults to 1 :type polygon_number: int, optional :param code_verbosity_profile: Code verbosity profile, defaults to [1] :type code_verbosity_profile: list, optional :param simulation_time: Simulation time, defaults to None :type simulation_time: int, optional :param roughness_option: Roughness option, defaults to 'under_profile' :type roughness_option: Literal['under_profile', 'under_polygons'], optional :param roughness_selection: Roughness selection, defaults to 'mean' :type roughness_selection: Literal['min','mean','median','max'], optional :param file_type_initial_cond: File type initial cond, defaults to '.aini' :type file_type_initial_cond: Literal['.aini','.hini','.zini'], optional :param infiltration_profiles: Infiltration profiles, defaults to ['1'] :type infiltration_profiles: list, optional :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'precomputation' :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :param run_simulation: Run simulation, defaults to 'no' :type run_simulation: Literal['yes', 'no'], optional :param writing_type_infiltration: Writing type infiltration, defaults to 'continuous' :type writing_type_infiltration: Literal['continuous', 'stepwise'], optional :param epsilon_infiltration: Epsilon infiltration, defaults to 0.01 :type epsilon_infiltration: float, optional :param force_steady: Force steady, defaults to True :type force_steady: bool, optional .. py:method:: copy_simulation_files(simulation: str, save_as: str, ignore_filetype: Literal[.*qini, *.aini, *.zini, *.hini, *.cl, *.rough, infil*, *.inf*.infil, *.param, *.top, *.ptv, *.gtv, .log, .count*.HEAD, *.RA, *.RB, *.RQ, *.RS, *.vecz, *.vec, *.txt, *.bat] = '') -> str Copy simulation files. :param simulation: Simulation :type simulation: str :param save_as: Save as :type save_as: str :param ignore_filetype: Ignore filetype, defaults to '' :type ignore_filetype: str, optional :return: Copied directory :rtype: str .. py:method:: copy_multiple_simulations_from_csv(csv_filename: str, simulation: str) -> None Copy multiple simulations from a csv file. :param csv_filename: Csv filename :type csv_filename: str :param simulation: Simulation :type simulation: str .. py:method:: distribute_values_as_sum(array: numpy.ndarray) -> numpy.ndarray Return a 1D array were the 0 are filled with the previous value in the table, and the existing values are replaced by their summed with the previous value in the table. :param array: Array(1D) containing the vaalues of the initial discharge at specific profiles :type array: np.ndarray :return: Updated array :rtype: np.ndarray .. py:method:: find_qini_values_from_infiltration_dict(infiltration: dict) -> dict Return a dictionnary containing the infiltration profiles and their initial discharge (first value). These dictionnary can be used :param infiltration: Infiltration :type infiltration: dict :return: Initial infiltrations :rtype: dict .. py:method:: compute_qini_values_from_infiltrations_dict(infiltrations: dict, nb_cells: int) -> numpy.ndarray Compute the initial discharge from a dictionary of infiltrations. The method returns an array of initial discharges. The array values are distributed from the distribution (linear sum) of the first infiltration values. :param infiltrations: Infiltrations (dictionnary of hydrographs) :type infiltrations: dict :param nb_cells: Number of cells :type nb_cells: int :return: Initial discharges :rtype: np.ndarray .. py:method:: update_qini_file_from_infiltration_dict(infiltrations: dict, directory: str) Upadte the qini file from a dictionary of infiltrations. :param infiltrations: Infiltrations :type infiltrations: dict :param directory: Directory (folder) :type directory: str .. py:method:: read_ini_file_as_dataframe(ini_file: str) Read an ini file and return a pandas dataframe. :param ini_file: File of initial conditions :type ini_file: str :return: Pandas dataframe :rtype: pd.DataFrame .. py:method:: update_ini_file(ini_file: str, new_values: numpy.ndarray) -> None Update the initial condition file with new values. The method reads the initial condition file as a pandas dataframe, then replace old the values by the new values. :param ini_file: File of initial condition :type ini_file: str :param new_values: New values :type new_values: np.ndarray .. py:method:: __write_batch_file(directory_of_executable: str, directory_simulation: str, simulation_name: str, wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.__write_batch_file.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', different_names=False, new_name: str = '') -> str .. py:method:: match_ends_2vectors_outdated(zones1: wolfhece.PyVertexvectors.Zones, zones2: wolfhece.PyVertexvectors.Zones, id1: int = 0, id2: int = 0) -> wolfhece.PyVertexvectors.Zones Aligns the vertices of 2 successive zone containing each 3 vectors (1 vector and its 2 parallels), so that, the end of each vector matches the begining of its corresponding in the other zone. - id1: zone id in zones1.myzones, - id2: zone id in zones2.myzones. .. py:method:: __save_as_1D_crossections(zones: wolfhece.PyVertexvectors.Zones, format='vecz', save_as: str = '') -> wolfhece.PyCrosssections.crosssections .. py:method:: __update_qini_file_from_infiltration_dict(infiltrations: dict, directory: str) Deprecating due to the last for loop (it's obviously a code duplication). .. py:method:: _create_simulations_from_csv(csv_filename: str, folder_path: str, cross_sections: wolfhece.PyCrosssections.crosssections, parallels: wolfhece.PyVertexvectors.Zones, banks: wolfhece.PyVertexvectors.Zones, boundary_conditions: dict, roughness: Union[float, wolfhece.wolf_array.WolfArray], hydrographs: list[list[list]], exe_file: str, topography: wolfhece.wolf_array.WolfArray = None, initial_discharge: float = None, simulation_name: str = 'simul', discretisation: float = 10.0, extrapolation_of_extremities: float = 100.0, initial_depth: float = 1.0, write_in: Literal[iterations, times] = 'times', output_frequency: int = 900, polygon_number: int = 1, code_verbosity_profile: list = [1], simulation_time: int = None, roughness_option: Literal[under_profile, under_polygons] = 'under_profile', roughness_selection: Literal[min, mean, median, max] = 'mean', file_type_initial_cond: Literal[.aini, .hini, .zini] = '.aini', infiltration_profiles: list = ['1'], wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D._create_simulations_from_csv.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', run_simulation: Literal[yes, no] = 'no', writing_type_infiltration: Literal[continuous, stepwise] = 'continuous', epsilon_infiltration: float = 0.01, force_steady=True) -> None Deprecated .. py:method:: _start_from_steady_state(profile: str, infiltrations: dict, list_of_sorted_cross: list, directory, plot=True) .. py:method:: __write_simulation_files_from_crosssections(folder_path: str, cross_sections: wolfhece.PyCrosssections.crosssections, parallels: wolfhece.PyVertexvectors.Zones, banks: wolfhece.PyVertexvectors.Zones, boundary_conditions: dict, roughness: Union[float, wolfhece.wolf_array.WolfArray], hydrographs: list[list[list]], exe_file: str, topography: wolfhece.wolf_array.WolfArray = None, initial_discharge: float = None, simulation_name: str = 'simul', discretisation: float = 10.0, extrapolation_of_extremities: float = 100.0, initial_depth: float = 1.0, write_in: Literal[iterations, Creator_1D.__write_simulation_files_from_crosssections.times] = 'times', output_frequency: int = 900, polygon_number: int = 1, code_verbosity_profile: list = [1], simulation_time: int = None, roughness_option: Literal[under_profile, under_polygons] = 'under_profile', roughness_selection: Literal[min, mean, median, max] = 'mean', file_type_initial_cond: Literal[.aini, .hini, .zini] = '.aini', infiltration_profiles: list = ['1'], wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.__write_simulation_files_from_crosssections.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', run_simulation: Literal[yes, no] = 'no', writing_type_infiltration: Literal[continuous, stepwise] = 'continuous', epsilon_infiltration: float = 0.01, new_directory='', force_steady=True) -> tuple Write the simulation files (the 1D model) from the cross sections and the other parameters with one line of code. :param folder_path: Folder path :type folder_path: str :param cross_sections: Cross sections :type cross_sections: crosssections :param parallels: Parallels :type parallels: Zones :param banks: Banks :type banks: Zones :param boundary_conditions: Boundary conditions :type boundary_conditions: dict :param roughness: Roughness :type roughness: Union[float,WolfArray] :param hydrographs: Hydrographs :type hydrographs: list[list[list]] :param exe_file: Exe file :type exe_file: str :param topography: Topography, defaults to None :type topography: WolfArray, optional :param initial_discharge: Initial discharge, defaults to None :type initial_discharge: float, optional :param simulation_name: Simulation name, defaults to 'simul' :type simulation_name: str, optional :param discretisation: Discretisation, defaults to 10. :type discretisation: float, optional :param extrapolation_of_extremities: Extrapolation of extremities, defaults to 100. :type extrapolation_of_extremities: float, optional :param initial_depth: Initial depth, defaults to 1. :type initial_depth: float, optional :param write_in: Write in, defaults to 'times' :type write_in: Literal['iterations', 'times'], optional :param output_frequency: Output frequency, defaults to 900 :type output_frequency: int, optional :param polygon_number: Polygon number, defaults to 1 :type polygon_number: int, optional :param code_verbosity_profile: Code verbosity profile, defaults to [1] :type code_verbosity_profile: list, optional :param simulation_time: Simulation time, defaults to None :type simulation_time: int, optional :param roughness_option: Roughness option, defaults to 'under_profile' :type roughness_option: Literal['under_profile', 'under_polygons'], optional :param roughness_selection: Roughness selection, defaults to 'mean' :type roughness_selection: Literal['min','mean','median','max'], optional :param file_type_initial_cond: File type initial cond, defaults to '.aini' :type file_type_initial_cond: Literal['.aini','.hini','.zini'], optional :param infiltration_profiles: Infiltration profiles, defaults to ['1'] :type infiltration_profiles: list, optional :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'precomputation' :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :param run_simulation: Run simulation, defaults to 'no' :type run_simulation: Literal['yes', 'no'], optional :param writing_type_infiltration: Writing type infiltration, defaults to 'continuous' :type writing_type_infiltration: Literal['continuous', 'stepwise'], optional :param epsilon_infiltration: Epsilon infiltration, defaults to 0.01 :type epsilon_infiltration: float, optional :param new_directory: New directory, defaults to '' :type new_directory: str, optional :param force_steady: Force steady, defaults to True :type force_steady: bool, optional :return: tuple :rtype: tuple .. py:method:: ____write_simulation_files_from_crosssections(folder_path: str, cross_sections: wolfhece.PyCrosssections.crosssections, parallels: wolfhece.PyVertexvectors.Zones, banks: wolfhece.PyVertexvectors.Zones, boundary_conditions: dict, roughness: Union[float, wolfhece.wolf_array.WolfArray], hydrographs: list[list[list]], exe_file: str, topography: wolfhece.wolf_array.WolfArray = None, initial_discharge: float = None, simulation_name: str = 'simul', discretisation: float = 10.0, extrapolation_of_extremities: float = 100.0, initial_depth: float = 1.0, write_in: Literal[iterations, Creator_1D.____write_simulation_files_from_crosssections.times] = 'times', output_frequency: int = 900, polygon_number: int = 1, code_verbosity_profile: list = [1], simulation_time: int = None, roughness_option: Literal[under_profile, under_polygons] = 'under_profile', roughness_selection: Literal[min, mean, median, max] = 'mean', file_type_initial_cond: Literal[.aini, .hini, .zini] = '.aini', infiltration_profiles: list = ['1'], wetdry: Literal[fixed, evolutive] = 'evolutive', steady: Literal[no precomputation, precomputation, Creator_1D.____write_simulation_files_from_crosssections.steady] = 'precomputation', executable_type: Literal[wolfcli, wolfclid] = 'wolfcli', run_simulation: Literal[yes, no] = 'no', writing_type_infiltration: Literal[continuous, stepwise] = 'continuous', epsilon_infiltration: float = 0.01, new_directory='', steady_state_profile='', force_steady=True, start_from_steady_state=False, plot_steady_state=True) -> tuple Write the simulation files (the 1D model) from the cross sections and the other parameters with one line of code. :param folder_path: Folder path :type folder_path: str :param cross_sections: Cross sections :type cross_sections: crosssections :param parallels: Parallels :type parallels: Zones :param banks: Banks :type banks: Zones :param boundary_conditions: Boundary conditions :type boundary_conditions: dict :param roughness: Roughness :type roughness: Union[float,WolfArray] :param hydrographs: Hydrographs :type hydrographs: list[list[list]] :param exe_file: Exe file :type exe_file: str :param topography: Topography, defaults to None :type topography: WolfArray, optional :param initial_discharge: Initial discharge, defaults to None :type initial_discharge: float, optional :param simulation_name: Simulation name, defaults to 'simul' :type simulation_name: str, optional :param discretisation: Discretisation, defaults to 10. :type discretisation: float, optional :param extrapolation_of_extremities: Extrapolation of extremities, defaults to 100. :type extrapolation_of_extremities: float, optional :param initial_depth: Initial depth, defaults to 1. :type initial_depth: float, optional :param write_in: Write in, defaults to 'times' :type write_in: Literal['iterations', 'times'], optional :param output_frequency: Output frequency, defaults to 900 :type output_frequency: int, optional :param polygon_number: Polygon number, defaults to 1 :type polygon_number: int, optional :param code_verbosity_profile: Code verbosity profile, defaults to [1] :type code_verbosity_profile: list, optional :param simulation_time: Simulation time, defaults to None :type simulation_time: int, optional :param roughness_option: Roughness option, defaults to 'under_profile' :type roughness_option: Literal['under_profile', 'under_polygons'], optional :param roughness_selection: Roughness selection, defaults to 'mean' :type roughness_selection: Literal['min','mean','median','max'], optional :param file_type_initial_cond: File type initial cond, defaults to '.aini' :type file_type_initial_cond: Literal['.aini','.hini','.zini'], optional :param infiltration_profiles: Infiltration profiles, defaults to ['1'] :type infiltration_profiles: list, optional :param wetdry: Wetdry, defaults to 'evolutive' :type wetdry: Literal['fixed', 'evolutive'], optional :param steady: Steady, defaults to 'precomputation' :type steady: Literal['no precomputation', 'precomputation', 'steady'], optional :param executable_type: Executable type, defaults to 'wolfcli' :type executable_type: Literal['wolfcli', 'wolfclid'], optional :param run_simulation: Run simulation, defaults to 'no' :type run_simulation: Literal['yes', 'no'], optional :param writing_type_infiltration: Writing type infiltration, defaults to 'continuous' :type writing_type_infiltration: Literal['continuous', 'stepwise'], optional :param epsilon_infiltration: Epsilon infiltration, defaults to 0.01 :type epsilon_infiltration: float, optional :param new_directory: New directory, defaults to '' :type new_directory: str, optional :param force_steady: Force steady, defaults to True :type force_steady: bool, optional :return: tuple :rtype: tuple .. py:class:: Wolfresults_1D(simulation_directory: str = None) Read the results of a Wolf 1D model and enable the visualization (plots) of variables namely water level, water depth, discharge, wetted sections, velocity and Froude number. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. .. py:method:: update_ic_from_time_steps(time_step: int = -1) -> numpy.ndarray Return the simulated conditions (a,q,h, r) at a given time step as a `np.ndarray`. - a: Wetted section (index 0), - s: Wetted perimeter (index 1), - w: Top width (index 2), - r: Hydraulic radius (index 3). :param time_step: the desired time steps, defaults to -1 :type time_step: int, optional :return: the conditions at the specified time step :rtype: np.ndarray .. py:method:: update_ini_file(ini_file: str, new_values: numpy.ndarray) -> None Update the initial condition file with new values. .. py:method:: plot_water_level(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, show=True) Plot the water level and return the information associated with the the figure's axis. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param show: Show, defaults to True :type show: bool, optional :return: Axe :rtype: Axes .. py:method:: _plot_water_level(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, show=True) Deprecated method .. py:method:: plot_line_water_level(figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, label: str = '', color: str = 'blue', linestyle='solid', linewidth=0.7, show=True) Plot the water level as a continous line and return the information associated with the axe. Landmarks are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param label: Label, defaults to '' :type label: str, optional :param color: Color, defaults to 'blue' :type color: str, optional :param linestyle: Linestyle, defaults to 'solid' :type linestyle: str, optional :param linewidth: Linewidth, defaults to 0.7 :type linewidth: float, optional :param show: Show, defaults to True :type show: bool, optional :return: Water level :rtype: Line2D .. py:method:: plot_water_depth(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 0.5, convert_step=True, steps_limit=False, show=True) Plot the water depth and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to .5 :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param show: Show, defaults to True :type show: bool, optional :return: Water depth :rtype: Line2D .. py:method:: plot_line_water_depth(figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, label: str = '', color: str = 'blue', linestyle='solid', linewidth=0.7, show=True) Plot the water depth as a line and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param label: Label, defaults to '' :type label: str, optional :param color: Color, defaults to 'blue' :type color: str, optional :param linestyle: Linestyle, defaults to 'solid' :type linestyle: str, optional :param linewidth: Linewidth, defaults to 0.7 :type linewidth: float, optional :param show: Show, defaults to True :type show: bool, optional :return: Water depth :rtype: Line2D .. py:method:: plot_discharges(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = None, convert_step=True, steps_limit=False, show=True) Plot the discharges and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to None :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param show: Show, defaults to True :type show: bool, optional :return: Water discharge :rtype: Line2D .. py:method:: plot_line_discharges(figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, label: str = '', color: str = 'blue', linestyle='solid', linewidth=0.7, show=True) Plot the discharges as a line and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param label: Label, defaults to '' :type label: str, optional :param color: Color, defaults to 'blue' :type color: str, optional :param linestyle: Linestyle, defaults to 'solid' :type linestyle: str, optional :param linewidth: Linewidth, defaults to 0.7 :type linewidth: float, optional :param show: Show, defaults to True :type show: bool, optional :return: Water discharge :rtype: Line2D .. py:method:: plot_wetted_sections(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x: float = 1000.0, grid_y: float = None, convert_step=True, steps_limit=False, show=True) Plot the wetted sections and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x: Grid x, defaults to 1000. :type grid_x: float, optional :param grid_y: Grid y, defaults to None :type grid_y: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param show: Show, defaults to True :type show: bool, optional :return: Wetted sections :rtype: Line2D .. py:method:: plot_line_wetted_sections(figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, label: str = '', color: str = 'blue', linestyle='solid', linewidth=0.7, show=True) Plot the wetted sections as a line and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param label: Label, defaults to '' :type label: str, optional :param color: Color, defaults to 'blue' :type color: str, optional :param linestyle: Linestyle, defaults to 'solid' :type linestyle: str, optional :param linewidth: Linewidth, defaults to 0.7 :type linewidth: float, optional :param show: Show, defaults to True :type show: bool, optional :return: Wetted sections :rtype: Line2D .. py:method:: plot_velocities(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x: float = 1000.0, grid_y: float = None, convert_step=True, steps_limit=False, show=True) Plot the velocities and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x: Grid x, defaults to 1000. :type grid_x: float, optional :param grid_y: Grid y, defaults to None :type grid_y: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param show: Show, defaults to True :type show: bool, optional :return: Velocity :rtype: Line2D .. py:method:: plot_line_velocities(figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, label: str = '', color: str = 'blue', linestyle='solid', linewidth=0.7, show=True) Plot the velocities as a line and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param label: Label, defaults to '' :type label: str, optional :param color: Color, defaults to 'blue' :type color: str, optional :param linestyle: Linestyle, defaults to 'solid' :type linestyle: str, optional :param linewidth: Linewidth, defaults to 0.7 :type linewidth: float, optional :param show: Show, defaults to True :type show: bool, optional :return: Velocity :rtype: Line2D .. py:method:: plot_froudes(figax: tuple = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x: float = 1000.0, grid_y: float = None, convert_step=True, steps_limit=False, show=True) Plot the Froude numbers and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x: Grid x, defaults to 1000. :type grid_x: float, optional :param grid_y: Grid y, defaults to None :type grid_y: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param show: Show, defaults to True :type show: bool, optional :return: Froude number :rtype: Line2D .. py:method:: plot_line_froudes(figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (20, 10), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False, label: str = '', color: str = 'blue', linestyle='solid', linewidth=0.7, show=True) Plot the Froude numbers as a line and return the information associated with the axe. Landmarks: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param figax: Figure and axe :type figax: tuple, optional :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x_m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y_m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional :param label: Label, defaults to '' :type label: str, optional :param color: Color, defaults to 'blue' :type color: str, optional :param linestyle: Linestyle, defaults to 'solid' :type linestyle: str, optional :param linewidth: Linewidth, defaults to 0.7 :type linewidth: float, optional :param show: Show, defaults to True :type show: bool, optional :return: Froude number :rtype: Line2D .. py:method:: create_axis(figures: list) Return the predefined matplolib index(es) used to create the figure's axes based on their number. :param figures: List of figures :type figures: list :return: List of axes :rtype: list .. py:method:: plot_variables(figures: list[Literal[water level, Wolfresults_1D.plot_variables.discharge, wetted section, water depth, Wolfresults_1D.plot_variables.velocity, Wolfresults_1D.plot_variables.froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude'], time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (30, 10), alpha: float = 0.3, show=True, steps_limit=True, grid_x_m=1000, grid_y_m=10) -> list[tuple[matplotlib.lines.Line2D, matplotlib.axes.Axes, matplotlib.figure.Figure]] Plot the selected variables in figures and return the information associated with their axes. :param figures: List of spefic figures to be plotted, defaults to ['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude'] :type figures: list :param time_step: Desired results (time step) to be plotted, defaults to 1 :type time_step: int, optional :param banksbed: Bed and banks of the river, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Size of the figure, defaults to (30,10) :type figsize: tuple, optional :param alpha: figure transparency, defaults to 0.3 :type alpha: float, optional :param show: Should the figure be shown, defaults to True :type show: bool, optional :param steps_limit: Steps limit, defaults to True :type steps_limit: bool, optional :return: List of axes :rtype: list .. py:method:: animate_1D_plots(figures: list[Literal[water level, discharge, wetted section, water depth, velocity, froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude'], time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', figsize: tuple = (20, 10), alpha: float = 0.3, save_as: str = '', grid_x=1000, grid_y=10) Animate the selected variables in figures, save them as a file and return the information associated with their axes. FIXME: implement multiprocesses to speed up the process. :param figures: List of figures :type figures: list :param time_step: Time step, defaults to 1 :type time_step: int, optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param figsize: Figsize, defaults to (20,10) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param save_as: Save as, defaults to '' :type save_as: str, optional :return: List of axes :rtype: list .. py:method:: _animate_1D_plots(figures: list[Literal[water level, discharge, wetted section, water depth, velocity, froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude'], time_step: int = 1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', figsize: tuple = (20, 10), alpha: float = 0.3, save_as: str = '') /!\ Deprecating Animate the selected variables in figures, save them as a file and return the information associated with their axes. .. py:method:: convert_time_step(time_step) Convert entry into a unique time step format usable by other methods. Return the real time step. :param time_step: Time step :type time_step: int :return: Real time step :rtype: int .. py:method:: __convert_time_step(time_step, results_array: numpy.array) Deprecated .. py:method:: _vector_from_coordinates() -> wolfhece.PyVertexvectors.vector Create a vector from the lowest points of each section (coordinates). :return: Vector :rtype: vector .. py:method:: _landmark(landmark: Union[wolfhece.PyVertexvectors.Zones, str], ax: matplotlib.axes.Axes, time_step: int, text=True, variable: Literal[water level, water depth, discharge, wetted sections, velocity, froude] = 'water level', alpha=0.7, rotation=30, ymax: float = None) Plot landmarks which are hydraulic structures (bridges, culverts, weirs, etc.) or any other point of interest in the river. :param landmark: Landmark :type landmark: Union[Zones,str] :param ax: Axes :type ax: Axes :param time_step: Time step :type time_step: int :param text: Text, defaults to True :type text: bool, optional :param variable: Variable, defaults to 'water level' :type variable: Literal['water level', 'water depth', 'discharge', 'wetted sections','velocity', 'froude'], optional :param alpha: Alpha, defaults to 0.7 :type alpha: float, optional :param rotation: Rotation, defaults to 30 :type rotation: int, optional :param ymax: Ymax, defaults to None :type ymax: float, optional .. py:method:: _river_banksbed(bedbanks: Union[wolfhece.PyVertexvectors.Zones, str], zone_id: int = 0) Set the river banks (left and right) and update the curviligne coordinates (self.s_coords) used for plotting (projections). - self.s_curvi = projections of lowest bed points on the mid-river bed vector (from _banksbed.vec), - self.left_bank_curvi = projections of left bank on the mid_river bed vector, - self.right_bank_curvi = projections of right bank on the mid_river bed vector. :param bedbanks: Bedbanks :type bedbanks: Union[Zones,str] :param zone_id: Zone id, defaults to 0 :type zone_id: int, optional .. py:method:: Update_curviline_coordinates() Update initial curviligne coordinates of the river bed (self.s_coords) projected curviligne coordinate (self.s_curvi). .. py:method:: _yticks_update(y_max) Update the yticks of the graph. :param y_max: Y max :type y_max: float :return: Grid y :rtype: float .. py:method:: _xticks_update(x_max) Update the xticks of the graph. :param x_max: x max :type x_max: float :return: Grid x :rtype: float .. py:method:: _xticks_update_time(x_max) Update the xticks of the graph. :param x_max: X max :type x_max: float :return: Grid x :rtype: float .. py:method:: return_only_width(depth: float, prof: wolfhece.PyCrosssections.profile) -> float Return the width of the profile for a given depth. :param depth: Depth :type depth: float :param prof: Profile :type prof: profile :return: Width :rtype: float .. py:method:: find_width_from_sz(depth: float, s: list, z: list) -> float Find the width from the s and z coordinates. :param depth: Depth :type depth: float :param s: S :type s: list :param z: Z :type z: list :return: Width :rtype: float .. py:method:: find_breadth_file(index) Find the breadth file. :param index: Index :type index: int :return: Relations :rtype: np.array .. py:method:: compute_froude() Compute the Froude number. .. py:method:: create_widths_and_froudes() Create the widths and Froudes. Write the `.RWIDTH` file which contains the simulated top widths by the model. This file is used to compute the Froude number. .. py:method:: _compute_froude(cross_sections: wolfhece.PyCrosssections.crosssections, riverbed: Union[wolfhece.PyVertexvectors.vector, wolfhece.PyVertexvectors.Zones, str] = vector, zone_index: int = 0, vector_index: int = 0) Deprecated .. py:method:: find_max(array: numpy.ndarray) -> float Find the maximum value of an array. :param array: Array :type array: np.ndarray :return: Maximum :rtype: float .. py:method:: update_yaxis(ax: matplotlib.axes.Axes, ymax: float, ymin=None) Update the y-axis. :param ax: Axes :type ax: Axes :param ymax: Y max :type ymax: float :param ymin: Y min, defaults to None :type ymin: Union[float, None], optional .. py:method:: find_figures_characteristics(axes_for_updates: list[tuple[matplotlib.lines.Line2D, matplotlib.axes.Axes, matplotlib.figure.Figure]], figures: list[Literal[water level, discharge, wetted section, water depth, velocity, froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude']) Return the right index of axes to be plotted. :param axes_for_updates: Axes for updates :type axes_for_updates: list[tuple[Line2D, Axes,Figure]] :param figures: Figures, defaults to ['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude'] :type figures: list[Literal['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude']], optional :return: Indices :rtype: dict .. py:method:: plot_nodes_evolution(which_nodes: list[int] = [0, -1], variable_name: Literal[water level, discharge, wetted section, water depth, velocity, froude] = 'discharge', save_as: str = '', figure_size=(25, 15), linewidth=2.0, plotting_style: Literal[scatter, line, combined] = 'line') Plot the evolution in time of specified nodes for a variable. :param which_nodes: nodes for which the results will be displayed on the hydrograph,defaults to [0,-1] :type which_nodes: list[int], optional :param variable_name: the variable to plot , defaults to 'discharge' :type variable_name: Literal['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude'], optional :param save_as: File path where the figure is saved, defaults to '' :type save_as: str, optional :param figure_size: Figure size, defaults to (25,15) :type figure_size: tuple, optional :param linewidth: Linewidth on the graph (matplotlib format), defaults to 2. :type linewidth: float, optional :param plotting_style: Plotting style (matplotlib format), defaults to 'line' :type plotting_style: Literal['scatter','line', 'combined'], optional .. py:method:: plot_hydrograph_nodes(which_nodes: list[int] = [0, -1], save_as: str = '', figure_size=(25, 15)) This method is deprecating. Plot nodes evolution provides more flexibility Plot the evolution in time of the discharge. :param which_nodes: _description_, defaults to [0,-1] :type which_nodes: list[int], optional :param save_as: file path, defaults to '' :type save_as: str, optional :param figure_size: Figure size, defaults to (25,15) :type figure_size: tuple, optional .. py:class:: MultipleWolfresults_1D(simulations: list[str], model_index: int = 0, figures: list[Literal[water level, discharge, wetted section, water depth, velocity, froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude'], time_step: int = -1, banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (25, 15), alpha=0.3, line_width=2.0, show=False) This class is used to plot multiple Wolf 1D results on the same figure. It is a wrapper around Wolfresults_1D class. The main goal is to plot the temporal and spatial evolution of the water level, discharge, wetted section, water depth, velocity and Froude Number for different simulations. .. py:method:: create_graph(show_landmarks=False) Create the initial figure on which other simulated results will be added. :param show_landmarks: Show landmarks, defaults to False :type show_landmarks: bool, optional .. py:method:: plot_variable_lines() Add other simulated results as lines. .. py:method:: __plot_variable_lines(names: list[Literal[water level, discharge, wetted section, water depth, velocity, froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude']) Plot variable lines. :param names: Names, defaults to ['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude'] :type names: list[Literal['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude']], optional .. py:method:: _update_landmark(ax: matplotlib.axes.Axes, name: str, ymax: float) Update the landmark. :param ax: Axes :type ax: Axes :param name: Name :type name: str :param ymax: Y max :type ymax: float .. py:method:: plot_water_levels() Deprecated Plot water levels. .. py:method:: plot_water_depths() Deprecated Plot water depths. .. py:method:: plot_discharges() Deprecated Plot discharges. .. py:method:: plot_wetted_sections() Deprecated Plot wetted sections. .. py:method:: plot_velocities() Deprecated Plot velocities. .. py:method:: plot_froudes() Deprecated Plot froudes. .. py:method:: plot_one_results(model_index: int = 0, time_step: int = -1, figures: list[Literal[water level, discharge, wetted section, water depth, velocity, froude]] = ['water level', 'discharge', 'wetted section', 'water depth', 'velocity', 'froude'], banksbed: Union[str, wolfhece.PyVertexvectors.Zones] = '', landmark: Union[str, wolfhece.PyVertexvectors.Zones] = '', save_as: str = '', figsize: tuple = (25, 15), alpha=0.3, grid_x_m: float = 1000.0, grid_y_m: float = 10.0, convert_step=True, steps_limit=False) Plot one results. :param model_index: Model index, defaults to 0 :type model_index: int, optional :param time_step: Time step, defaults to -1 :type time_step: int, optional :param figures: Figures, defaults to ['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude'] :type figures: list[Literal['water level', 'discharge', 'wetted section','water depth', 'velocity', 'froude']], optional :param banksbed: Banksbed, defaults to '' :type banksbed: Union[str, Zones], optional :param landmark: Landmark, defaults to '' :type landmark: Union[str,Zones], optional :param save_as: Save as, defaults to '' :type save_as: str, optional :param figsize: Figure size, defaults to (25,15) :type figsize: tuple, optional :param alpha: Alpha, defaults to 0.3 :type alpha: float, optional :param grid_x_m: Grid x m, defaults to 1000. :type grid_x_m: float, optional :param grid_y_m: Grid y m, defaults to 10. :type grid_y_m: float, optional :param convert_step: Convert step, defaults to True :type convert_step: bool, optional :param steps_limit: Steps limit, defaults to False :type steps_limit: bool, optional .. py:class:: ModifyParams(simulation_folder: str = '') Modify the parameters of an existing simulation using the Wolf_Param module. .. py:method:: find_simulation_file(file_extension: str, folder: str = '') Find a simulation file in a simulation folder based on the file extension. .. note:: FIXME: Insert a checking test for double files with the same extension. :param file_extension: File extension :type file_extension: str :param folder: Folder, defaults to '' :type folder: str, optional :return: File path :rtype: str .. py:method:: modify_params_existing_simulation(simulation_folder: str = '', parent=None, w: int = 460, h: int = 560, ontop: bool = False, to_read: bool = True, withbuttons: bool = True, DestroyAtClosing: bool = True, toShow: bool = True, init_GUI: bool = True, force_even_if_same_default: bool = False) Modify the parameters of an existing simulation using the Wolf_Param module. :param simulation_folder: Simulation folder, defaults to '' :type simulation_folder: str, optional :param parent: Parent, defaults to None :type parent: None, optional :param w: Width, defaults to 460 :type w: int, optional :param h: Height, defaults to 560 :type h: int, optional :param ontop: Ontop, defaults to False :type ontop: bool, optional :param to_read: To read, defaults to True :type to_read: bool, optional :param withbuttons: Withbuttons, defaults to True :type withbuttons: bool, optional :param DestroyAtClosing: DestroyAtClosing, defaults to True :type DestroyAtClosing: bool, optional :param toShow: To show, defaults to True :type toShow: bool, optional :param init_GUI: Init GUI, defaults to True :type init_GUI: bool, optional :param force_even_if_same_default: Force even if same default, defaults to False :type force_even_if_same_default: bool, optional .. py:method:: run_simulation(simulation_folder: str = '') Run a wolf model with the .bat file in the simulation folder. :param simulation_folder: Simulation folder, defaults to '' :type simulation_folder: str, optional .. py:method:: run_bat_files(bat_file: str) Run the .bat file in a Window's shell to start the computations (simulation). :param bat_file: Bat file :type bat_file: str .. py:method:: get_last_name_of_path(path_string: str) Get the last folder or file of a path. :param path_string: Path string :type path_string: str :return: Last folder :rtype: str