Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML
<script type="text/javascript">
    
 AJS.toInit(function() {
 // unbind directly-embedded images
 AJS.$("img.confluence-embedded-image").unbind("click.fb");
 });
 </script>

scrollbar

Once the model has been calibrated (i.e. 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
languagepy
titleExport list with calibration summary to csv file
 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
languagepy
titleExport single time series to a csv file
 ExportListToCsvFile(rootPath + r"\bestFit.csv", timeSeriesToCompare[indexBestFit], ["Time", "Water level at Gauging station"])

You can equally export all All the time series found during the calibration can be exported to different respective files, indicating in the file name which one is corresponds to the best fit.

Code Block
languagepy
titleExport multiple time series to multiple files
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
languagepy
titleExport figures as image files
  chartCalibration.ExportAsImage(rootPath + r"\Calibration.png",1250,650)

 

This is the end of the SOBEK 3 scripting tutorial.

scrollbar