# Air Traffic Trajectory Operation Mode Mining Based on Clustering
## 2 Data Analysis and Processing  
### Data Analysis  
The trajectory position information of aircraft presents a high degree of autocorrelation in time. To obtain the spatio-temporal characteristics and movement patterns of the trajectory in the terminal area, it is necessary to explore and analyze a large amount of historical operation data. To facilitate the uniform management of data sending and receiving in the A-SMGCS system, the European Organization for the Safety of Air Navigation has developed a corresponding data interaction format--Asterix, which allows both communicating parties to codify and decode aircraft trajectory data messages according to this format. The data used in this paper is in Asterix category-062 format, hereinafter referred to as cat-062. The fields contained in the cat-062 message are shown in Table 1. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**TFRN** & **Data Item** & **Information** & **Length** \\ \hline
1 & 1062/010 & Data Source Identifier & 2 \\
2 & - & Spare & - \\
3 & 1062/015 & Service Identification & 1 \\
4 & 1062/070 & Time of Track Information & 3 \\
5 & 1062/105 & Calculated Track Position (WGS-84) & 8 \\
6 & 1062/100 & Calculated Track Position (Cartesian) & 6 \\
7 & 1062/185 & Calculated Track Velocity (Cartesian) & 4 \\ FX & - & Field Extension Indicator & - \\ \hline
8 & 1062/210 & Calculated Acceleration (Cartesian) & 2 \\
9 & 1062/060 & Track Mode 3/ A Code & 2 \\
10 & 1062/245 & Target Identification & 7 \\
11 & 1062/380 & Aircraft-Derived Data & 1+ \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Overview of the cat-062 text field. In this paper, the real trajectory of the terminal area of Guangzhou was selected, the data were collected from the Eurocat-X system, and the trajectory information was encoded in the cat-062 specification and packaged into a pcap file for communication and transmission within the network. A pcap file is a common datagram storage format consisting of a pcap header and timestamped packets, each consisting of a packet header and a packet data. The file format is shown in Figure 1.  
The captured communication packets' content information includes: capture time, source IP, destination IP, port number, etc. Since some information cannot be obtained from the message format, it is necessary to truncate the file header of pcap, use Python to read the version number of the fixed position of the Asterix data stream header, and directly obtain the target cat number to complete the analysis of the Asterix message. The parsed data is the information of all aircraft within the radar receiving range at each time point. It is necessary to re-aggregate the data in the sampling period according to the aircraft. The flight number is obtained by reading field 390 as the unique identification code of the aircraft, and then the aggregated data are saved in CSV in chronological order. The aggregated single original track is shown in Table 2.  
It is observed that time information duplication and some key columns are missing from the data, which are marked with NA. Data loss will occur normally after the flight has been running for a period of time, and its effectiveness will be maintained for a long time. Therefore, while removing the repeated time, we extracted the trajectory with complete key information, that is, removed the segmented NA data and retained the occasional NA data in the effective date, because these accidental deficiencies can be compensated for by the trajectory correction algorithm. After the preliminary cleaning is completed, the trajectory can be drawn to observe the general situation of the data. The large missing or non-conforming trajectory in the dataset that is difficult to repair by the code as a whole can be manually screened, and then the valuable trajectory can be smoothed and denoised.