## 3 Datasets and Methodology
### Methodology
#### 3.2.2 TEC Data Pre-Processing  
1. Epicenter TEC value evaluation:  
As mentioned above, the TEC maps were produced with spatial resolutions of 5\({}^{\circ}\) and 2.5\({}^{\circ}\) in longitude and latitude, respectively, at a 15 min temporal resolution. We were interested in examining the ionospheric TEC changes above the earthquake epicenters, up to 48 h before each event, but not all corresponded epicenter TEC maps are available between 1998 and 2021. In this step, we calculated for each earthquake epicenter the corresponded ionospheric TEC value (Figure 3) by taking the weighted average value of the closest available points in the map using the equation:  
\[Value=\frac{\sum_{i=1}^{size(V)}(W_{i}\cdot V_{i})}{\sum_{w\in W}w} \tag{1}\]  
where \(W_{i}\) is the weight of the \(i^{\prime}th\) neighbour, which is defined as its inverse distance from the epicenter, and \(V_{i}\) is its value. 2. Epicenter time series generation:  
In the next step, we generated (for each earthquake epicenter) a TEC time series of 48 h before the recorded main shock, again using the algorithm described immediately above. As each hour consists of four measurements, our final vector has 192 TEC values. Figure 3: An illustration of the epicenter evaluation process, where the black point is the point to be estimated, and the four red points are the nearest neighbours. 3. TEC detrending time series:  
After obtaining the epicenter time series, we filtered the solar activity diurnal trend (as can be seen in Figure 4), by subtracting a smoothed moving average time window size, equal to 1 h of data, from the original time series data (Figure 5) using the following formula:  
\[\hat{x_{i}}=x_{i}-\frac{1}{4}\sum_{j=i-4}^{i+4}x_{j} \tag{2}\]  
where \(\hat{x}\) is the detrended signal, and \(x\) is the original signal. 4. Ionospheric Quiet days-mean and standard deviation TEC time series estimation:  
Finally, we estimated the ionospheric TEC quiet days, where a quiet day corresponding to an earthquake event is defined as the same day and time of a different year, where there were no earthquakes or solar disturbances (solar storms, geomagnetic storms, or CMEs) events, with respect to the monthly mean SSN number during the event. For example, the 2011 Tohoku earthquake occurred in March, where the monthly mean SSN number was 78,  
Figure 4: An example of the epicenter time series generation process applied with a 9.1 magnitude earthquake that occurred on 3 November 2011, at 05:46 UTC, where (1–4) are the time series’ of the four nearest points to the epicenter on the map, and (5) is the resulting weighted average time series; the red line is the time of the earthquake. Figure 5: An example of the result for the daily detrending process applied to the Tohoku earthquake (11 March 2011), where (1–4) are the time series’ of the four nearest points around the epicenter location, and (5) is the resulting weighted average time series. i.e., higher than 50 (which is our fixed threshold for determining low or high solar cycle activities); thus, a corresponding quite day for this event was chosen from the same day and time of a different year, where there were no earthquakes or solar disturbances, and the monthly mean SSN number exceeded 50 SSN. Figure 6 shows an example of the TEC time series data around 11 March from 1999-2020. Using our quiet days definition described above, we found 15 candidate days, where the monthly mean SSN number exceeded 50 SSN, and from which we randomly picked one for each training set. Figure 7 shows an example of a randomly picked normalized quiet day (March 2013) compared with the 11 March 2011 Tohoku earthquake day, which was also normalized by subtracting the minimum TEC time series value from the original time series and then dividing it by its maximum value. Figure 6: An example of the earthquake epicenter time series extraction in different years.