Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Once the model has been calibrated (i.e. that the best fit of the calibration process has been found), the only work left is exporting all the relevant results to external files which can be then shared with other modelers or used by third party software.
To begin with, we can export a summary of the calibration process, containing the parameter values which have been used and the goodness of the fit which was obtained with them.
Code Block | ||||
---|---|---|---|---|
| ||||
ExportListToCsvFile(rootPath + r"\calibration.csv", listCalibration, ["BC value", "Roughness", "Average deviation"], delimiterChar = ",") |
You can also export the time series corresponding to the results of the best fit.
Code Block | ||||
---|---|---|---|---|
| ||||
ExportListToCsvFile(rootPath + r"\bestFit.csv", timeSeriesToCompare[indexBestFit], ["Time", "Water level at Gauging station"]) |
You can also export all the time series found during the calibration to different respective files, indicating which one is the best fit.
Code Block | ||||
---|---|---|---|---|
| ||||
index = 0 for ts in timeSeriesToCompare: if index == 0: flag = " Initial set up " elif index == indexBestFit: flag = " best fit " else: flag = " " fileName = rootPath + r"\Water Level at Gauging Station case " + str(index) + flag + ".csv" ExportListToCsvFile(fileName, ts, ["Time", "Water level at Gauging station"], ",") index += 1 |
Finally, also the plots produced during the calibration process can be saved to external image files. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
chartCalibration.ExportAsImage(rootPath + r"\Calibration.png",1250,650) |
This is the end of the SOBEK 3 scripting tutorial.