Confirming geomagnetic Sfe by means of a solar flare detector based on GNSS

Solar Flares (SF) refer to sudden increases of electromagnetic radiation from the Sun lasting from minutes to hours. Irradiance in the Extremely Ultra-Violet (EUV) or X band is enhanced and it can produce a sudden over-ionization in the ionosphere, which can be tracked by several techniques. On the one hand, this over-ionization increases the ionospheric delays of GNSS signals in such a way as can be monitored using measurements collected by dual-frequency GNSS receivers. On the other hand, this over-ionization of the ionosphere is the origin of electrical currents which, in turn, induce magnetic fields which can be monitored with ground magnetometers. In this work we propose the use of a GNSS Solar Flare Monitor (GNSS-SF) for its utility to confirm the presence of ionospheric ionization which is able to produce Solar Flare Effects (Sfe) in geomagnetism. A period of 11 years (2008–2018) has been analyzed and contingency tables are shown. Although most of the GNSS-SF detections coincide with SF and most of the Sfe have a detected origin in the ionosphere, there are some paradoxes: sometimes small flares produce disturbances which are clearly detected by both methods while other disturbances, originated by powerful flares, go by virtually unnoticed. We analyzed some of these cases and proposed some explanations. We found that suddenness in the variation is a key factor for detection. Threshold values of the velocity of change to remove the background noise and the use of the acceleration of change instead of the velocity of change as the key performance detector are other topics we deal with in this paper. We conclude that the GNSS-SF detector could provide warnings of ionization disturbances from SF covering the time when the Sfe detectors are “blind”, and can help to confirm Sfe events when Sfe detectors are not able to give a categorical answer.


Solar flares
The Extremely Ultra-Violet (EUV) photons ionize the atmosphere creating free electrons and ions, which form the ionosphere. Solar EUV irradiance varies by as much as an order of magnitude on time scales of minutes to hours (solar flares), days to months (solar rotation), and years to decades (solar cycle). Solar Flares (SF) are a sudden enhancement in solar irradiance in both the EUV and the X band.
This sudden increase of the energy emitted by the Sun produces an over-ionization of the Earth's ionosphere that can be measured using several techniques (Mitra, 1974). In particular, enhancements of the ionospheric Total Electron Content (TEC) can be measured by the effect of the ionospheric delays experienced by the Global Navigation Satellite Systems (GNSS) measurements. In fact, using a global network of GNSS dual frequency receivers, Afraimovich (2000) showed that it is possible to monitor the ionospheric response to solar flares. Analyzing in more detail the SF effects on the GNSS signals, Wan et al. (2002) showed that these effects depend on the angular distance (v) between the Sub-Solar Point (SSP) and the Ionospheric Pierce Point (IPP) of the measurement. More recently, Hernández-Pajares et al. (2012) applied a similar model for analyzing the SFs which occurred during a period of several years. In their work, they defined a detector and an indicator of SF activity. The detector, the Sunlit Ionosphere Sudden TEC Enhancement Detector(SISTED), was based on the second difference of the Slant TEC (STEC) measurements and was able to detect 93% of the X-class SFs during a half solar cycle. The indicator, GNSS Solar Flare Activity Indicator (GSFLAI), was Topical Issue: Scientific Advances from the European Commission H2020 projects on Space Weather based on the linear fitting of the STEC rates of the satellitereceiver pairs with cos(v). Using this indicator over a whole solar cycle, they found good correlations between their indicator and the photon flux rate measured by the Solar and Heliospheric Observatory (SOHO) satellite in the EUV band (26-34 nm).
As mentioned before, several proposals to construct a flare detector from GNSS data can be found in the bibliography (Afraimovich, 2000;García-Rigo et al., 2007;Hernández-Pajares et al., 2012;Syrovatskiy et al., 2019). In our case, we also use the relationship between sudden increases of STEC and cos(v) to define two parameters for detecting SF activity. Details about these two indicators and their comparisons with similar detectors can be found in Sections 2.1 and 2.2.

