# An RTK UAV-Based Method for Radial Velocity Validation of Weather Radar
## 2 Materials and Methods
### UAV Velocity Reference Calculation and Accuracy Analysis
#### 2.4.1 Calculation of the Actual UAV Velocity  
The POS data include information such as photo name (including time), latitude, longitude, elevation, and three Euler angles (yaw, pitch, roll). Based on the latitude, longitude, and elevation of the two neighboring locations in the POS information, the distance-time method is used to calculate the velocity between the two points.  
1. Conversion of latitude and longitude coordinates  
As shown in Figure 3, the geodetic coordinate system describes the spatial position of the target using latitude \(B\), longitude \(L\), and geodetic elevation \(H\), whereas the space rectangular coordinate system describes this using \(X\), \(Y\) and \(Z\). Thus, to calculate the distance between two neighboring points, it is necessary to first convert the geodetic coordinate system to the space rectangular coordinate system. For a point \(P\) in three-dimensional space, the seven-parameter method in geodesy is used to convert the geodetic coordinate \(P=\left[L,B,H\right]^{T}\) into the space rectangular coordinate \(P_{xyz}=\left[X,Y,Z\right]^{T}\).  
\[\left\{\begin{array}{l}X=\left(N+H\right)\cos B\cos L\\ Y=\left(N+H\right)\cos B\sin L\\ Z=\left[N\left(1-e^{2}\right)+H\right]\sin B\end{array}\right. \tag{10}\]  
where \(N=\frac{a}{\sqrt{1-e^{2}\sin^{2}L}}\) represents the local curvature radius of the meridian circle, \(a\) denotes the semi-major axis of the Earth ellipsoid, and \(e\) signifies the Earth's eccentricity.  
\begin{table}
\begin{tabular}{l} \# Create a geodetic coordinate object for the UAV \\ el = float(input(“Please enter radar elevation (”):”)) \\ point1 = Point (radar\_lat, radar\_lon) \\ \end{tabular} \# Calculate the geodesic coordinates of the UAV using the geodesic function \\ point2 = geodesic (). destination (point1, azimuth, distance\_km) \\ \end{tabular} \# Calculate UAV altitude \\ height = distance * math.sin(el * math.pi/180) \\ UAV\_Height = radar\_height + height \\ \end{tabular} \# Calculate the distance between the radar and the UAV(m) \\ nodes = [point1, point2] \\ distance = geodesic (nodes [0], nodes [1]). kilometers*1000 \\ distance = (distance**2+height**2)**(1/2) \\ print (’Distance between two points:’, distance) \\ \end{tabular}
\end{table}
Table 2: The calculation of the latitude and longitude of the two endpoints of the UAV route and checking the slant distance between the UAV and the radar.  
2. Velocity calculation for each position point of the whole UAV route  
The geodetic coordinates of two neighboring points of the route obtained from the POS data are transformed to obtain the corresponding space rectangular coordinates \((X_{1},Y_{1},Z_{1})\) and \((X_{2},Y_{2},Z_{2})\). The spatial Euclidean distance between them can be calculated according to the following equation.  
\[R=\sqrt{\left(X_{2}-X_{1}\right)^{2}+\left(Y_{2}-Y_{1}\right)^{2}+\left(Z_{2}- Z_{1}\right)^{2}} \tag{11}\]  
According to the time interval between the two neighboring points, the average velocity is calculated based on the distance-time formula. Since the UAV route is set to fly along the radar radial direction, the results of the following formula are used as a reference value for the radar radial velocity validation.  
\[\overline{V_{i}}=\frac{R}{\Delta T}=\frac{R_{n}}{T_{n+1}-T_{n}} \tag{12}\]  
where \(n\) is taken as 1, 2, 3, etc.