Model Processing¶
-
class
pyfuse.pyFUSE(name, OPTIONS, PARS, RAIN, EVAPO, CONST, INITFRAC=0.1, oldfile=False)[source]¶ Create pyFUSE hydrological model, a python version and extention of the FORTRAN FUSE model environment by Clarke, 2008 [1] This is not a wrapper of the Fortran implementation of Clark, but a complete rewrite of the original code in order to make further extensions easier.
Parameters: name: str
A given name for the constructed model structure
OPTIONS: dict
Dictionary with the model options for construction
PARS: dict
Dictionary of parameters used for the model evaluation, coming from input parameter file
RAIN: array
numpy array containting the rainfall data
EVAPO: array
numpy array containting the potential evapotranspiration data, with same time frame and resolution as the rain
CONST: dict
dictionary of neede constant values for the model configuration and calculation
INITFRAC: float
fraction of maximum storage used as initial condition
References
[1] Clark, Martyn P., A. G. Slater, D. E. Rupp, R. A. Woods, Jasper A. Vrugt, H. V. Gupta, Thorsten Wagener, and L. E. Hay. Framework for Understanding Structural Errors (FUSE): A modular framework to diagnose differences between hydrological models. Water Resources Research 44 (2008): 14.
-
array_output(outname, outtype='FLUX', run_id='testrun')[source]¶ Get output array of the selected outname; fluxes in mm/hour, states in mm and pars in the given units
Parameters: outtype: str
one of these values: ‘FLUX’, ‘STATE’ or ‘PAR’
outname: str
the specific flux/stae of par needed
run_id: str
name of the run_id to get the flow from
Returns: output: array
output of the specified model output
-
clean_outputs(todelete)[source]¶ Delete the none interesting output groups and the related datasets
Parameters: todelete: list
list of strings with the groups to delete
-
load_new_pars(inff=None)[source]¶ Load a parameter set from a input parameter file or dict and put in parameter dictionary or load them from the pars given in dict
Currently only from file is supported, directly passing a dictionary should also be possible and will be implemented
Parameters: inff: str
name of the input parameter file
-
run(custom_period=None, new_pars=False, run_id='testrun')[source]¶ Run the model!
Parameters: custom_period:
calculate the model for a specific subperiod of the total data lenght
new_pars: str
textfile of the new parameters used to (re)run the model or a dictionary
run_id: str
used to identify the outputs of the specific modelrun, if nothing given, a testrun-group is added
-
Monte Carlo Runs¶
run_MC(nruns)¶When the model is constructed with the parameters according to the defined ranges, Monte Carlo simulations can be performed using the run_MC(number of runs) command
Re-Load an existing model structure¶
-
pyfuse.Load_model(hdffile, parfile)[source]¶ Load an old model run and set up the model
Parameters: hdffile: HDF5 file
previous simulation outputs file to re-use
parfile: parameter textfile
parameterfile of the model under consideration
Returns: pyFUSE_Model: model instance
loaded model to do calculations
See also
pyFUSE.Set_pars- Loading in parameter sets example of input parameter file