plans.hydrology.upscaled#

{Short module description (1-3 sentences)} todo docstring

Features#

todo docstring

  • {feature 1}

  • {feature 2}

  • {feature 3}

  • {etc}

Overview#

todo docstring {Overview description}

Examples#

todo docstring {Examples in rST}

Print a message

# print message
print("Hello world!")
# [Output] >> 'Hello world!'

Classes

LSFAS([name, alias])

Rainfall-Runoff-Evaporation model based on Linear Storage and Fill-And-Spill (FAS) mechanism.

LSRR([name, alias])

Rainfall-Runoff model based on a Linear Storage.

LSRRE([name, alias])

Rainfall-Runoff-Evaporation model based on a Linear Storage.

LinearStorage([name, alias])

Linear Storage Model.

UpscaledModel([name, alias])

This is a global Rainfall-Runoff model.

class plans.hydrology.upscaled.LinearStorage(name='MyLinearStorage', alias='LS01')[source]#

Bases: Model

Linear Storage Model. This is a Toy Model. No inflow, only outflows. Simulates storage decay only.

__init__(name='MyLinearStorage', alias='LS01')[source]#

Initialize the DataSet object.

Parameters:
  • name (str) – unique object name

  • alias (str) – unique object alias. If None, it takes the first and last characters from name

_set_model_vars()[source]#
_set_model_params()[source]#

Intenal method for setting up model parameters data

Returns:

None

Return type:

None

setter(dict_setter)[source]#

Set selected attributes based on an incoming dictionary. This is calling the superior method using load_data=False.

Parameters:

dict_setter (dict) – incoming dictionary with attribute values

Returns:

None

Return type:

None

load_params()[source]#

Load parameter data from parameter file (stored in self.file_params)

Warning

This method overwrites model data.

Returns:

None

Return type:

None

load_data()[source]#

Load simulation data from folder data (stored in self.folder_data). Overwrites superior methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

setup()[source]#

Set model simulation.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

solve()[source]#

Solve the model for inputs and initial conditions by numerical methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

get_evaldata()[source]#
evaluate()[source]#

Evaluate model metrics.

Returns:

None

Return type:

None

export(folder, filename, views=False)[source]#

Export object resources.

Parameters:
  • folder (str) – path to folder

  • filename (str) – file name without extension

Returns:

None

Return type:

None

view(show=True)[source]#

Get the basic visualization.

Parameters:

show (bool) – option for showing instead of saving.

Note

Uses values in the view_specs() attribute for plotting.

class plans.hydrology.upscaled.LSRR(name='MyLSRR', alias='LSRR001')[source]#

Bases: LinearStorage

Rainfall-Runoff model based on a Linear Storage. This is a Toy Model. Inflow rain (P) in a necessary data inputs.

__init__(name='MyLSRR', alias='LSRR001')[source]#

Initialize the DataSet object.

Parameters:
  • name (str) – unique object name

  • alias (str) – unique object alias. If None, it takes the first and last characters from name

_set_model_params()[source]#

Intenal method for setting up model parameters data

Returns:

None

Return type:

None

_set_model_vars()[source]#
_set_view_specs()[source]#

Set view specifications. Expected to increment superior methods.

Returns:

None

Return type:

None

setter(dict_setter)[source]#

Set selected attributes based on an incoming dictionary. This is calling the superior method using load_data=False.

Parameters:

dict_setter (dict) – incoming dictionary with attribute values

Returns:

None

Return type:

None

load_data()[source]#

Load input simulation data. Expected to overwrite superior methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

setup()[source]#

Set model simulation data.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

solve()[source]#

Solve the model for inputs and initial conditions by numerical methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

view(show=True, return_fig=False)[source]#

Get the basic visualization.

Parameters:

show (bool) – option for showing instead of saving.

Note

Uses values in the view_specs() attribute for plotting.

class plans.hydrology.upscaled.LSRRE(name='MyLSRRE', alias='LSRRE001')[source]#

Bases: LSRR

Rainfall-Runoff-Evaporation model based on a Linear Storage. This is a Toy Model. Inflow rain (P) and outflow potential evaporation (E_pot) are necessary data inputs.

__init__(name='MyLSRRE', alias='LSRRE001')[source]#

Initialize the DataSet object.

Parameters:
  • name (str) – unique object name

  • alias (str) – unique object alias. If None, it takes the first and last characters from name

_set_model_vars()[source]#
setup()[source]#

Set model simulation.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

solve()[source]#

Solve the model for inputs and initial conditions by numerical methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

view(show=True, return_fig=False)[source]#

Get the basic visualization.

Parameters:

show (bool) – option for showing instead of saving.

Note

Uses values in the view_specs() attribute for plotting.

class plans.hydrology.upscaled.LSFAS(name='MyLSFAS', alias='LSFAS001')[source]#

Bases: LSRRE

Rainfall-Runoff-Evaporation model based on Linear Storage and Fill-And-Spill (FAS) mechanism. Inflow rain (P) and potential evapotranspiration (E_pot) are necessary data inputs.

__init__(name='MyLSFAS', alias='LSFAS001')[source]#

Initialize the DataSet object.

Parameters:
  • name (str) – unique object name

  • alias (str) – unique object alias. If None, it takes the first and last characters from name

_set_model_vars()[source]#
_set_model_params()[source]#

Intenal method for setting up model parameters data

Returns:

None

Return type:

None

