# On a Novel Approach to Correcting Temperature Dependencies in Magnetic Observatory Data
## 4 Temperature Correction of Data
### Data for February 2021  
To find the correlation coefficients \(a\) and \(b\), we first manually specified time intervals at which approximations should be performed. Entering the interval for the correction manually enabled the minimization of the range of data correction, so fairly good data were not affected. The text file spt.txt was used to specify such intervals. Figure 2 showed that in this case, the correlation should be searched for almost the entire month. Therefore, for February 2021, the interval in the spt.txt file was set by the line  
\"2021-02-01 03:00:00; 2021-02-28 17:00:00\". The resulting \(a+bT\) was shown in Figure 6 as an orange graph. Note that due to the _G-mean_(_G_) alignment, the graph of \(a+bT\) was also unbiased. The extension of the graph \(a+bT\) in both directions by 1 month was necessary for the second step of temperature correction--that is, the localization of temperature dependencies. Why is localization done? Step 3 of the temperature correction implied the subtraction of the  
data from adjacent measurement intervals. Localization meant defining time intervals for which two conditions were fulfilled: a unified temperature dependence was valid inside; \(a+bT\) took zero values at the boundaries. Such intervals were found programmatically. In Figure 6 they were marked with green; their ends corresponded to points of the \(a+bT\) transition through 0 (the algorithm marks other special fragments in green as well, which will be described later). Thus, correcting the variometer readings on the green interval in the central part of Figure 6 would not lead to data discontinuities on its boundaries. A second text file spc.txt was used to specify all localization parameters and temperature dependencies required for the algorithm operation. For example, if the data of February 2021 were analyzed, the user entered the following line into the spc.txt file:  
\"a2021-02; 2021-02-01 00:00:00; 2021-03-01 00:00:00\". In this line, the first letter \"a\" denoted the automatic localization mode; it was followed by the year and month for which the correction was performed, and after the semicolon it was followed by two dates, accurate to the second, corresponding approximately to the beginning and end of the segment of interest. The algorithm converted this string into the string  
\"a2021-02; 2021-02-08 21:48:00; 2021-02-26 03:00:00; \(-0.8665\); 0.1621\". In this line, the automatically defined start and end dates were the closest to the boundaries of the green segment in Figure 6. The automatically determined localization interval was indicated in blue in Figure 6. At the end of the line, there were the coefficients \(a\) and \(b\) of the temperature correlation determined in the first step. Note that the automatically determined interval started from February 8. Thus, the fragment of the data for February 1-8, which was characterized by strong distortions in the \(G\) plot (see Figure 2) due to the temperature dependence of the obtained measurements, remained unaccounted. In order to account for it, the manual mode of setting temperature correction parameters was used. In this case, we took advantage of the fact that in January, the \(a+bT\) dependence character was close to that in February (Figure 6). By setting the correlation search interval equal to two months at once (1 January-1 March 2021), we determined the new correlation coefficients: \(a=-0.9195\) and \(b=0.1240\). Concurrently, the  
Figure 6: Correlation and intervals of adjustment application (localization) in February 2021. The graduation for the \(G\)-_mean(\(G\))_ (blue) and \(a+bT\) (orange) plots is shown on the left; the graduation on the right reflects the corresponding scale of temperature changes. Differently colored segments denote the data intervals used for localization (see explanations in text). right end of the green segment for February moved from 2021-02-26 03:00:00 to 2021-02-27 01:44:00.