Calculations of the streamflow
For the sake of calculating the streamflow at every move phase a easy python script was once written. I will be able to in brief provide an explanation for the way it works.
First, we import dependencies, on this case, we want numpy and pandas. We outline the document trail to the excel document with information. As we had a number of move sections, every at separate worksheet in excel we learn the document with pandas serve as “read_excel”, and retailer it to a dictionary, the place the secret’s the worksheet title, and price is a pandas dataframe with the information.
Next, a serve as for calculating imply subsection speed, subsection width and house, subsection streamflow, and move phase house and streamflow will get outlined.
First, the columns with information in centimetres will get transformed to meters, and the empty cells get stuffed with -999.
Next we wish to calculate imply subsection velocities. The prerequisites are beautiful easy. So as an example if we’ve got just one size, the intensity d1 isn’t the same as -999, however the intensity of size d2 doesn’t exist, so it’s -999, the imply speed is the speed of one unmarried size. If we’ve got as an example three measurements, the intensity d3 exists, however the intensity d4 doesn’t, so d4 is -999. I’m hoping the analogy is apparent 🙂. Also, if the intensity h is 0, the speed may be 0, since this level represents the sea coast on every facet of the move. This idea is imaginable, as a result of a herbal move will all the time have any such form (Figure 7.).
In the subsequent step subsection widths are calculated. The width of every subsection is the same as the sum of distances from the measuring level to the part distance of the subsequent level and the earlier level (Figure 9.) For instance the subsection width in subsection II is the same as the part of the distance to indicate I + part the distance to indicate III. Also, get started and endpoints the subsection width is the same as part the distance to the nearest level (issues I and VII in Figure 9. ). Here we use pandas.DataFrame.shift to get the values of earlier and subsequent distance (df.stac).
Next, we calculate the subsection spaces. Here we want to keep in mind that none herbal streambed has a normal shape, subsequently, some approximation are taken into consideration. In praxis, the imply intensity of every subsection is calculated by averaging the depths of earlier and subsequent phase, in a similar way like for the subsection widths. Also, the depths for the first and closing subsection, are calculated with the beginning and finishing level. Again we use pandas.DataFrame.shift to get the values of earlier level intensity and subsequent level depths (df.h).
Mean streamflow of every subsection is calculated by multiplying the imply speed and subsection house. Also, when the intensity is 0, there is not any go with the flow, subsequently, for the sea coast issues we set streamflow to 0.
Next, the width, house and overall move phase streamflow Q are calculated. Also, the dataframe and width (for the sake of check-up), house and overall Q are returned.
We name the serve as with a dictionary comprehension, in an effort to get a once more a dictionary referred to as results_Q with move phase (profile) title as key, and a tuple of the ensuing dataframe, width, house and overall Q as values.
The numerical effects are offered in Figure 10 and 11. The indexes 2 and three comprise the maximum essential effects, profile move phase house and overall move phase streamflow Q. For this actual move phase we calculated a move phase house of 9.01 m² and a complete streamflow of 0.115 m³/s, or 115 l/s.