Short communication: A new tool to define multiscale bedform characteristics from bed elevation data

. Systematic identification and characterization of bedforms from bathymetric data are crucial in many studies focused on fluvial processes. Automated and accurate processing of bed elevation data is challenging where dune fields are complex, irregular and, especially, where multiple scales co-exist. Here, we introduce a new tool to quantify dune properties from bathymetric data representing multiple dune scales. A first step in the procedure is to decompose the bathymetric data based on a LOESS algorithm. Steep dune lee side slopes are accounted for by implementing objective breaks in the algorithm, 5 accounting for discontinuities in the bed level profiles, often occurring at the toe of the lee side slope of dunes. The steep lee slopes are then approximated by fitting a sigmoid function. Following the decomposition of the bathymetric data, bedforms are identified based on zero-crossing, and the relevant properties are calculated. The approach to decompose bedforms adopted in the presented tool is particularly applicable where secondary dunes are large and thus filtering could easily lead to undesired smoothing of the primary morphology. Application of the tool to two bathymetric maps demonstrates that the decomposition 10 and identification are successful, as the lee side slopes are better preserved.

characteristics impact the mean and turbulent flow field, and the associated sediment dynamics (Kwoll et al., 2016;Lefebvre 25 et al., 2016;Parsons et al., 2005;Best and Kostaschuk, 2002;Bradley et al., 2013). Based on dune shape and migration speed, observed in the field, bedload sediment transport can be quantified (Abraham et al., 2011;McElroy and Mohrig, 2009;Simons et al., 1965). Each of those research fields requires dune identification and characterization, which are particularly challenging where dunes fields are complex, irregular and where multiple scales co-exist.
In fluvial systems, two scales of dunes often co-exist: larger, primary dunes and small, secondary dunes that are superimposed 30 on the primary dunes. The secondary bedforms have long been considered an attribute of primary dunes, converting simple dunes into compound dunes (Ashley, 1990)). Recent studies have shed light on the relevance of the small bedforms, which have been observed in river systems worldwide (Carling et al., 2000;Cisneros et al., 2020;Galeazzi et al., 2018;Harbor, 1998;Parsons et al., 2005;Wilbers and Ten Brinke, 2003;Zomer et al., 2021). Secondary bedforms are not limited to the primary dune stoss, but can migrate over of the full length of the primary bedform (Galeazzi et al., 2018;Zomer et al., 2021). They 35 possess steep lee side angles which are likely to influence the total roughness, and to affect primary dune development as well (Reesink and Bridge, 2007). The bedload transport associated with secondary bedform migration is similar to that associated with primary dunes, due to their high migration speed (Zomer et al., 2021;Venditti et al., 2005). The expected increase of spatial and temporal resolution of bathymetric data sets further stimulates research on this smallest dune scale.
This may not be suitable where the primary dune scale is fully covered by secondary dunes (Galeazzi et al., 2018;Zomer et al., 2021). Other methods apply filtering, e.g. based on geostatistics, spectral methods or smoothing algorithms. These methods have been developed for bathymetries where secondary bedforms are small compared to the primary dunes. In case of 45 larger secondary bedforms, inevitably, smoothing significantly affects the primary lee side slope, leading to missing secondary bedforms on the lee side, or at the least significant underestimation of the lee side slopes.
In this study we develop a new tool to quantify bedform characteristics from bathymetric data representing multiple scales.
The initial bedform identification is based on zero-crossing after decomposition of the bathymetric data. A LOESS algorithm is used to fit the irregular larger scale morphology, including the primary dunes. Different from previous methods (van Dijk et al.,50 2008; Gutierrez et al., 2013;Wang et al., 2020), no continuously differentiable function is fitted, but breaks are implemented.
These breaks in the LOESS fit are implemented to avoid smoothing of steep primary lee side slopes that feature an abrupt transition from the lee side slope to the dune trough. These steep lee slopes are approximated with a sigmoid function. The tool is applied to two bathymetric data sets to illustrate the method.

55
The first step in the procedure is to decompose bed elevation profiles into a signal representing secondary bedforms and the remainder, which includes the primary dunes. This step builds on the previously described method to decompose bed elevation are identified based on zero-crossing, which is described in section 2.2. In Section 2.3, the new tool is applied to two data sets.

Decomposition of bed elevation data representing multiple bedform scales 60
A LOESS curve is fitted to the data to separate the secondary bedforms from the underlying morphology (Greenslade et al., 1997;Schlax and Chelton, 1992). At steep primary leesides, with slopes exceeding a user-defined threshold, breaks are introduced and a sigmoid function is fitted to the corresponding primary lee side using a least-squares routing. First, the LOESS algorithm and sigmoid function are explained in further detail, then the subsequent steps in the method are provided.
By fitting the LOESS curve, each optimized value is given by a weighted quadratic least squares regression to a local subset 65 of the data. So, for each grid point in a bed elevation profile (x 0 ), a local estimateẑ is found through a locally weighted least squares fit of a function of x, applied to N data points near x 0 (Greenslade et al., 1997): The coefficients a 1 , a 2 , and a 3 are found minimizing the function

