# Study of the Algorithm for Wind Shear Detection with Lidar Based on Shear Intensity Factor
## 2 Methods
### Conventional Single Ramp Wind Shear Detection Algorithm  
The principle of a single ramp detection algorithm, which detects the change of wind speed at a certain distance, is presented in Figure 2. Since the wind speed at both ends of the detection distance varies, the wind profile along the slide path is reflected as a ramp. Therefore, the algorithm is named the ramp detection algorithm.  
Here, D is the length of the ramp, which represents the distance of the two data points, and \(\Delta\)V is the difference in wind speed between the two data point locations.  
Since noise data may exist in the original data of the headwind profile, it is necessary to filter the original wind profile before ramp detection. An average sliding method is generally used to preprocess the raw wind data. Based on the sliding average algorithm, we define U as the raw wind profile data and UI as the preprocessed wind profile data. The equation of sliding average is given below. Note that the sliding average algorithm is referring to the data averaged spatially and wind profile is referring to headwind data.  
\[\text{UI(d)}=\frac{1}{4}\text{U(d}\quad\Delta\text{d)}+\frac{1}{2}\text{U(d)}+ \frac{1}{4}\text{U(d+\Delta\text{d)}} \tag{1}\]  
Here, d is the location of the data point to be preprocessed and \(\Delta\)d is the sampling distance.  
The preprocessed wind profile could be used to detect wind shear, with the equation for detecting wind shear as follows:  
\[\text{UID}\ \ \bar{\text{\#}}\ \ =\text{UI(d+D)}\ \ \ \ \ \text{UI(d)} \tag{2}\]  
Here, UID (\(\bar{\text{\#}}\)) is the wind shear in location \(\bar{\text{\#}}\) and \(\bar{\text{\#}}\) = d + D/2, where D is the length of the ramp.  
Interestingly, if D is fixed, the algorithm cannot find the maximum wind shear value and location when the changing trend of wind speed in the ramp is the same as that on the next point outside the ramp. Therefore, extending or contracting the ramp length is necessary based on specific criteria. [PERSON] et al. put forward the ramp length extension and contraction strategy as depicted in Figure 3.  
For a ramp of headwind gain (loss), if the velocity continues to rise (fall) after the original ramp, the ramp length is expanded to cover the increasing (decreasing) part of the velocity until the velocity starts to fall (rise) or half of the original ramp length is reached, whichever is shorter. On the other hand, for a ramp of headwind loss (gain), if velocity increases (decreases) at the final portion of the ramp, the ramp length is contracted until the increasing (decreasing) part of the velocity is passed or a quarter of the original ramp length is reached, whichever is smaller.  
Figure 2: The principle of the conventional single ramp wind shear detection algorithm.  
The double ramps detection algorithm calculates the difference in wind shear at adjacent locations based on the single ramp detection algorithm under the condition of fixed ramp length. When the difference in wind shear at adjacent locations is higher than the prespecified threshold, wind shear alerting information is also released. Since this paper focuses primarily on the ramp length extension and contraction strategy, the double slope detection algorithm is not described in detail here.