 Hello, this is Hans van der Klaas Senior Lecturer at IT Delft Institute for Water Education. In this video I'm going to show you how to visualize model outputs that are in raster format as an animation in QGIS using the temporal controller. For temporal vector layers this is much easier than for rasters which don't have an attribute with time and dates. We're going to use a PyQGIS script to do this. Let's first look at the data of a model. This is a PC raster model and we see here that it has 10 time steps and there are different variables and each time step it saves a raster layer with the extension 001 for the first, 002 for the next, etc. We can use Aguila to visualize this. That's a tool that comes with PC raster and I say visualize time steps 1 to 10, interval 1 and then for discharge and here we see the result and I can put it to shifted logarithmic because the values are quite a range for discharge which is very high at rivers and very low in the other areas and this kind of animation I would like to make in QGIS. I got inspired by the blog of Geodos who used temporal netcdf file in QGIS for an animation and he used this PyQGIS script to do that where you simply define the start and end time and then it works and I tried it on a virtual raster and that also works. So that's what I'm going to show you here. So I'm going to drag the PC raster files which are GDAL format to the map canvas and they're recognized by QGIS. The only thing is that the order of the layers is not anymore aphabetic and numeric so we need to rearrange them before we can make a map stack. Now we can build the map stack as a virtual raster. We go to raster, miscellaneous, build virtual raster. There we choose the inputs and we select all of them and make sure now that we want each layer in a band so we check the box, place each input file into a separate band. You can save it to an output file name but here I can just use a temporary layer and I move it to the top and here we see that the multiband render is used to color it. We're going to change that later because that is not what we want. So I'm going to remove the individual layers and keep the virtual raster and let's change the styling. Go to the layer styling panel and I change it from multiband color to single band gray. This doesn't give much contrast because as we've seen before it's more logarithmic scale values. I choose here mean standard deviation and change the minimum to zero and this gives a bit more contrast and I'm going to use these values in the script instead of stretching it from the minimum maximum in the file. Let's open the Python console and the editor and paste there the code from geodos and let's edit here the start and the end date. We have 10 days of layers so I change it to first of January until the 11th of January 2000 because it goes to midnight which means that if you have 10 time steps we need it to go from the first to the 11th and here I'm going to change the minimum maximum value according to what we have figured out in the layer styling panel. So the minimum is zero and the maximum 4.6 and we will use that by putting it in the script for all the layers they will be stretched to this minimum maximum value. I run the script so now this is set. When I go to the virtual layer I see that I have the temporal layer indication there which means I can open the temporal controller and with the refresh I can set the actual interval that it takes from the script and then I can play the animation before and to set it to an interval of days and let's zoom in to see a bit more. Here we go and then we see for every time step the discharge. We can also use colorize if we don't want to take grayscale and we change it to blue but we don't have too many options there. We really need to modify the PyQGIS script to invert the colors from white to blue in this case or to use the single-bamp pseudo color or if we want to animate discrete data we also need to adapt the render. So I hope this was useful. Here you've seen how to load temporal rusters that can be outputs from your models and through PyQGIS script use it in the temporal controller to create nice animations.