# Development of Fog Detection Algorithm Using GK2A/AMI and Ground Data
## 2 Materials and Methods
### Methods  
The fog detection algorithm of GK2A (GK2A_FDA) consists of three parts, as shown in Figure 2. The upper left part sets the initial threshold values of various test elements (e.g., DCD, BTD) through histogram analysis and prepares the background data, such as the 30-day composite visible channel \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Training Cases**} & \multicolumn{3}{c}{**Validation Cases**} \\
**Code** & **Date** & **\# of Fog** & **\# of Station** & **Code** & **Date** & **\# of Fog** & **\# of Station** \\ \hline T1 & 07.04.2019 & 1244 & 25,002 & V1 & 10.01.2019 & 719 & 4473 \\ T2 & 07.14.2019 & 774 & 23,339 & V2 & 10.04.2019 & 2385 & 30,800 \\ T3 & 07.24.2019 & 320 & 7604 & V3 & 10.20.2019 & 3823 & 37,224 \\ T4 & 07.26.2019 & 676 & 6523 & V4 & 11.05.2019 & 2995 & 37,627 \\ T5 & 08.25.2019 & 570 & 22,897 & V5 & 11.06.2019 & 3360 & 25,912 \\ T6 & 08.26.2019 & 815 & 20,239 & V6 & 11.12.2019 & 1893 & 26,556 \\ T7 & 08.30.2019 & 1464 & 33,869 & V7 & 12.08.2019 & 696 & 34,425 \\ T8 & 08.31.2019 & 227 & 25,412 & V8 & 12.19.2019 & 76 & 23,189 \\ T9 & 09.17.2019 & 525 & 29,818 & V9 & 02.10.2020 & 72 & 21,291 \\ T10 & 09.24.2019 & 2483 & 16,278 & V10 & 02.11.2020 & 151 & 19,368 \\ T11 & 09.29.2019 & 2286 & 33,642 & V11 & 03.01.2020 & 1277 & 15,523 \\ T12 & 09.30.2019 & 2011 & 30,075 & & & & \\ \hline  & Total & 13,395 & 274,698 & & Total & 15,175 & 162,592 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Summary of the fog cases used for training (T) and validation (V) of the fog detection algorithm. The number of fogs and stations indicate the number of visibility meters, showing a visibility of less than 1 km and the total number of visibility meters used for validation, respectively. Figure 1: Spatial distribution of the visibility data with land sea mask. Yellow dots represent the stations of the visibility meter data. The white, blue, and brown shaded pixels represent coast, sea, and land, respectively. reflectance (Vis_Comp). The lower left part optimizes the threshold values of various test elements through sensitivity tests based on Hanssen-Kuiper skill score (KSS) using the training cases and visibility meter data. The right part shows the entire process of the fog detection algorithm from reading the data to validating the fog detection results. As the availability of AMI channels depends on the time of the day and the characteristics of the background differ based on the geographic location, we developed nine types of fog detection algorithms based on SZA (day, dawn/twilight, and night) and surface type (land, coast, and sea), as shown in Figure 3. The threshold values of SZA for separating fog detection algorithms were determined based on the maximum total fog detection level obtained through intensive sensitivity tests. Figure 2: Flow chart of the fog detection algorithm prepared using the GK2A/AMI and auxiliary data. As fog is a complex phenomenon and AMI has 16 channels, we used various test elements based on the optical and textural properties of the fog to distinguish it from other objects (clear, low cloud, middle-high cloud, snow, etc. ), as shown in Table 3. In this study, an algorithm based on a decision tree method was developed to remove the non-fog pixels after the first detection of the fog candidate pixels among all pixels using following steps. In the first step, the fog candidate pixels were mainly detected by the difference (\(\Delta\)VIS) of reflectance at daytime and the DCD at nighttime [5; 6; 16]. The difference of reflectance means the difference between the reflectance of 0.64 \(\upmu\)m and Vis_Comp as clear sky reflectance. Vis_Comp of a pixel was obtained through the minimum value composition of the reflectance of 0.64 \(\upmu\)m during the past 30 days, including the fog detection day [5]. The Vis_Comp data were obtained every 10 min considering different SZAs.