ErmSimulation¶
Runs the water budget model over a period with a fixed set of parameters, usually the ones found by the calibration, and shows a chart of the simulated against the observed discharge, with their KGE. Running it on a period different from the calibration one validates the calibrated parameters.
Parameters¶
Last step of the ERM/GeoFrame water budget workflow: runs the water budget model with a given set of parameters, usually the ones found by the calibration, and shows the simulated against the observed discharge, with their Kling-Gupta efficiency.
Toolbox folder: GeoFrame
Status: Certified
Keywords: ERM, GeoFrame, simulation, water budget
Authors: Andrea Antonello
Class: org.hortonmachine.hmachine.geoframe.ermworkflow.ErmSimulation
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
GeoPackage file |
The GeoFrame database, with all the inputs prepared by the previous steps of the workflow. |
||
|
String |
Start of the simulated period. Format: yyyy-MM-dd HH:mm:ss, in UTC. |
||
|
String |
End of the simulated period. Format: yyyy-MM-dd HH:mm:ss, in UTC. |
||
|
int |
min |
|
Length of the time step: 60 for hourly data, 1440 for daily data. |
|
int |
days |
|
Days at the start of the period used only to warm up the model storages, excluded from the evaluation against the observations. |
|
boolean |
|
If true, model state is written to the database at each time step. |
|
|
double[] |
The 18 model parameters, in the order reported by the calibration. |
References
Gupta, H. V., Kling, H., Yilmaz, K. K., Martinez, G. F. (2009). Decomposition of the mean squared error and NSE performance criteria: implications for improving hydrological modelling. Journal of Hydrology, 377(1-2), 80-91.
Example¶
import org.hortonmachine.hmachine.geoframe.ermworkflow.ErmSimulation;
// the folder containing the input data: change it to yours
var workspace = "/data/COURSE_WATER/"
var sim = new ErmSimulation();
sim.inGeopackagePath = workspace + "outputs/geoframe_data.gpkg"
sim.inFromTimestamp = "2020-01-01 01:00:00"
sim.inToTimestamp = "2023-12-31 01:00:00"
sim.pTimeStepMinutes = 60 * 24
sim.pSpinUpDays = 365
// from calibration
sim.inParams = new double[]{
1.1614983901587717, 1.4969306351817795, 2.9830333245670695, 1.808081781219844, 2.3745699575399704E-4, 0.49980203055182526, 0.14335399499928275, 0.9799932714777185, 40.000572352728085, 2.9999425942946267, 0.8000772403354526, 2.9995843441109766, 99.99909451256433, 4.999999347303716, 0.9999592410245134, 100.12398303724608, 0.01159196273045821, 0.9999999727806498
}
sim.process();
The simulation run in the Geoscript Console, with the parameters of the calibration: at the end, the chart of the simulated against the observed discharge, and their KGE.¶
The results in the database¶
Each simulation writes the simulated discharge of every sub-basin to a new table of the GeoFrame database, named after the time of the run: sim<date>_<time>_water_budget_simulation_discharge. Runs with different parameters or periods can so be compared later. With doWriteState, the state of the model at each time step is written too, in a sim<date>_<time>_water_budget_state table.
The results can be explored in the Database Viewer. When it opens the database, the GeoFrame icon in front of its name shows that it has been recognized as a GeoFrame database, which enables the GeoFrame actions in the context menus of its tables. Right-click on a simulation table and choose Open ERM Simulation Chart: for a sub-basin, the chart panel shows its precipitation and temperature, and below them its simulated discharge against the observed one. The map on the right shows the sub-basins, numbered by their id, with the network and the shown sub-basin highlighted: activate the arrow tool and click on another sub-basin to chart it.
The GeoFrame database in the Database Viewer, recognized by the GeoFrame icon, and the ERM simulation chart opened on a simulation table: precipitation and temperature, simulated and observed discharge of the selected sub-basin, and the map to select the sub-basin.¶
In the same way, Open Station Data Chart on the station_data table and Open Basin Data Chart on the basin_data table chart the measured data of the stations and the input data of the sub-basins: see ErmStationDataImporter and ErmPrestleyEt.