# Region-Based Convolutional Neural Network for Wind Turbine Wake Characterization in Complex Terrain
## 2 Materials and Methods
### Scan Preparation for CNN Training and Testing  
Horizontal wind components in a cartesian coordinate system (\(u_{0}\), \(v_{0}\)) for each scan are estimated from radial (i.e., line-of-sight) velocity measurements (\(V_{r}\)) under the assumptions that the projection of the vertical wind speed is zero and the flow field is relatively homogeneous. This method to reconstruct the horizontal wind field has been widely used and validated in previous studies, including a study that evaluated wind turbine wake characteristics from lidar scans taken near an escarpment [6; 40]. \(u_{0}\) and \(v_{0}\) are related to the radial velocity measurements (\(V_{r}\)) through elevation (\(\varnothing\)) and azimuth (\(\theta\)) angles as follows:  
\[\mathbf{V_{r}}=\mathbf{u_{0}}\text{cos}(\varnothing)\;\text{sin}(\theta)\;+\;\mathbf{v_{0} }\text{cos}(\varnothing)\;\text{cos}(\theta) \tag{1}\]  
Figure 1: (**a**) Elevation map (colored contours show elevation) of scanning site with target turbines (pink) and all turbines captured (white). The lidar location is indicated by the cyan diamond. (**b**) Regions A, B, C and D (shown as dotted areas) are utilized to illustrate model performance in the results section. Note that Region D (lavender) is within Region A. Regions do not represent coverage of a single scan; rather, scans as displayed by each region are unique and collected at different times in July and September. Through least squares linear regression, values for \(u_{0}\) and \(v_{0}\) per scan and estimated wind direction \(\alpha\) (note that this is not local wind direction, as a single wind direction value is obtained per scan) are derived [40]:  
\[ \begin{array}{c}\mathbf{V_{r}}&\mathbf{M}\\ \\ \left(\begin{array}{c}\mathbf{V_{r1}}\\ \mathbf{V_{r2}}\\ \mathbf{V_{r3}}\\ \cdot\\ \cdot\\ \cdot\\ \cdot\\ \mathbf{V_{m}}\end{array}\right)&=&\left(\begin{array}{ccc}\mathbf{\sin}(\theta_{ 1})\ \text{cos}(\varnothing_{1})&\text{cos}(\theta_{1})\ \text{cos}(\varnothing_{1})\\ \mathbf{\sin}(\theta_{2})\ \text{cos}(\varnothing_{2})&\text{cos}(\theta_{2})\ \text{cos}( \varnothing_{2})\\ \mathbf{\sin}(\theta_{3})\ \text{cos}(\varnothing_{3})&\text{cos}(\theta_{3})\ \text{cos}( \varnothing_{3})\\ \cdot&\cdot\\ \cdot&\cdot\\ \cdot&\cdot\\ \mathbf{\sin}(\theta_{n})\ \text{cos}(\varnothing_{n})&\text{cos}(\theta_{n})\ \text{cos}( \varnothing_{n})\end{array}\right)\\ \\ &\mathbf{V}=\mathbf{inv}\Big{(}\mathbf{M}^{T}\mathbf{M}\Big{)}\mathbf{M}^{T}\mathbf{V_{r}}\\ &\alpha=\text{atan}\Big{(}\frac{v_{0}}{u_{0}}\Big{)}\end{array}  \tag{2}\]  
The horizontal wind speed at each scanned volume relative to the lidar coordinate system is given by:  
\[\mathbf{V_{H}}=\frac{\mathbf{V_{r}}}{\text{cos}(\varnothing)\ \text{cos}\ \big{(}\alpha- \frac{\pi}{2}-\theta\big{)}} \tag{5}\]  
Reconstruction of the scan flow field enhances the visibility of the wind turbine wakes (Figure 2a,b) that are further clarified by normalizing the entire flow field by the mean wind speed. A high-contrast colormap is then applied to the normalized flow field velocity to isolate all regions of low-velocity flow and to visually homogenize all other freestream velocities (Figure 2c). Figure 2: Example visualization of the flow field reconstruction: (**a**) radial wind speed (i.e., LOS velocity) as measured by the lidar; (**b**) transformation to estimated horizontal wind speed; and (**c**) normalization through estimated bulk wind speed per scan. Northing and easting distances in (**a–c**) are calculated relative to the lidar position. Data are for 3 November 2018, 04:58 UTC, elevation angle \(\varnothing=3^{\circ}\), azimuth angle \(\theta\in[200^{\circ},240^{\circ}]\), azimuthal resolution \(1^{\circ}\), range gate 50 m, 40 s scan time. To train the CNN on the simplest representation of the data, scan images are input into the model as an array of RGB pixels (Figure 3). Due to the fact that each scan image is cropped at known maximum and minimum northing and easting values, a conversion between pixels and meters (relative to the lidar) is possible.