70
where W is the sum of weights w j . The weights w j are defined as where d x is the half-span of the smoother.

75
The sigmoid function that is fitted to dune lee sides is defined aŝ The coefficients are found by minimizing through constrained nonlinear optimization using an interior-point method in Matlab implemented as "fmincon".

80
The bed elevation data series is decomposed based on both the LOESS curve and fitting of the steep primary lee sides with a sigmoid function fit. Data input are (curvilinear) grids. The methodology is applied per bed elevation profile (BEP). The subsequent steps are explained below: 1. An initial LOESS curve is fitted to the BEP ( Figure 1a).
2. Based on the initial LOESS curve, crest and trough locations of primary dunes are identified. If the maximum lee side 85 slope is larger than a specified value (default: 0.03 m m −1 ), a break is set at the corresponding trough. If there are no breaks in a BEP, the initial LOESS curve is retained (Figure 1a).
3. If there are breaks in a BEP, the exact locations of these breaks are updated in the following steps. First, the local minimum of the bed elevation data is found, within a specified window upstream of the previous breakpoint. Subsequently, the breakpoint location is updated if the slope to an upstream location within the window is lower than the cutoff slope 90 (Figure 1b).

5.
A short LOESS curve is fitted to the data between the previous LOESS curve and the sigmoid function fit. The fit is forced to connect to LOESS curve and sigmoid fit by artificially adding data points (Figure 1c).

100
The identification of both primary and secondary bedforms are based on the decomposed bed elevation signals. The characterization of bedforms includes the following properties: height, length, depth, trough and crest locations, lee side slope, maximum lee side slope, stoss side slope, and the aspect ratio.
Secondary bedform identification is based on zero-crossing applied to the decomposed bed elevation signal (z − z loess ), following Van der Mark and Blom (2007). A zero-crossing is marked as a downcrossing if the slope is negative, and as 105 upcrossing if the slope is positive. The crests and troughs are determined as local maxima and minima between up-and downcrossings. For the secondary bedforms, we apply one iteration in the bedform identification, in order to eliminate very small fluctuations around the zero-line.
Subsequently, bedform properties are being determined. Properties are determined both for the unfiltered bathymetric data (based on previously identified crest and trough locations) and for the decomposed bathymetric data. The bedform height is 110 defined as z crest − (z trough−upstream + z trough−downstream )/2. The length is defined as the horizontal distance along the (curvilinear) grid between the up-and downstream trough. The depth per bedform is computed as the average bed level (based on unfiltered bathymetric data) between the up-and downstream trough. The lee slope is defined as the average slope between the crest and downstream trough. The maximum lee slope is the maximum slope of a grid cell between the crest and downstream trough. The stoss slope is characterized as the average slope between the crest and upstream trough. The aspect ratio is the 115 height divided by length.
The identification and characterization of primary bedforms is similar to that of secondary bedforms. Zero-crossing is based on the decomposed signal, excluding secondary bedforms, and a base level. The latter can be computed as a moving average (4 to 5 times the dune length), a smoothed LOESS curve or a time-average of the local river bed, depending on data availability.
Here, we compute the base level as a moving average. Again, we iterate once. If primary dunes are smaller than 0.25 m, corre-120 sponding up-and downcrossings are removed and new minima and maxima are found. Properties are subsequently determined similar to secondary bedforms.
After bedform identification and characterization, the secondary and primary bedforms are filtered to exclude identified bedforms that are deemed unrealistic, e.g. as a result of small fluctuations around the zero-line. Secondary bedforms are filtered out if one or more of the following conditions hold, which are all user-defined:

125
height is smaller than 0.05 m or larger than 0.75 m length is larger than 25 m or smaller than 0.5 m (5 times the resolution for data presented herein) the aspect ratio is larger than 0.2 or smaller than 0.005 the crest elevation in the unfiltered data is less than 0.01 m lower than the up-or downstream trough the maximum lee side slope is smaller than 0.03 m m −1 .

130
Primary bedforms are filtered out if: height is smaller than 0.25 m or larger than 4 m length is larger than 200 m or smaller then 25 m aspect ratio is larger than 0.2 or smaller than 0.005 the maximum lee side slope is smaller than 0.03 m m −1 .

135
All default values in the procedure above can readily be adjusted in the code.

