:py:mod:`wolfhece.hydrology.Internal_variables` =============================================== .. py:module:: wolfhece.hydrology.Internal_variables Module Contents --------------- .. py:data:: ALL_VAR :value: 0 .. py:data:: IV_VAR :value: 1 .. py:data:: FRAC_VAR :value: 2 .. py:data:: FINAL_OUT_VAR :value: 3 .. py:data:: OUT_VAR :value: 4 .. py:data:: DEFAULT_VAR :value: 5 .. py:class:: Internal_Variable Class for managing internal variables in hydrological models. .. py:attribute:: name :type: str .. py:attribute:: file :type: str .. py:attribute:: type_of_var :type: int .. py:attribute:: linked_param :type: int .. py:method:: get_time_serie(directory, prefix_file: str = '', interval: Optional[tuple[datetime.datetime, datetime.datetime]] = None) -> tuple[numpy.ndarray, numpy.ndarray] Get the time series of the internal variable. :param interval: Optional interval for the time series. :return: Time series of the internal variable. .. py:method:: get_filename(directory: str, prefix: str = '') -> tuple[str, str] Get the filename of the internal variable. :param directory: Directory where the file is located. :param prefix: Prefix for the filename. :return: Tuple containing the name of the file only and the full path of the internal variable. .. py:class:: Param_to_Activate(key: str = '', group: str = '', file: str = '', all_variables: list[Internal_Variable] = []) Class for managing parameters to activate in hydrological models. .. py:attribute:: key :type: str .. py:attribute:: group :type: str .. py:attribute:: file :type: str .. py:attribute:: all_variables :type: list[Internal_Variable] .. py:method:: add_param_info(key: str, group: str, file: str) Add parameter information to the class. .. py:method:: check_param_file(directory: str) Define the working directory for the parameters. .. py:method:: add_variable(variable: Internal_Variable | list[Internal_Variable]) Add one or a list of internal variable(s) to the list of variables. .. py:method:: get_variables_names() -> list[str] Get the names of the internal variables. .. py:method:: get_variables_files() -> list[str] Get the files of the internal variables. .. py:method:: activate(directory: str, prefix_file: str = '', type_of_var: int = ALL_VAR) Activate the parameters for the internal variables. .. py:method:: deactivate(directory: str, prefix_file: str = '') Deactivate the parameters for the internal variables. .. py:method:: get_iv_timeseries(directory: str, prefix_file: str = '', interval: Optional[tuple[datetime.datetime, datetime.datetime]] = None, type_of_var: int = ALL_VAR) -> dict[str, numpy.ndarray] Get the time series of the internal variables. :param directory: Directory where the file is located. :param prefix_file: Prefix for the filename. :param interval: Optional interval for the time series. :return: List of tuples containing the time and internal variable data. .. py:method:: get_linked_params() -> dict[str, int] Get the linked parameters of the internal variables. :return: Dictionary of linked parameters. .. py:method:: _build_prefix(prefix_file: str) -> str Build the prefix for the filename. :param prefix_file: Prefix for the filename. :return: Prefix for the filename. .. py:class:: Group_to_Activate(name: str = '', all_params: list[Param_to_Activate] = []) Class for managing groups of parameters to activate in hydrological models. .. py:attribute:: name :type: str .. py:attribute:: all_params :type: list[Param_to_Activate] .. py:method:: get_keys() -> list[str] Get the keys of the parameters. .. py:method:: get_files_per_keys() -> list[str] Get the files of the parameters. .. py:method:: activate_all(directory: str, prefix_file: str = '', type_of_var: int = ALL_VAR) Activate all parameters in the group. .. py:method:: deactivate_all(directory: str, prefix_file: str = '') Deactivate all parameters in the group. .. py:method:: get_all_iv_timeseries(directory: str, prefix_file: str = '', interval: Optional[tuple[datetime.datetime, datetime.datetime]] = None, type_of_var: int = ALL_VAR) -> dict[str, numpy.ndarray] Get the time series of all internal variables in the group. :param directory: Directory where the file is located. :param prefix_file: Prefix for the filename. :param interval: Optional interval for the time series. :return: List of tuples containing the time and internal variable data. .. py:method:: get_all_linked_params() -> dict[str, int] Get the linked parameters of the internal variables. :return: Dictionary of linked parameters.