 Welcome back on my YouTube channel. In today's video I am going to try how to derive the unit hydrograph for a catchment. We will use this DEM and LDD map. In a previous video I have demonstrated how to derive a catchment and calculate the local drain direction map using the PC Raster Tools plugin. I couldn't find much information on how to derive a unit hydrograph using GIS and in specific QGIS. But I found a tutorial that I tried to replicate in QGIS. The link to the original tutorial can be found in the description of this video. The first step is to calculate the flow accumulation. We will use the PC Raster AccuFlux tool for that. But you see that it needs a material layer. You can create it using the spatial tool. If we make a raster with all pixels 1 in scalar data type, with the mask layer LDD, it will accumulate pixels. So unit 1 means that it just accumulates a unit of a pixel. Here we see the scalar 1 raster, which is bigger than the catchment because there are a lot of missing values around the mask that we use. I fill in the dialog to calculate the flow accumulation. We execute the AccuFlux tool and here is the flow accumulation. We also need the slope. So I calculate the slope from the DEM using the slope tool from PC Raster. And that will result in a fraction. So I give it the name slope fraction. Now we need to calculate the term of an equation using the raster calculator. There I use the square root button at the slope fraction, but it's in fraction and it needs to be in percentage. So I multiply by 100. Close the bracket. And we need to multiply this with the square root of the flow accumulation. I save this as slopeareaterm.tiff and we can check the result. For the next part of the equation I need the mean value. So I go to the layer properties and I copy simply the mean from here. Then in the raster calculator I can formulate the second part of the equation, which is 0.1 times the bracket and then the slopearea term, but then divided by its average value. And this is then the velocity, but we need to put some limits on it for the range. So I call it velocity unlimited. Let's check in the layer properties what the ranges are. So it goes from 0 to 14.8 and we need to limit it to 0.02 and 2 according to the tutorial. So I use a if statement there and use velocity unlimited and if it's less or equal than 0.02 then give it value 0.02 else another if statement. If it's larger than 2, then make it 2, but I need also an else statement because we also want all the values in between to be the original values. So this should be the equation. Always check if you have enough brackets, so and I save it as velocity.tiff. In order to calculate the travel time I need to create a raster layer with weights and that the weight is 1 divided by the velocity called as weight.tiff and let's convert this to the PC raster format so we can use it in the LDD dist operation later. It's a scalar and I call it friction because that's the term that goes into the LDD dist operation. Now let's have a look at LDD dist that we need. Calculates the friction distance and we have all the parameters except the cells to which distance is calculated, which is the outlet. You can use an outlet if you already had that for delineating the catchment. Here I'll show how to get the outlet. I use the flow accumulation and I go to the last pixel there, copy the coordinate, paste it in notepad and add the value 1 which will be boolean 1 when we convert it, call it outlet and then we can convert it on the text format to a PC raster map format. You always use LDD as a mask to be consistent but it doesn't matter if they're all derived from the LDD. I move it to the top and I still need to make a real boolean out of it so I create a spatial of boolean 0 that I'm going to merge with the pixel that only has value 1 and no data. This is a raster with only zeros and we can use the cover tool for that so I give the outlet and all the no data pixels will be covered with boolean 0. Let's call this outlet boolean, style it, there it is and our blue pixel there is the outlet but it's boolean so all the other pixels are 0. So let's go back to LDD dist and fill in the dialogue and we save the result to travel time. Now let's have a look, style it with single pseudo color, that looks really nice. We need to make a map with isochrones so I'm going to bin this travel time raster and I'm going to use many classes to get very precise points on our hydrograph and the method that I'm going to use the raster attribute table. First I need to style this continuous raster using classes and the maximum amount of classes I can generate is 255 with this method. So change the mode to equal interval because we also want these isochrones at equal intervals and I change it to 255 classes. So here we see the travel time in seconds and you need the raster attribute table plugin. I already have it installed but you can install it from the plugins manager and then you can click right on the raster layer and say new attribute table, choose GDAL and now it's created and here it shows the same colors and the same intervals as we have chosen in the layer styling panel. So now there's a nice tool in the processing toolbox that we can convert a lookup table from the raster attribute table format so we can create a CSV from the raster attribute table and always check the output. In this case we don't need the first line because it really starts at zero, remove the first line, save it and now we can use this lookup table to create an isochrome map. Choose the lookup tool, choose the travel time layer, choose the lookup table, scale our output and I call it travel time classes. There it is, we also need to calculate the areas of the classes so therefore I am going to make another lookup table and we do that by opening the previous lookup table in LibreOffice and we choose that it only has space as a separator, there we see the ranges in one column and in column B we see the boundary values and I just want a unique number per class so now they all have a unique number, I can create a map with those unique numbers and calculate the areas of those classes, let's call it zones, confirm to use the CSV format and check the result and that looks good so we can use this now to create a map with the zones, use the lookup tool, choose the travel time layer and this time we use the zones CSV file to classify it into unique numbers so we choose nominal as an output data type, save it, go to zones and there's our map with zones with unique numbers, you can see that the legend does not have all values yet but if I use pelleted unique values then we can see that it goes from 0 to 254 in this case. Now I can use the area area tool to calculate the area of areas so in this case area of zones, in map units so in square meters and that's the result, let's also style this, let's have a look at those boundary values and this lowest value is the interval value, I copied that because I need that in our next calculation in the raster calculator where we use the area of the classes and we divide it by the interval and that will give us the discharge value, let's quickly style it so now we have the discharge and the travel time so we can make our unit hydrograph, so there's a nice plug-in which is called the raster data plotting plug-in, you need to install a sci-pi using the osgo4w installer if you want to use this, so go to your osgo4w setup and there search for sci-pi, find it under the lips and then install it from there, also update QGIS etc and then you can install the plug-in, the plug-in comes with a panel, you can open it by clicking the button of the plug-in, choose a scatter plot, on the x-axis we want the travel time, in our case in the classes, and on the y-axis I want the discharge and we need to tune it a bit, so I remove the 1 to 1 line and there the red dots, we see our curve and we can zoom a little bit, change the ranges interactively, also we need to change it to scatter, so you see here now the white dots and that's our unit hydrograph, doesn't look really perfect, maybe there's some artifacts in the area or the method is maybe not completely correct, so if you have any suggestions on how to improve this method please comment in the video, this is a bit experimental, I was just following another approach which has also been copied in the description below the video, so this was how far I could come with these tools, if you have other ideas please let me know, if you like these videos please subscribe and looking forward to see you again.