setup()[source]#

Set model simulation.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

solve()[source]#

Solve the model for inputs and initial conditions by numerical methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

view(show=True, return_fig=False)[source]#

Get the basic visualization.

Parameters:

show (bool) – option for showing instead of saving.

Note

Uses values in the view_specs() attribute for plotting.

class plans.hydrology.upscaled.UpscaledModel(name='MyGlobal', alias='Glo001')[source]#

Bases: LSFAS

This is a global Rainfall-Runoff model. Simulates the the catchment as if is a global system. Expected inputs:

  • clim.csv for Precipitation (P) and Potential Evapotranspiration (E_pot).

  • path_areas.csv for deriving the geomorphic unit hydrograph.

# todo [major docstring] examples

__init__(name='MyGlobal', alias='Glo001')[source]#

Initialize the DataSet object.

Parameters:
  • name (str) – unique object name

  • alias (str) – unique object alias. If None, it takes the first and last characters from name

_set_model_vars()[source]#
_set_model_params()[source]#

Intenal method for setting up model parameters data

Returns:

None

Return type:

None

_set_view_specs()[source]#

Set view specifications. Expected to increment superior methods.

Returns:

None

Return type:

None

setter(dict_setter)[source]#

Set selected attributes based on an incoming dictionary. This is calling the superior method using load_data=False.

Parameters:

dict_setter (dict) – incoming dictionary with attribute values

Returns:

None

Return type:

None

get_basins_list()[source]#
_setup_tah()[source]#
_setup_guh()[source]#
_setup_start()[source]#
_setup_params()[source]#
_setup_steps()[source]#
load_data()[source]#

Load simulation data. Expected to increment superior methods.

Returns:

None

Return type:

None

setup()[source]#

Set model simulation.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

solve()[source]#

Solve the model for inputs and initial conditions by numerical methods.

Warning

This method overwrites model data.

Returns:

None

Return type:

None

export(folder, filename, views=False, mode=None)[source]#

Export object resources. Expected to be called after setup.

Parameters:
  • folder (str) – path to folder

  • filename (str) – file name without extension

Returns:

None

Return type:

None

view(show=True, return_fig=False, mode=None, basin=None)[source]#

Get the basic visualization.

Parameters:

show (bool) – option for showing instead of saving.

Note

Uses values in the view_specs() attribute for plotting.

static propagate_inflow(inflow, unit_hydrograph)[source]#

Flow routing model based on provided unit hydrograph. Inflow and Unit Hydrograh arrays are expected to be the same size. # todo [feature] improve so it can handle a smaller Unit Hydrograph (using slicing, etc)

Parameters:
  • inflow (numpy.ndarray) – 1d numpy array of inflow

  • unit_hydrograph (numpy.ndarray) – 1d numpy array of Unit Hydrograph (sum=1)

Returns:

outflow array

Return type:

numpy.ndarray

static compute_s_uf_shutdown(s_uf_cap, s_uf_a)[source]#
static compute_sof_a_eff(s_uf_cap, s_of_a)[source]#
static compute_d(g_cap, g)[source]#
static compute_dv(d, v)[source]#
static compute_ec(e_c_pot, e_c_cap)[source]#
static compute_ec_pot(e_pot)[source]#
static compute_ec_cap(c, dt)[source]#
static compute_et(e_t_pot, e_t_cap)[source]#
static compute_et_f(dv, d_et_a)[source]#
static compute_et_pot(e_pot, ec)[source]#
static compute_et_cap(e_t_f, g, g_et_cap, dt)[source]#
static compute_es(e_s_pot, e_s_cap)[source]#
static compute_es_pot(e_pot, ec, et)[source]#
static compute_es_cap(s, dt)[source]#
static compute_tf(p_tf_cap, p_tf_f)[source]#
static compute_tf_f(c, ca)[source]#
static compute_tf_cap(c, ca, p, dt)[source]#
static compute_sf_pot(c, ca)[source]#
static compute_ps(sf, tf)[source]#
static compute_pc(p, tf_f)[source]#
static compute_e_discount(storage, discount)[source]#
static compute_sof_cap(s, sof_a)[source]#
static compute_qof_f(sof_cap, sof_c)[source]#
static compute_qof_cap(sof_cap, ps, dt)[source]#
static compute_qof_pot(qof_cap, qof_f)[source]#
static compute_suf_cap(s, suf_a, shutdown)[source]#
static compute_quf_f(suf_cap, suf_c)[source]#
static compute_quf_cap(suf_cap, dt)[source]#
static compute_quf_pot(quf_cap, quf_f)[source]#
static compute_qif_pot_up(s, sk, dt)[source]#
static compute_qif_pot_down(d, v, dt)[source]#
static compute_qif_pot(if_down, if_up)[source]#
static compute_qvf_f(d, v)[source]#
static compute_qvf_pot(qvf_f, kv, dt)[source]#
static compute_qvf_cap(v, dt)[source]#
static compute_qvf(qvf_pot, qvf_cap)[source]#
static compute_qgf(g, get_cap, gk, dt)[source]#
static compute_next_c(c, pc, sf)[source]#
static compute_next_s(s, ps, qof, quf, qif)[source]#
static compute_next_v(v, qif, qvf)[source]#
static compute_next_g(g, qvf, qgf)[source]#
static compute_e(ec, es, eg)[source]#
static compute_qhf(qof, quf, qgf)[source]#
static demo()[source]#