Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

scrollbar

 

Now that the model has run we can access the generated output. We start by getting the waterlevel timeseries for the observation point, by using the GetFlowFlexibleMeshTimeSeries function and passing the model, name of the output and the feature (observation point) to it.

Code Block
languagepy
titleGet timeseries for observation point
waterlevelSeries = GetFlowFlexibleMeshTimeSeries(fmModel, "Water level (waterlevel)", observationPoint)

 

Now we have a list of [datetime, value] that we can plot. To create a chart we start by import the ChartFunctions library and creating an area series for our timeseries.

Code Block
languagepy
titleCreate area series
from Libraries.ChartFunctions import *

areaSeries = CreateAreaSeries(waterlevelSeries)

 

With the areaSeries we create the chart and open a view for the chart.

Code Block
languagepy
titleCreate chart and open view
chart = CreateChart([areaSeries])
chart.Name = "Waterlevel at observation point"

OpenView(chart)

 

 

The chart is still a bit basic and missing some information, so we are going to edit the chart.

Code Block
titleImprove chart layout
areaSeries.Color = Color.CadetBlue
areaSeries.Title = "Waterlevel at observation point"observationPoint.Name
areaSeries.LineVisible = False
areaSeries.PointerVisible = False

chart.Legend.Visible = True
chart.Legend.Alignment = LegendAlignment.Bottom

chart.LeftAxis.AutomaticTitle = False"Waterlevel (m)"
chart.LeftAxis.MinimumAutomatic = -0.05False
chart.LeftAxis.MaximumMinimum = 0.75-4
chart.LeftAxis.TitleMaximum = "Waterlevel (m)"5

chart.BottomAxis.Title = "Time"

 

Now we have the chart we want :

 

Now we also want to export the timeseries so we can use it outside Deltashell. For this we have two options : export the chart as image or export the timeseries to a .csv (Comma separated values) file.

Code Block
languagepy
titleExport data
chart.ExportAsImage("D:\\testImage.jpg", 1000,1000)

ExportListToCsvFile("D:\\test.csv", waterlevelSeries)

 

We can also create a map for a certain quantity (waterlevel) at a certain time. For this we need to import the mapfunctions.

Using the map functions we create a map, waterlevel layer and a satellite image layer. Then we add the layers to the map.Layers and open the view. To set the time selection of the view to a certain date we use "SetViewTimeSelection"

Code Block
titleCreate map for output
from Libraries.MapFunctions import *

map = Map()
outputLayer = mf.CreateLayerForObject(fmModel.OutputWaterLevel)
satLayer = CreateSatelliteImageLayer()
map.Layers.AddRange([outputLayer, satLayer])

view = OpenView(map)
SetViewTimeSelection(view, datetime(2014,1,4, 12,0,0))

 

We should get an map showing the waterlevel at our selected timestep like the image below:

Image Added

 

We can export this map as image by calling the "ExportImage" function and using the image property of the map

Code Block
languagepy
titleExport map image
ExportImage(map.Image, "D:\\temp.png", ImageType.PNG)

 

 

scrollbar