Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
In this step, we will retreive the measured data from the file waterLevel_at_GaugingStation.csv as a time series. The function GetTimeSeriesFromCSVFile Image Removed within the StandardFunctions library accomplishes this task, and returns a time series, which is a list composed by pairs of elements [datetime, value].
Code Block | ||||
---|---|---|---|---|
| ||||
measuredTimeSeries = GetTimeSeriesFromCSVFile(rootPath + "\waterLevel_at_GaugingStation.csv") |
Since the model has already been run, we can now obtain the water level time series at the calculation point Gauging Station (the same point where the imported data was measured ). This is done with the functions GetComputationGridLocationByName Image Removed and GetTimeSeriesFromWaterFlowModel Image Removed.
Code Block | ||||
---|---|---|---|---|
| ||||
calculationPoint = GetComputationGridLocationByName(flowModel, "Gauging Station")
waterlevelResults = GetTimeSeriesFromWaterFlowModel(flowModel, calculationPoint, "Water level") |
Note: The icon Image Removed indicates functions that you might find interesting to see how they have been built. You can do this by opening the corresponding library (another normal script python file on its own) in the toolbox and checking the code which defines the function or method you are interested in.
HTML |
---|
<script type="text/javascript">
AJS.toInit(function() {
// unbind directly-embedded images
AJS.$("img.confluence-embedded-image").unbind("click.fb");
});
</script> |
scrollbar |
---|
Create a new region for this section.
In this step, we will retreive the measured data from the file waterLevel_at_GaugingStation.csv as a time series. The function GetTimeSeriesFromCSVFile within the StandardFunctions Sobek2Functions library accomplishes this task, and returns a time series, which is a list composed by pairs of elements [datetime, value]. Details about the formatting for date and time can be found at https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior.scrollbar
Code Block | ||||
---|---|---|---|---|
| ||||
from Libraries.Sobek2Functions import * # Region Import libraries measuredTimeSeries = GetTimeSeriesFromCSVFile(rootPath + "\waterLevel_at_GaugingStation.csv", dateTimeFormat ="%d-%b-%y %H:%M:%S") |
Since the model has already been run, we can now obtain the water level time series at the calculation point Gauging Station (the same point location where the imported data was has been measured). This is done with the functions GetComputationGridLocationByName and
GetTimeSeriesFromWaterFlowModel
GetComputationGridLocationByName Image Added and GetTimeSeriesFromWaterFlowModel Image Added.
Code Block | ||||
---|---|---|---|---|
| ||||
calculationPoint = GetComputationGridLocationByName(flowModel, "Gauging Station") waterlevelResults = GetTimeSeriesFromWaterFlowModel(flowModel, calculationPoint, "Water level") |
Note: The icon indicates functions that you might find interesting to see how they have been built. You can do this by opening the corresponding library (another normal script python file on its own) in the toolbox and checking the code which defines the function or method you are interested in.
scrollbar |
---|