wolfhece.hydrology.Internal_variables

Module Contents

wolfhece.hydrology.Internal_variables.ALL_VAR = 0[source]
wolfhece.hydrology.Internal_variables.IV_VAR = 1[source]
wolfhece.hydrology.Internal_variables.FRAC_VAR = 2[source]
wolfhece.hydrology.Internal_variables.FINAL_OUT_VAR = 3[source]
wolfhece.hydrology.Internal_variables.OUT_VAR = 4[source]
wolfhece.hydrology.Internal_variables.DEFAULT_VAR = 5[source]
class wolfhece.hydrology.Internal_variables.Internal_Variable[source]

Class for managing internal variables in hydrological models.

name: str[source]
file: str[source]
type_of_var: int[source]
linked_param: int[source]
get_time_serie(directory, prefix_file: str = '', interval: tuple[datetime.datetime, datetime.datetime] | None = None) tuple[numpy.ndarray, numpy.ndarray][source]

Get the time series of the internal variable.

Parameters:

interval – Optional interval for the time series.

Returns:

Time series of the internal variable.

get_filename(directory: str, prefix: str = '') tuple[str, str][source]

Get the filename of the internal variable.

Parameters:
  • directory – Directory where the file is located.

  • prefix – Prefix for the filename.

Returns:

Tuple containing the name of the file only and the full path of the internal variable.

class wolfhece.hydrology.Internal_variables.Param_to_Activate(key: str = '', group: str = '', file: str = '', all_variables: list[Internal_Variable] = [])[source]

Class for managing parameters to activate in hydrological models.

key: str[source]
group: str[source]
file: str[source]
all_variables: list[Internal_Variable][source]
add_param_info(key: str, group: str, file: str)[source]

Add parameter information to the class.

check_param_file(directory: str)[source]

Define the working directory for the parameters.

add_variable(variable: Internal_Variable | list[Internal_Variable])[source]

Add one or a list of internal variable(s) to the list of variables.

get_variables_names() list[str][source]

Get the names of the internal variables.

get_variables_files() list[str][source]

Get the files of the internal variables.

activate(directory: str, prefix_file: str = '', type_of_var: int = ALL_VAR)[source]

Activate the parameters for the internal variables.

deactivate(directory: str, prefix_file: str = '')[source]

Deactivate the parameters for the internal variables.

get_iv_timeseries(directory: str, prefix_file: str = '', interval: tuple[datetime.datetime, datetime.datetime] | None = None, type_of_var: int = ALL_VAR) dict[str, numpy.ndarray][source]

Get the time series of the internal variables.

Parameters:
  • directory – Directory where the file is located.

  • prefix_file – Prefix for the filename.

  • interval – Optional interval for the time series.

Returns:

List of tuples containing the time and internal variable data.

get_linked_params() dict[str, int][source]

Get the linked parameters of the internal variables.

Returns:

Dictionary of linked parameters.

_build_prefix(prefix_file: str) str[source]

Build the prefix for the filename.

Parameters:

prefix_file – Prefix for the filename.

Returns:

Prefix for the filename.

class wolfhece.hydrology.Internal_variables.Group_to_Activate(name: str = '', all_params: list[Param_to_Activate] = [])[source]

Class for managing groups of parameters to activate in hydrological models.

name: str[source]
all_params: list[Param_to_Activate][source]
get_keys() list[str][source]

Get the keys of the parameters.

get_files_per_keys() list[str][source]

Get the files of the parameters.

activate_all(directory: str, prefix_file: str = '', type_of_var: int = ALL_VAR)[source]

Activate all parameters in the group.

deactivate_all(directory: str, prefix_file: str = '')[source]

Deactivate all parameters in the group.

get_all_iv_timeseries(directory: str, prefix_file: str = '', interval: tuple[datetime.datetime, datetime.datetime] | None = None, type_of_var: int = ALL_VAR) dict[str, numpy.ndarray][source]

Get the time series of all internal variables in the group.

Parameters:
  • directory – Directory where the file is located.

  • prefix_file – Prefix for the filename.

  • interval – Optional interval for the time series.

Returns:

List of tuples containing the time and internal variable data.

get_all_linked_params() dict[str, int][source]

Get the linked parameters of the internal variables.

Returns:

Dictionary of linked parameters.