Data description
The tool is applied to two data sets. Multibeam echosounding (MBES) data were provided by the Dutch Ministry of Infrastructure and Environment (Rijkswaterstaat) for the River Waal, which is the main branch of the River Rhine. The used data set  high discharge, primary dunes are shorter, and large secondary bedforms cover a large part of bed. Especially in the southern river section, secondary bedforms are dominant whereas primary dunes nearly disappear.
Following the decomposition of the bed elevation data, bedforms have been identified based on zero-crossing. For primary bedforms, the base level consists of a moving average of 400 m. Four BEPs are shown in Figure 3, which shows for each BEP the measured bed elevation, the fitted line, and the locations of the tops and troughs of secondary and primary bedforms. Figure   4 shows the distributions of height, length and the maximum lee side slope that are found for primary and secondary bedforms.

155
In the applied decomposition procedure, breaks were implemented to avoid smoothing of steep primary lee side slopes. To investigate the effectiveness of the procedure, histograms of the slopes of downstream facing cells with a value larger than 0.03 m m −1 are shown in Figure 5. The first column shows the distribution of lee side slopes of the original bed elevation data.
The second column shows the same for the primary morphology after decomposition without breaks. Here, LOESS curves are fitted with the parameters as reported in the Results section. The third column shows the results for the primary morphology 160 using the sigmoid function fit to the slopes. The figure indicates that introducing a break in the BEP and a separate treatment of the lee side slopes increases the tail of the distribution towards the higher slopes substantially.

Discussion
The new tool presented herein serves two purposes: to isolate secondary bedforms from the underlying topography, and to identify bedform properties for both the primary and secondary bedforms based on zero-crossing. Figure 2 and 3 demonstrate 165 that the tool decomposes the bathymetry well. The secondary bedforms are separated from the underlying bed topography and steep lee side slopes maintain their steepness. High-pass filtered data, shown in the third and sixth panels in Figure 2, indicate that the primary dune shape is not present in this signal, whereas in the second and fifth panel, no indication of secondary bedforms is present, indicating they are filtered out effectively. Whereas previous methods employ smoothing functions that have a continuous first derivative, such an approach is unsuitable for bathymetries with relatively large secondary bedforms.

170
A high degree of smoothing fails to adequately represent dune lee side slopes. For this reason, breaks are implemented here, leading to a fitted line that is continuous, but does not have a continuous first derivative. Figure 5 indicates that by implementing breaks, the steep primary lee side slopes are not smoothed during the decomposition. Accurate estimation of lee side slopes is of vital importance in many studies since lee side slopes determine the local flow and sediment dynamics over dunes, indicate whether flow separation occurs, and determine hydraulic roughness (Kwoll et al., 2016(Kwoll et al., , 2017175 Bradley et al., 2013). Figure 3 shows the bedform identification based on zero-crossing, illustrating that most secondary bedforms are identified. Figure 4 reveals that especially during low discharge, secondary bedforms can be so small that it is difficult to clearly distinguish them from random data inaccuracies, leading to a one-sided histogram with lower values missing.
In the application of this method, a user should be careful in choosing parameters with which the tool is applied. The 180 quality of the decomposition and with that, bedform identification and characterization, depends to some extent on the initial parameters d x , the window length and on the cutoff slope. These parameters provide strong control to the user, and in using  the tool, the parameter settings may require tuning. Though zero-crossing is a well recognized method to identify bedforms (Van der Mark and Blom, 2007), a downside is that, especially for raw data, random fluctuations around the zero-line can be included as bedforms, leading to a need for filtering.

185
The tool presented here is appropriate for data sets with multiple scales of bedforms, as long as these scales are sufficiently separated, and the resolution of the data is high enough, relative to the length of the smallest bedform scale. In this study, the smallest bedforms are five times the data resolution. The tool is appropriate for symmetrical and asymmetrical dunes with steep lee side slopes. When three or more bedform scales are present, potentially, part of the procedure can be repeated. After separating the smallest scale bedform from the remainder, the latter signal can be subjected to the same procedure.

Conclusion
A tool is presented to decompose bed elevation data representing multiple scales for the identification and characterisation of two scales of bedforms. A LOESS algorithm was used to isolate the highest scale bedforms in between breaks downstream The results show that the tool is successful in separating scales for data sets with well-defined bedform scales.
Code availability. The matlab code used in this study can be accessed through https://github.com/j-zomer/BedformSeparation_Identification Author contributions. Initiation and design of the study was a result of discussion between all co-authors. Judith Zomer developed the tool, about which the co-authors were regularly consulted. Judith Zomer analyzed the data and wrote the manuscript. The manuscript was reviewed Competing interests. There are no competing interests.