Solar Flare Effects (Sfe) lists
The sudden perturbation in geomagnetic elements that follows the eruption of a solar flare, designated as Solar Flare Effects (Sfe) or a geomagnetic crochet, is a geophysical event that constitutes one of the most conspicuous Sudden Ionospheric Disturbances (SID). They are confined mostly to the sunlit hemisphere and are associated with currents that flow primarily in the ionosphere. They are caused by the extra ionization produced by X-ray and EUV flare radiation (Curto et al., 1994a(Curto et al., , 1994b. They are reported in the International Association of Geomagnetism and Aeronomy (IAGA) bulletins according to the classification established by the International Service of Rapid Magnetic Variations, SRMV, located at the Ebro Observatory, and published by the International Service of Geomagnetic Indices, ISGI (http://isgi.unistra.fr/). The lists of Sfe elaborated by the SRMV refer to events detected primarily on the basis of magnetic observations and, later, confirmed by simultaneous observation of solar activity (flares). Detection is not an easy task because many factors are present in the origins of Sfe (Curto et al., 2016). Suddenness in Sfe is very variable, ranging from a few tenths of nT/min to 10 nT/min. Additional information of ionospheric disturbances helps to confirm if a movement in the magnetograms was down to a Sfe, although this confirmation is not absolutely essential. In the past, endorsement was also sought with the ionospheric activity of several SID (A3 method for absorption in D-layer, Sudden Enhancement/Decrease of Atmospherics [SEA/SDA], etc.). These disturbances were measured first-hand with instrumentation at the Ebro Observatory or other collaborating observatories, which promptly provided their data. Most of this auxiliary ionospheric data checking has disappeared and we would like to substitute it with other indices derived from automatic methods like that of the GNSS-SF detector.
The separation of Sfe events produced by ionizing flares from other magnetic perturbations produced by corpuscular ionizations (storms, substorms, etc.) caused by CME was carried out by the Service of Rapid Magnetic Variations whose results are the Sfe lists. In this paper, our study relies on these lists and no extra checking work has been done.
This article has two separate parts. In the first part, we will present the GNSS-SF detector algorithm and its ability to detect flares and, in the second part, we will specifically analyze the capability of this detector to track Sfe. We will compute the optimal parameters to achieve the best performance.

GNSS-SF detector 2.1 Methodology
As commented on in the introduction, SFs produce sudden increases in the STEC measurements from GNSS receivers. Actually, for a given receiver "i" and a GNSS satellite "j", these increases in the STEC (DSTEC) can be measured with the wellknown geometry-free (L GF ¼ L 1 À L 2 ) combination of carrier phases: where M(e) is an obliquity factor (or mapping function) that depends on the elevation (e) and is used for mitigating the enhancement of STEC at low elevations. For instance, Figure 1 depicts an example of these sudden increases in the ionospheric delay in observations gathered for different receivers (MAS1 in the Canary Islands, VILL in the centre of Spain, and REYK in Iceland). The example corresponds to the Solar Flare which occurred around noon of September 6, 2017 (the Day of Year [DoY] 249). As can be seen, all the observations increased their ionospheric delays by several TECUs at the time the Solar Flare occurred (around 12:00UT).
As was shown in Wan et al. (2002), for each ÁSTEC j i , there should be a relationship with the angular distance (v) between the SSP and the IPP, and, in particular, a linear relationship with cos(v). Therefore, if we have a network of GNSS receivers, as that depicted in Figure 2, it is then possible to patrol the occurrence of an impact of a SF on the ionosphere by means of the relationship between ÁSTEC j i and v. For instance, Figure 3 depicts in red the values of ÁSTEC j i against cos(v) for the example presented in Figure 1 at the instant when the SF occurred (t % 43 050 s). In order to enhance the idea, we compare those ÁSTEC j i values with the same values 1 min before (t = 42 990 s, in blue). As can be seen, when the SF occurs, there is a clear dependency between ÁSTEC j i and cos(v). This dependency can be fitted to a straight line which predicts a DSTEC close to 2 TECUs at the SSP (where cos(v) = 1) (i.e., a TEC rate of 2 TECUs/min). Notice  J.J. Curto et al.: J. Space Weather Space Clim. 2020, 9, A42 that, this is a similar approach to the GSFLAI detector in Hernández-Pajares et al. (2012). However, the GSFLAI measures the slope of the fitting instead of the value of DSTEC at the SSP. Therefore, we can use the DSTEC prediction at the SSP as an indicator of the occurrence of an SF. For instance, Figure 4 depicts, for the same day, the predicted DSTEC value during a time interval where the peak at noon is clearly identified. In order to confirm the occurrence of an SF, the irradiance measured by the GOES satellite in the wavelength range of 0.1-0.8 nm is also depicted. Notice that, using the DSTEC prediction at the SSP as a SF indicator is equivalent to the GSFLAI index defined in Hernández-Pajares et al. (2012).
The example developed previously, i.e., the SF on September 6th in 2017, was one of the most powerful SFs which occurred in this solar cycle and it was an easy task to detect it from this fitting. However, this is not so easy to see for other SFs, especially if we aim to detect them in an automatic way.   For example, if we depict the DSTEC prediction at the SSP for a whole day (for instance, March 11, DoY 070, 2015, Fig. 5), it can be seen that, besides the SF class X2.2 (i.e., 2.2 Â 10 À4 W m À2 ) starting at 16:11UT, the DSTEC at the SSP also varies throughout the day, with these other variations of DSTEC having similar values to the sudden variations associated to the SF. Therefore, it is difficult to establish a threshold in order to distinguish the high values of DSTEC linked to SFs. These daily variations are related to the relative position of the Sun and the Earth's magnetic field. We depict the DSTEC at the SSP for the day before in order to confirm this.
Taking into account the time scales of SFs, an alternative way for establishing a detector is to focus on the peaks lasting just a few minutes, i.e., fast variations during short time intervals or, in other words, by taking into account not the DSTEC value but its difference with respect to the previous ones. However, this is, in some way, equivalent to considering the second difference of STEC (Á 2 STEC Figure 6 depicts the values obtained of Á 2 STEC j i for the same event presented before on March 11, 2015. As can be seen, the linear dependency between Á 2 STEC j i and cos(v) is maintained (correlation coefficient, q = À0.86) and it is even much clearer than that for the linear relationship with ÁSTEC j i (q = 0.16). Figure 7 depicts the D 2 STEC at SSP (red dots) during the whole day of March 11, 2015 (DoY 070), in a similar way as we did for DSTEC in Figure 5. As can be seen, now the large D 2 STEC values can be easily observed and we can identify an initial SF around 00:00UT (M2.9), a second SF around 07:00 UT (M1.8), and a third one around 16:00UT (X2.2). Therefore, it will be easier to establish a threshold for the automatic detection of SF. In the same figure, we also depict the correlation coefficient (q) of the linear fitting (blue line) in order to show that both D 2 STEC at SSP and q reach large values. In fact, both parameters could be used for detecting SF.
The reason for using 30 s as the time step for D 2 STEC and 60 s for DSTEC is that we can also estimate, in an easy way, a value for DSTEC at the SSP by accumulating, from any instant t o , the addition of two consecutive values of D 2 STEC: Notice that, the previous relationship is not obvious because DSTEC and D 2 STEC are not extracted from direct measurements, but obtained by fitting the corresponding measurements and, thus, they can be affected by errors in the fitted model.   Therefore, DSTEC and DSTEC* can present different variations. This is observed in Figure 8 which depicts, in blue, the Sun irradiance in the 0.1-0.8 nm band (measured by GOES satellite) during the DoY 216 in 2011. As can be seen, there is a SF class M around 04:00UT which is detected by both DSTEC and DSTEC*, in red and black respectively. However, there are other smaller class C solar flares that, because the noise, are more clearly distinguished in DSTEC*. In this sense, DSTEC* would be a less noisy indicator than DSTEC (or GSFLAI). However, we notice that the comparisons of DSTEC with DSTEC* can be done for short time intervals (hours), as misfits can introduce biases in D 2 STEC that are revealed as drifts in DSTEC* for longer time intervals. Hence, once the detection is done using D 2 STEC or q, we can use DSTEC* for quantifying the magnitude of the STEC increase at the SSP.

Data and thresholding
One of the most important issues for developing an automatic detector involves characterizing the confidence bounds of its detections, i.e., the probability of false detections (false positives). To establish such confidence bounds we have analyzed the statistical values of DSTEC and D 2 STEC at the SSP and the corresponding correlation coefficient, q, during a solar cycle (from 2008 to 2018). With this, we manage to have a large number of small, medium and large (intense) flares. According to NOAA lists (https://www.ngdc.noaa.gov/stp/ space-weather/), in this period more than 700 "intense" flares in X-ray (which include X and M type) were reported.
In order to carry out this study, we used a network of around 50 IGS receivers. This network of receivers has been changed from year to year to guarantee the number of receivers and the coverage of the network (see an example of the receiver distribution in the map in Fig. 2). In our receiver selection, we excluded those receivers that could be affected by fast variations of STEC, such as scintillation, that would increase the uncertainties of the SF detections. In this sense, following Juan et al. (2018), we excluded high latitude receivers and we used only the measurements from low latitude receivers gathered during the interval from 02:00LT to 18:00LT. For the computation of IPPs and the mapping function we used a single layer model for the ionosphere at 300 km of altitude.
In order to establish thresholds for the three detectors we computed their values during the whole solar cycle (i.e., around 1.1 Â 10 7 estimates). Figure 9 depicts three plots with the complementary of the cumulative distribution functions for the absolute values of the three parameters DSTEC, D 2 STEC, and the correlation coefficient, q, of the D 2 STEC fittings.
For instance, the figure in the left panel represents the probability of having a DSTEC value larger than the value represented in the X-axis. Beside these probabilities (represented in red), we depict, in green, the complementary of the CDF during the year 2008 (a year without relevant SF) and also the complementary CDF for a Gaussian distribution (i.e., the complementary error function, erfc), in blue. The Gaussian distribution, which has been fitted with the smaller values, can be used for characterizing how Gaussian is the distribution and, if this is the case, what is the confidence level for a specific value to be different from a Gaussian error.
From Figure 9, it is clear that DSTEC (Fig. 9a) does not present a Gaussian behavior. Moreover, the difference between 2008 and the whole solar cycle reflects the fact that the values of DSTEC at the SSP depend on the solar flux. Then, the threshold for SF detections should be adapted to the solar flux. Therefore, a detector based on the DSTEC at the SSP does not seem to be adequate for automatic detections of SF.
On the contrary, the complementary CDF for D 2 STEC (Fig. 9b) fits better to a Gaussian behavior, and a threshold value around 0.01TECU seems to guarantee a confident detection of SFs. Moreover, the results for 2008 seem to confirm this. This agrees with Hernández-Pajares et al. (2012), where a detector based on the individual Á 2 STEC j i , SISTED, was used as an SF detector. However, unlike our detector, which is based on the predicted value at the SSP, SISTED was based on the percentage of measurements having a value of Á 2 STEC j i which were over a specific threshold. Therefore, the SISTED detection depends on the receiver distribution and the selected threshold. For instance, looking at Figure 6, one can see that a threshold of 0.07 TECUs (in absolute value) for Á 2 STEC j i will be overcome only if there are observations that verify the condition cos(v) > 0:75.
Finally, the correlation coefficient of D 2 STEC (q, Fig. 9c) can be assumed to be Gaussian and it can be used as an SF detector. In this sense, for instance, a value of 0.4 for q has a probability of 10 À7 of being a Gaussian error rather than an SF, while for a value of 0.2 the probability is 10 À2 (99th percentile or 3r). In this way, looking at the results for 2008 (green points), it could be concluded that, during this year, no SFs occurred. This is confirmed by the GOES irradiance measurements with which only 20 weak C-class solar flares were reported in the band 0.1-0.8 nm. In conclusion, the value of q can be used as a measure of the confidence level for SF detection. This is a novelty with respect to previous SF detectors based on GNSS measurements, because it represents a self-consistent way for providing confidence to the SF detections.

Grouping
In order to compare SF detections from different techniques we have to take into account that these techniques measure different physical properties that evolve with different time scales. For instance, in the SF depicted in Figures 1 and 4 it is clear that there are two fulgurations from the point of view of GNSS, while, from the point of view of GOES, there is a single SF. Therefore, in order to facilitate the automatic crosschecking of SF detections, using different techniques, we have to develop an algorithm to determine when two fulgurations can be considered as part of the same SF (grouping). This is particularly the case for GNSS detections where the detections typically last fewer minutes than the others. According to the definition of D 2 STEC, one needs to compare STEC measurements taken during an interval of 1 min. Therefore, also taking into account that the recombination processes can have some influence, one should wait for several minutes with low values of D 2 STEC before concluding that the SF has ended. In this grouping process of the SF detections with GNSS we have considered 5 min (300 s), as the minimum time interval for considering two SF detections as different fulgurations. This is in line with the 4 min found for the median of the rising times of Sfe (Curto et al., 1994a).
From the previous section, we find that we can use the D 2 STEC and/or q values in order to establish thresholds for SF detections and their confidence levels can be extracted from the CDF for the correlation parameter. Therefore, a list of SFs detected by GNSS can be elaborated which will depend on the selected thresholds.
In order to make such a list, we proceed in the following way: (i) For a given pair of thresholds, we can declare a new SF at time t 0 (beginning of the SF) when a new determination exceeds the aforementioned thresholds, and the instant at which it occurs is 300 s or more after the end of the previous SF. (ii) Once the SF is detected (and t 0 established), during the next 5 min we check if the thresholds are exceeded again. If this does not happen, we define t 1 = t 0 as the final instant of this new SF. If it does occur, we update t 1 with the instant when the threshold is overcome. (iii) If t 1 differs from t 0 , we can also define t m as the time where D 2 STEC reaches its maximum value.
For instance, with a threshold of 0.01TECUs for D 2 STEC and 0.25 for q (i.e., according to the CDF for q, a confidence level 99.9th) we are able to detect 1184 SFs. Table 1 shows a part of the complete list.

Analysis
As commented in the previous section, using these criteria for the period of years 2008-2018, we obtained different candidate lists when imposing different conditions on the parameters. Our next task was to choose the more appropriate thresholds for Sfe detection. For the same period, the SRMV reported 134 Sfe events (http://www.obsebre.es/en/rapid).

Optimization
At this point, we need to find which values of the two parameters (D 2 STEC and correlation, q) are the most suitable to be used in Sfe detection. First, let us define the basic concepts for computing the Youden index as the optimization parameter to be able to choose the best parameter configuration to align GNSS_SF candidates to Sfe events (Youden, 1950), as follows: TP (True Positive) = true Sfe detected by GNSS-SF detector, FN (False Negative) = true Sfe not detected by GNSS-SF detector = Total Sfe -TP, FP (False Positive) = candidates indicated by SNSS-SF as Sfe, but which are not Sfe, TN (True negative) = candidate dismissed by GNSS-SF, and which are not Sfe.
Then, we can compute the True Positive Rate (TPR), the True Negative Rate (TNR) and the False Positive Rate (FPR): The Sensitivity and the Specificity of a marker are usually used simultaneously as a joint measure of the behavior of the marker or test diagnostic. This is because they are complementary: in general, if the fraction of true positives (TPR) increases, the fraction of true negatives (TNR) decreases. In this situation, an acceptable compromise must be reached. One of the proposed solutions is to select the cut-off point that maximizes the difference between the fractions of true positives and false positives. The maximum value of this amount is the Youden Index (YI) and the cut-off pointthe point of the ROC curve corresponding to this indexis often selected as the optimal cut-off point of the marker (Fluss et al., 2005). Thus, the Youden Index is For the Sfe, we constructed the contingency tables (Table 2 and  Table 3) and the calculation of the ROC curves ( Fig. 10a and b) for each of the variables and then we calculated the Youden indexes in order to choose the best parameter or combination of parameters and to determine their optimal threshold values. TN is very large. This means that flares with enough energy to produce an Sfe are very rare and our algorithms fortunately capture this aspect.
For the correlation parameter, it turns out that low values (q ! 0.1 or 0.2) achieve the best performance (YI = 0.99-0.92). However, the number of candidates is non assumable (10 5 ) from a practical point of view. To revise this enormous amount of data would collapse the SRMV. And when the number of candidates reaches an assumable valuewith orders of magnitude similar to the number of big Sfe detected for this periodwhich is achieved with q ! 0.4, then the Youden index is very poor (0.62). Notice that q ! 0 is not representative because the whole set of 1 149 448 samples accomplishes the condition and the grouping function sees this as a unique event. We conclude that q alone is not an appropriate condition.
For D 2 STEC we repeated the process (Table 3). With a threshold of 0.01TECUs (grey row), we obtained more assumable figures: YI = 0.82, 82% coverage in the Sfe and 1.4 Â 10 3 candidates.
The Receiver Operating Characteristic, ROC, curves are two-dimensional graphs in which the True Positives Fraction (TPF) is represented on the Y-axis and the Fraction of False Positives (FPF) is represented on the X-axis. It shows the relative compensations between the benefits (true positives) and costs (false positives).
ROC curves (Fig. 10) show that D 2 STEC has a slightly better performance at the inflection point. Any point in the ROC space is better than another one if this (the former) is to the northwest (high fraction of true positives, low fraction of false positives, or both) of the latter (Fawcett, 2006).
Then we explored the double combination of the correlation and D 2 STEC. We took the threshold of D 2 STEC to be equal to or greater than 0.01 as our fixed condition because this condition achieved the best compromise of a high YI index and an assumable number of candidates (Table 3). And then, we simultaneously imposed a threshold of correlation in a (0.2-0.25-0.3-0.35-0.4) rank because, as seen in Table 2, in this rank this condition achieved the best results. Effectively, this combination produced a significant reduction of candidates with respect to the D 2 STEC condition alone without an obvious reduction in Sfe coverage (Table 4).
When fixing the first condition in D 2 STEC ! 0.01 and requiring a second condition q ! 0.25 (grey row), the number of candidates was reduced relatively by 23% while the coverage of the Sfe was reduced relatively by only 4%. The YI index = 0.78 was still more than acceptable. It would be possible to go further in the reduction of candidates, for example, with q ! 0.4. However, in this case the candidates are reduced by 63% but the coverage of the Sfe is reduced by 26% and YI = 0.6 is no longer very satisfactory.
In summary, the double condition (D 2 STEC ! 0.01) and (q ! 0.25) is the best option for the detection of Sfe.    Even with these lax conditions, these GNSS candidate lists include 110 events (about 80% coverage of the Sfe reported by the SVMR) which is really a successful endeavor. But, what happened to the other 20%? Furthermore, there is a large number of cases (1079) detected by GNSS-SF that are not included in the Sfe lists. These facts reveal that both methods have their own limitations. We will study such limitations in this section.
Moreover, according to our experience, sometimes, powerful flares (M-type and even some X-type), go by virtually unnoticed. This is the case depicted in Figure 11a. A big X2.2 flare happened on May 13, 2013, at 01:57 UT. The magnetogram of KAK, an observatory well located to see an Sfe, only presented a magnetic variation, DB, of 15 nT but with a duration, Dt, of 35 min. However, paradoxically other small flares produce disturbances which were clearly detected by both methods (Sfe, GNSS-SF) which means the ionosphere and the geomagnetic field could be sensitive to small additional amounts of energy. Thus, it is not rare to have Sfe events which can be related to C-type X-ray flares. Figure 11b depicts an Sfe seen at the same observatory, KAK, and produced by a C9.7 flare on July 8, 2013, at 01:21 UT. The magnetic variation, DB, was 7 nT but with a duration, Dt, of 10 min.
Hence, in the detection process, apart from the intensity of the X-ray ionizing radiation, there are other factors just as important as the intensity of the flare that influence the imprinting in the ionosphere and in terrestrial magnetism. Hereafter, we will consider some limiting factors whose presence implies a detriment of our detection capacity.

Natural noise. Blind temporal window
One of the most limiting factors in Sfe event detection is the noise produced by other natural variations with frequencies close to the frequencies of phenomena producing Sfe. Most of them have a magnetospheric origin (such as pulsations and substorms). They occur spontaneously, irregularly, and, very often, simultaneously to the effects of solar flares. This happens during more than a third of the time (Curto & Gaya-Pique, 2009b) and masks our view of Sfe partially or totally. So, the current methods of event detection (GNSS-SF, Sfe) are strongly conditioned by the need to separate our signal from these other natural noises with similar frequencies. Moreover, other variations with longer wavelengths such as the diurnal and semidiurnal variations should also be removed to analyze specific cases of Sfe (Curto et al., 1994a) more clearly. As an example, we present a case reported by GNSS-SF on August 18, 2017, at 21:00 UT. Only looking at magnetism, observers could not distinguish this event because it occurred in the middle of other disturbances of a magnetospheric origin (Fig. 12). It was the coherence of the D 2 STEC signal with radial distance at SSP and diminishing amplitudes in the GNSS detector which revealed it.
As regards the GNSS-SF detector, a deep analysis of Sfe undetected by GNSS-SF reveals that in these cases, the D 2 STEC  Clim. 2020, 9, A42 signal was very weak and could not overcome its threshold, and neither could the correlation coefficient. Hence, although small ionospheric variations were present at most of the observation points, the signal had the same order of magnitude as the noise. For example, in Figure 5 it is observed that the DSTEC at the subsolar point has a similar "pattern" in consecutive days, which could indicate that, in addition to the irradiance (which does not have to vary with the rotation of the Earth), the value of the DSTEC at the subsolar point depends on the coordinates of the subsolar point. The low values of the correlation coefficient are due to the fact that the STEC signals have a poor coherence among themselves. In some cases, the dependence between the signal and the distance to the subsolar point manifests itself very weakly. That is why the model applied, in which it is assumed that there is a linear dependence with the cos(v), hardly works.

Suddenness and spectral balance
Additionally, we should remember that the lists of Sfe are elaborated on the basis of manual detection. Observers around the world produce checking lists after visual observation of the magnetic movements in the magnetograms. But they only detect them by observing contrast (suddenness) and, therefore, only sudden rises are appreciated by the human eye or even by algorithms. Therefore, the velocity in the change of radiation and, consequently, in the change of the magnetic field become elements that have the same level of importance as the absolute amplitude in terms of detection.
In the case of the GNSS-SF detector, suddenness is also a key parameter. We use the derivative as a filtering method for the separation of signal from the noise but it entails the difficulty of weakening the signal of valid ionospheric and/or magnetic variations, especially those of slow rise/fall times, making them undetectable in many cases. Using D 2 STEC instead of DSTEC implies enhancing the events with greater acceleration even more, in detriment of those that have a more constant speed. In this sense, as was shown in Hernández-Pajares et al. (2012), solar flare detections with GNSS are more sensitive to flux rates than to the flux itself. For instance, Figure 13 depicts the SFs which occurred on DoY 161 of 2014 (June 10). This case is interesting because GOES measurements detected two X-class SF (X2.2 and X1.5) in an interval of 2 h. The top panel of the figure depicts the irradiance measured by GOES and the photons flux measured by SOHO, while the bottom panel shows the rate of the fluxes depicted in the top panel.
As can be seen, the pattern of the fluxes differs from their rates, with the flux of the first SF being much clearer than the second one, which is practically not visible for the SOHO measurements. In order to compare the GNSS detections, Figure 14 depicts D 2 STEC and q during the same 2-hour period in the top      J.J. Curto et al.: J. Space Weather Space Clim. 2020, 9, A42 panel, and the DSTEC in the bottom panel. From these two panels, it is possible to conclude that the ionospheric response to SF is more closely related to the flux rates.
In these cases, which have a small signal due to the slow temporal increase in ionization, the traditional method of detecting Sfe, based on manual observations, is more powerful than GNSS-SF because observers are able to re-scale the visual window to get a complete picture of the event which can last from a few minutes to more than an hour and can have a very mild slope (Curto et al., 1994a). However, GNSS-SF, on the other hand, operates with fixed narrow temporal windows which are not possible to change. To illustrate the difficulties that we identified in the detection process, we present an additional case study where the GNSS-SF detector failed. On September 10, 2017, a powerful X8.2 started at 15:35 and peaked at 16:06 (Fig. 15). The flare was located in the NOAA 2673 region. On this day, this group was in its declining epoch, having only a quarter of the sunspots it had had a few days before and was located in the limb of the Sun (S09W83) according to NOAA files. Looking at the SOHO SEM counts, the SF is also clear, but lasting for several minutes and before the arrival of relativistic electrons several minutes after the flare (Tsurutani et al., 2009).
Comparing the flux values with the values of the SFs in Figure 13a, we can observe different proportionalities between the GOES measurements (in the band 0.1-0.8 nm) and the SOHO measurements (in the band 26-34 nm). Indeed, in the example of Figure 13b, we can see that increases in the X-band irradiance at the level of 2 Â 10 À4 W m À2 correspond to increases in the photon flux of around 2 Â 10 9 photons cm À2 s À1 , which are similar to the case depicted in Figure 15. However, in these cases, the increase of the X-band irradiance is four times larger.
These different proportionalities were reported in Curto and Gaya-Pique (2009a) but, especially, in Le et al. (2011), justifying the different effectiveness of X-band SF in ionizing the ionosphere which is more closely linked to the EUV irradiance. Indeed, comparing X-ray and EUV emissions, Le et al. (2011) only found a correlation of around 0.5. That is, broadly speaking, only half of the EUV variation relates well to X variation. Or, in other words, there may be an important fulguration in X, but, it may not exist with regards to EUV and the final result in the ionosphere can be disappointing, and vice versa. The relationship between X-ray and EUV is affected by the distance of the fulguration from the center of the Sun. That is, the EUV emissions that occur in the solar corona would suffer a greater attenuation than the emissions in the X-band. Therefore, the effectiveness in ionization of an SF would also depend on the place in the Sun where the flare has occurred.
Regarding the flux rates, the rate in the GOES measurements is more similar to the rates in the first flare in Figure 13, i.e., around 2 Â 10 À6 W m À2 s À1 . However, for the photon counts, the rate is around 2 Â 10 8 photons cm À2 s À2 , which is more similar to the second flare in Figure 13.
In geomagnetism, this event was detected as an Sfe by the magnetic observatories network collaborating with the SVMR at 15:51 UT. This Sfe was seen all the way from the west coast of America to the western republics of the former USSR. Figure 16a depicts Ebro magnetograms for this day. Its effects lasted more than one hour but even during the rise time, the variation dB/dt was slow (about 1 nT/min) (Fig. 16b).
As regards the GNSS-SF detector, it could not detect this movement. This happened because, as can be seen in Figure 17, D 2 STEC peaked at only 0.009 TECUs, which is under the threshold of detection. This weak detection can also be seen in DSTEC, which reflects only a slight increase of STEC at the SSP at the time the SF occurs. Such a small enhancement in DSTEC can be detected by a manual observation, as was done with geomagnetism in this case, but it is harder to be detected in an automatic mode.
This situation was repeated during other events. In general, we noted that events with dB/dt < 1 nT/min variation were not usually recovered by the GNSS-SF automatic detection.
Also, it is worth pointing out that for the double condition abs(D 2 STEC) > 0.01 TECUs and abs(q) > 0.25 from 2585 detected points, after grouping there are 1184 candidates. This means that most of the events are so short that they last for only about a minute! Of course such small disturbances do not produce appreciable movements in the magnetograms and, hence, they are not reported as Sfe. These are not unusual cases; in fact, 596 candidates, i.e., 50% of the grouped candidates, last only 30 s (t 0 = t 1 ), thus they correspond to very weak SF and they are undetectable in the magnetograms.

Blind spatial zones
Another adverse element for Sfe detection is the uneven distribution of the magnetic observatories around the world. There are large "blind" zones (without observatories, or without observatories collaborating with the SRMV) which prevents detection in those UT time slots. That represents 50% of the useful space (Curto & Gaya-Pique, 2009b). On the contrary, the distribution of primary GNSS TEC signals is very extensive and covers the entire globe well. Hence, the number of Sfe reported by the SRMV will be necessarily lower than the number of ionospheric disturbances detected by GNSS-SF. Nevertheless, GNSS coverage is not perfect either and large areas of the oceans are poorly covered (Fig. 2). As the linear J.J. Curto et al.: J. Space Weather Space Clim. 2020, 9, A42 adjust depends on the distribution of the IPPs, in these zones it will be difficult to achieve good correlations.
In general, most GNSS-SF candidates with a good correlation have significant D 2 STEC. However, the opposite case is not true. Many candidates with large D 2 STEC do not have a good correlation. Hence, there is a disproportion between the number of candidates depending on whether we take one parameter or the other.

Conclusions
In this study, we presented a GNSS-SF detector for solar flares and looked at its ability to confirm Sfe in geomagnetism. We consider there to be Sfe events when there are X-ray flares in the Sun, over-ionization in the ionosphere and magnetic variations on Earth, all of them coincident in time (we can say when they are "aligned"). These three event sets are similar, but not identical.
In this work, we have constructed a solar flare monitor to confirm the presence of ionospheric ionization which is able to produce Sfe in geomagnetism. We then imposed some conditions to adjust the GNSS-SF detector so as to produce a list of candidates that match the Sfe lists provided by SRMV.
A period of 11 years (2008-2018) has been analyzed and contingency tables have been produced. ROC curves and the Youden Index were used to find the optimal values of the threshold to minimize false positive rates and to maximize the true positive rates. Also, the number of candidates to be revised played an important role in our decision.
During this testing period, we have studied the performance of three parameters for detecting SF using GNSS: DSTEC, D 2 STEC and the correlation coefficient, q. From the statistical analysis, we conclude that D 2 STEC and q are the more adequate ones. In particular, we have shown that q has a Gaussian behavior and it can be used for measuring the confidence level of the detections.
The D 2 STEC parameter proved to have a superior performance than the correlation coefficient for our aims. However, with a particular set of parameters (the double condition of D 2 STEC ! 0.01 and q ! 0.25) we achieved the best performance of our GNSS-SF detector to be used as a complement to confirm Sfe detection.
However, according to our statistics, the correspondence between the candidates from the Sfe and GNSS-SF lists is not perfect. Limitations of both methods were revised. Background noise, suddenness, temporal and spatial blind windows, or spectral unbalance conditioned the detection.
Despite these limitations, the two detection methods have their own strong points and they complement each other. In particular, the GNSS-SF detector could provide alerts of ionization disturbances from solar flares covering the whole day, principally during the time when the Sfe detectors are "blind". Also the spatial coverage of the GNSS-SF detector is global while Sfe observers only patrol half of the world. In addition, the GNSS-SF detector can help to confirm Sfe events when Sfe detectors are not able to give a categorical answer regarding some doubtful cases.
On the other hand, Sfe detections can help to produce more complete lists than those produced only with the GNSS-SF method because having an algorithm with fixed patterns and a limited scope of time segments means the GNSS-SF can barely detect long flares with a gradual rise. The "manual" detection of Sfe with magnetograms (analogue record bands containing a 24-hour chart) allows the observer to mentally zoom in on different areas of the graph, covering in each case both those movements of short duration and those of long duration, so that long flares (even those that last an hour) do not escape their gaze either and are detected.