smash.Model.rr_final_states#

property Model.rr_final_states[source]#

Model rainfall-runoff final states.

Returns:
rr_final_statesRR_StatesDT

It returns a Fortran derived type containing the variables relating to the rainfall-runoff final states.

See also

Model.get_rr_final_states

Get the values of a Model rainfall-runoff final state.

Examples

>>> from smash.factory import load_dataset
>>> setup, mesh = load_dataset("cance")
>>> model = smash.Model(setup, mesh)

Access to Model rainfall-runoff final states

>>> model.rr_final_states
RR_StatesDT
    keys: array(['hi', 'hp', 'ht', 'hlr'], dtype='<U3')
    values: array([[[-99., -99., -99., -99.],
        [-99., -99., -99., -99.],
        ...
        [-99., -99., -99., -99.]]], dtype=float32)

Run the direct Model to generate rainfall-runoff final states

>>> model.forward_run()
</> Forward Run

Access to a specific rainfall-runoff final state grid with the getter method get_rr_final_states

>>> model.get_rr_final_states("hp")
array([[-99.        , -99.        , -99.        , -99.        ,
        -99.        , -99.        , -99.        , -99.        ,
        -99.        , -99.        , -99.        , -99.        ,
          0.8682228 ,   0.88014543, -99.        , -99.        ,
        ...
        -99.        , -99.        , -99.        , -99.        ]],
      dtype=float32)

Note

Unlike rainfall-runoff initial states, there is no setter for rainfall-runoff final states. They are generated after any kind of simulation (i.e. forward_run, optimize, …)

If you are using IPython, tab completion allows you to visualize all the attributes and methods

>>> model.rr_final_states.<TAB>
model.rr_final_states.copy()        model.rr_final_states.keys
model.rr_final_states.from_handle(  model.rr_final_states.values