Introduction
Streamflow (or discharge) describes the volume of water moving down a stream or river per unit of time, commonly measured in cubic meters per second [m³/s] or in cubic feet per second [ft³/s] in imperial units. It is probably the most important elements of the water cycle. Usually, it’s calculated by multiplying the area of water in a channel cross section with the average velocity in that particular cross section, also referred to as "velocity-area" method.
Q = A * v
![Figure 1. Visualisation of the "velocity-area" method (source: [1])](https://towardsdatascience.com/wp-content/uploads/2020/09/1dZIsdN-Ttucrzy5AH6GkIA.png)
In this article measurements and calculations of streamflow for the Plitvica and Sartuk streams in the Plitvice Lakes National Park, Croatia are presented. The hydrologic measurements are part of the project "Hydrogeological investigations of the subbasin of Plitvica stream in the Plitvice Lakes National park ".
Plitvice Lakes is the oldest (proclaimed on 8 of April 1949) and largest (300 km²)national park in Croatia. It is located in in Lika-Senj County, between the Mala Kapela mountain range in the west and northwest, and the Lička Plješivica mountain range to the southeast [2]. Plitvice Lakes were internationally recognised on 26 October 1979 with their inscription onto the UNESCO World Heritage List [2]. What makes Plitvice Lakes unique is the fact that the lake system has 16 named lakes, plus several smaller unnamed ones.


First, the field measuring process together with the measured data (water velocity) for three cross sections will be presented, while the second part, focuses on the process of developing a Python 3 script for calculating the streamflow.
Filed measurements
The field measurements were done using a current meter, a device for flow measurement by mechanical, tilt, acoustical or electrical means. For this measurement, an electromagnetic current meter from Seba Hydrometrie was used. Specifically, FlowSens Single Axis Electromagnetic Flow Meter. It can measure flow velocity form -5 to +5 m/s (calibrated for positive flow only) with ±0.5% accuracy.

An important step before one can even measure, is to find a proper gauging site. There are several recommendation guidelines, i.e. from the U.S.G.S (Rantz et al., 1982).
- The stream course is straight for about 300 feet upstream and downstream of the gage site.

- At all stages, the total flow is confined to a single channel. There is also no subsurface or groundwater flow that bypasses the site.
- The streambed in the vicinity of the site is not subject to scour and fill. It is also free of aquatic plants.
- The banks of the stream channel are permanent. The are free of brush and high enough to contain floods.
- The stream channel has unchanging natural controls. These controls are bedrock outcrops or stable riffle for low flow conditions. During high flows, the controls are channel constrictions or a cascade or falls that is unsubmerged at all stages.
- At extremely low stages, a pool is present upstream from the site. This will ensure the recording of extremely low flows and avoid the high velocities associated with high streamflows.
- The gauging site is far enough removed from the confluence with another stream or from tidal effects to avoid any possible impacts on the measurement of stream stage.
- Within the proximity of the gauge site, a reach for the measurement of discharge at all stages is available.
- The site is accessible for installation and operation and maintenance of the gauging site.
In most cases, it’s nearly impossible to check all of the suggested points, especially in smaller streams, like the ones feeding the Plitvice Lakes with water. Their well are in complex terrain and woody areas. So the main focus was to find a straight as possible, and easy to reach site, with as little plants and debris as possible. Also, for this particular project, measurements are needed at certain areas, because the main goal of the Project is to discover segments of the stream, where water is "lost", due to the karstic terrain.
When a proper site in the segment of interest was found, we would set up the cross section and measure the width of the stream. We used a 20 m measuring tape. Also, the tape functions as a orientation point for the flow meter operator, in order to measure in equal segments, so called subsections (Figure 1.) In each subsection, the operator takes several measurements, each at different depth, where the number of measurements depends on the depth at this subsection. Also, there are several empirical methods, i.e. one can measure at 1 point at the 0.6 of the depth, for very shallow streams, two points at 0.2 and 0.8 of the depth, etc.

For this analysis we adopted the method where for each subsection, the measured velocities get averaged by calculating the arithmetic mean value.

Next, the average depth at each subsection i is calculated, by summing the depth at subsection i-1 and i+1 and dividing it by 2. This average depth gets multiplied with the width of each subsection to get the subsection area. The the average velocity of each subsection is then multiplied with the subsection area which yields the streamflow for each subsection qi. Summing those subsection streamflow, yields the cross section total streamflow Q.

Measured data example

We write down the measured data in tabular form (on paper). The point column represents the measuring points, while stac is the distance in meters from the river bank. h is the depth at each subsection. v1 to vn are the velocities [m/s] measured at different depths at each subsection, while d1 to dn are the depths in meters. The dataframe size and shape depends on the cross section geometry and size. The presented example is the widest cross section, measuring 15.6 meters in width.
Calculations of the streamflow
For the sake of calculating the streamflow at each cross section a simple python script was written. I will briefly explain how it works.
First, we import dependencies, in this case, we need numpy and pandas. We define the file path to the excel file with data. As we had several cross sections, each at separate worksheet in excel we read the file with pandas function "read_excel", and store it to a dictionary, where the key is the worksheet name, and value is a pandas dataframe with the data.

Next, a function for calculating mean subsection velocity, subsection width and area, subsection streamflow, and cross section area and streamflow gets defined.
First, the columns with data in centimetres gets converted to meters, and the empty cells get filled with -999.
Next we want to calculate mean subsection velocities. The conditions are pretty straightforward. So for example if we have only one measurement, the depth d1 is different from -999, but the depth of measurement d2 doesn’t exist, so it is -999, the mean velocity is the velocity of 1 single measurement. If we have for example 3 measurements, the depth d3 exists, but the depth d4 doesn’t, so d4 is -999. I hope the analogy is clear 🙂 . Also, if the depth h is 0, the velocity is also 0, since this point represents the coastline on each side of the stream. This principle is possible, because a natural stream will always have such a shape (Figure 7.).
In the next step subsection widths are calculated. The width of each subsection is equal to the sum of distances from the measuring point to the half distance of the next point and the previous point (Figure 9.) For example the subsection width in subsection II is equal to the half of the distance to point I + half the distance to point III. Also, start and endpoints the subsection width is equal to half the distance to the nearest point (points I and VII in Figure 9. ). Here we use pandas.DataFrame.shift to get the values of previous and next distance (df.stac).
![Figure 9. Principle of calculating section width (source: [3])](https://towardsdatascience.com/wp-content/uploads/2020/09/1nPdef3bF-W3nJbGuQRJYbQ.png)
Next, we calculate the subsection areas. Here we need to take into account that none natural streambed has a regular form, therefore, some approximation are taken into account. In praxis, the mean depth of each subsection is calculated by averaging the depths of previous and next section, similarly like for the subsection widths. Also, the depths for the first and last subsection, are calculated with the starting and ending point. Again we use pandas.DataFrame.shift to get the values of previous point depth and next point depths (df.h).
Mean streamflow of each subsection is calculated by multiplying the mean velocity and subsection area. Also, when the depth is zero, there is no flow, therefore, for the coastline points we set streamflow to zero.
Next, the width, area and total cross section streamflow Q are calculated. Also, the dataframe and width (for the sake of check-up), area and total Q are returned.
We call the function with a dictionary comprehension, in order to get a again a dictionary called _results_Q with cross section (profile) name as key, and a tuple of the resulting dataframe, width_, area and total Q as values.


The numerical results are presented in Figure 10 and 11. The indexes 2 and 3 contain the most important results, profile cross section area and total cross section streamflow Q. For this particular cross section we calculated a cross section area of 9.01 m² and a total streamflow of 0.115 m³/s, or 115 l/s.
Visualisations

Let’s say we want to see how do streambed cross sections look like. We can define a function which uses lineplots to display measured depths along the cross section on the y-axis, while the distances from the streambank are displayed along the x-axis.
Such plots are great to compare the different cross sections measured through the process, also they serve great to compare the streambed changes downstream.
I shall emphasize, that in this example the measurements were not taken in the order, from most upstream station.
Points 5 (Plitvica stream well)and 6 (Sartuk stream well) are most upstream, point 7 is right after the stream Sartuk and Plitvica join, followed by the points 1, 2, 3 and 4. Point 4 is located just before the Large (Great) Waterfall (aka Veliki slap in Croatian).
Another option is to display the cross section velocity. Therefore, we define a function that creates a mesh and interpolates the spatial distribution of the calculated subsection velocity. This way we can visually inspect the distribution of the flow through the cross section.

Conclusion
Measuring the streamflow in a stream or river is of great importance in Hydrology. In this project, the measurements of streamflow should give insight in where exactly the measured water loss occurs.
In this article, the whole process from measuring to calculation and flow velocity and calculating cross section total streamflow has been covered. In the first part, the field tasks and principles were discussed, while the second part focuses on the calculation, and automatization of the whole process. As a bonus, the code for visualising the data has been provided.
If you like the article or you’re interested in Hydrology, feel free to follow me on medium and LinkedIn. Cheers!
REFERENCES
[1] Turnipseed, D.P., and Sauer, V.B., 2010, Discharge measurements at gaging stations: U.S. Geological Survey Techniques and Methods book 3, chap. A8, 87 p.
[2] Plitvice Lakes National Park official website, https://np-plitvicka-jezera.hr/en/about-the-park/general-information/
[2] Žugaj, R: Hidrologija, University of Zagreb, Faculty of Mining, Geology and Petroleum Engineering, Zagreb, 2000