A technique for accurately determining the cusp-region polar cap boundary using SuperDARN HF radar measurements

Abstract. Accurately measuring the location and motion of the polar cap boundary (PCB) in the high-latitude ionosphere can be crucial for studies concerned with the dynamics of the polar cap, e.g. the measurement of reconnection rates. The Doppler spectral width characteristics of backscatter received by the SuperDARN HF radars have been previously used for locating and tracking the PCB in the cusp region. The boundary is generally observed in meridional beams of the SuperDARN radars and appears as a distinct change between low spectral width values observed equatorward of the cusp region, and high, but variable spectral width values observed within the cusp region. To identify the spectral width boundary (SWB) between these two regions, a simple algorithm employing a spectral width threshold has often been applied to the data. However, there is not, as yet, a standard algorithm, or spectral width threshold, which is universally applied. Nor has there been any rigorous assessment of the accuracy of this method of boundary determination. This study applies a series of threshold algorithms to a simulated cusp-region spectral width data set, to assess the accuracy of different algorithms. This shows that simple threshold algorithms correctly identify the boundary location in, at the most, 50% of the cases and that the average boundary error is at least ~ 1–2 range gates (~ 1° latitude). It transpires that spatial and temporal smoothing of the spectral width data (e.g. by median filtering), before application of a threshold algorithm can increase the boundary determination accuracy to over 95% and the average boundary error to much less than a range gate. However, this is sometimes at the cost of temporal resolution in the motion of the boundary location. The algorithms are also applied to a year’s worth of spectral width data from the cusp ionosphere, measured by the Halley SuperDARN radar in Antarctica. This analysis highlights the increased accuracy of the enhanced boundary determination algorithm in the cusp region. Away from the cusp, the resulting SWB locations are often dependent on the choice of threshold. This suggests that there is not a sharp latitudinal SWB in regions of the dayside ionosphere away from the cusp, but that there is a shallower latitudinal gradient in spectral width near the boundary location. Key words. Ionosphere (instruments and techniques) – Magnetospheric physics (magnetopause, cusp and boundary layers; magnetosphere-ionosphere interactions)


Introduction
Ionospheric measurements that provide reliable markers of magnetospheric boundaries are extremely useful for global studies of the magnetospheric system.Some ground-based instrumentation can image the ionospheric footprints of large regions of the magnetosphere and can thus study spatiotemporal boundary structure on a range of scales not accessible by in-situ satellite observations.These ionospheric observations can also provide a context for satellite observations (Pinnock et al., 2003).The polar cap boundary (PCB) in the cusp ionosphere represents the ionospheric projection of the separatrix between newly-opened and closed geomagnetic field lines (Dungey, 1961) across which mass, momentum, energy and magnetic flux are transferred during dayside reconnection.Measurements of the E × B plasma flow across the PCB, in the F-region ionosphere, provide a remote measure of the dayside reconnection rate (Baker et al., 1997).
There are a number of techniques that are used to identify the PCB in the cusp ionosphere.Each has its strengths and weaknesses.The equatorward edge of cusp particle precipitation measured by polar-orbiting satellites, such as the Defense Meteorological Satellite Program (DMSP) (Newell and Meng, 1988), provides a reliable estimate of the PCB location in the cusp.However, each satellite only provides a localised snapshot measurement of the boundary location once every 100-min orbit and cannot measure its full temporal and spatial evolution.Ground magnetometer observations of ULF wave characteristics have also been used to identify the location of the cusp (Menk et al., 1992) but are unlikely to resolve the PCB to better than 2 • due to spatial integration effects (Southwood and Hughes, 1983) and typical magnetometer separation distances.The equatorward edge of the 630 nm red line auroral emission in the cusp has also been associated with the location of the PCB (Lockwood et al., 1993;Milan et al., 1999).However, optical observations are limited by the requirement of a dark dayside ionosphere and clear skies, the small extent of all-sky camera fields-of-view relative to the latitudinal range and local time extent of the cusp, and errors in the location of the boundary due to uncertainties about the auroral emission altitude.However, global satellite images of the auroral oval are now making largescale optical estimations of the PCB location possible (Brittnacher et al., 1999).
A recent technique for determining the location and motion of the PCB uses Doppler spectral width characteristics of backscatter from the SuperDARN HF radar network.Super-DARN is a network of HF radars designed to determine the large-scale convection electric field in the polar ionospheres (Greenwald et al., 1995).The Doppler spectral width is a measure of spatial and temporal structure in the ionospheric electric field on scales comparable to, or less than, the radar sampling scales (∼50 km).Variations in the spectral width do not have a detrimental effect on the determination of the large-scale plasma convection velocity (André et al., 2000a).The spectral width is a complex convolution of the effects of (i) temporally varying electric fields in the ionosphere (e.g.those resulting from intense Pc1/2 wave activity); (ii) the geometry of the radar with respect to the large-scale convection pattern; (iii) the presence of velocity shears of the scale size of a range/beam cell; and (iv) the microscale (∼10 m) turbulence (André et al., 2000b).
By comparing SuperDARN observations of the F-region ionosphere and DMSP low-altitude satellite particle measurements, Baker et al. (1995) showed that regions of cusp particle precipitation were associated with regions of enhanced Doppler spectral width.They showed that the Doppler spectra in the cusp were often comprised of several overlapping velocity components which resulted in the enhanced widths.Moen et al. (2001) also illustrated and discussed the shape of the Doppler spectra in the cusp region.André et al. (1999André et al. ( , 2000a) ) suggested that these multiple velocity components were probably artifacts of the signal processing arising from under-sampling of the intense Pc1/2 wave activity in the cusp electric field variations.They showed that intense Pc1/2 wave activity, when simulated in the radar signal processing, produced large and highly variable Doppler spectral widths, similar to those observed in the cusp backscatter.Baker et al. (1995) also showed that, equatorward of the cusp, the Doppler spectra were typically dominated by a single velocity component resulting in Doppler spectral widths much lower than those observed in the cusp.They illustrated that during intervals when the interplanetary magnetic field (IMF) had a southward component (B z < 0), the equatorward edge of the region characterised by large spectral widths (the spectral width boundary, SWB) was coincident with the equatorward edge of the cusp particle pre-cipitation.It has since been shown that the equatorward edge of this high spectral width region also correlates well with the equatorward edge of the 630 nm red line auroral emission (Rodger et al., 1995;Milan et al., 1999).The SWB is most clearly observed in meridionally-aligned SuperDARN beams.As beams become more zonally-aligned, other factors that may be unrelated to the cusp can become major causes of enhanced spectral widths.
The equatorward edge of cusp particle precipitation and its proxies (e.g. the SWB and the equatorward edge of the cusp 630 nm auroral emission) do not always describe exactly the location of the PCB in the cusp.Generally, there exists a small (< 1 • ) latitudinal displacement between the real ionospheric location of the PCB and the equatorward edge of the cusp precipitation.This occurs because the precipitating cusp ions take a finite time to travel from the reconnection site on the dayside magnetopause to the ionosphere, during which time the footprints of the newly-reconnected flux tubes, down which these ions are traveling, have convected poleward (Rodger and Pinnock, 1997;Lockwood, 1997;Rodger, 2000).Therefore, one must be careful when interpreting spatial and temporal variations of the proxies in the cusp region.These can be due to variations in the offset of the proxy from the PCB, as well as to variations in the PCB itself (Chisham et al., 2002).It is also unclear what effect the transient nature of reconnection will have on the variation of this proxy offset and on the location of the observable cusp (e.g.temporally varying electric fields may result in complex variations in the plasma convection in the cusp).
The change in the character of the spectral widths at the cusp boundary is increasingly utilised for the determination of the PCB.The extensive spatial and temporal coverage of the SuperDARN radars means that there is the possibility for prolonged (∼12 h) monitoring of the cusp PCB.In order to be able to determine the boundary from spectral width characteristics, we need a method which reliably identifies the transition into the cusp.By looking at a number of events, Baker et al. (1995) suggested that the distribution of spectral widths in the cusp region could be approximated by a Gaussian distribution centred on ∼220 m/s.They also suggested that the distribution of spectral widths equatorward of the cusp could be approximated by an exponential distribution with a maximum near ∼50 m/s.Thus, a popular technique is to choose a spectral width threshold above which the spectral width values are likely to originate from the cusp spectral width distribution, and to develop an algorithm which searches poleward along a radar beam until this threshold is exceeded.The choice of the optimum threshold is difficult because the probability distributions of the spectral widths above and below the SWB are broad and have considerable overlap.The spectral width distributions may also vary due to other factors, such as the radar beam geometry, as illustrated by André et al. (2000b).This is particularly a problem with SuperDARN beams that are not meridionally aligned.The cusp spectral width distribution has also been described by a Gaussian centred on ∼350 m/s (Provan et al., 1998;Chisham et al., 2001).In these cases, shorter radar integra-tion times and different pulse sequences may have led to the greater modal value of spectral width than that observed by Baker et al. (1995).Thus, it is important to identify the distributions for each data set being studied, because different distributions will obviously require different spectral width thresholds to be applied.
Additional rules (see examples below) can make threshold algorithms more reliable but no standard spectral width threshold value, or algorithm, has been universally employed to identify the SWB in the cusp region.Baker et al. (1997) first used a threshold method to estimate the location of the PCB.For each radar scan they determined the most equatorward range gate for which the spectral width value exceeded 150 m/s, for each radar beam.Then they fitted a linear function of magnetic latitude, as a function of magnetic longitude, through the set of points.Each boundary could then be represented by the latitude at the centre of the field-ofview and the orientation of the boundary.These boundary locations were then temporally averaged over 3 consecutive scans.Pinnock et al. (1999) determined their boundary by taking the first range gate at which the spectral width exceeded 150 m/s for three well-spaced radar beams from each scan and applied a linear fit to these three points to provide their estimate of the boundary latitude and orientation.Pinnock and Rodger (2001) excluded all backscatter with spectral widths less than 150 m/s from a composite of scans from 4 SuperDARN radars and then smoothed the remaining equatorward backscatter boundary to obtain their estimate of the boundary.Chisham et al. (2001) used a threshold of 250 m/s for their one event, since less than 10% of sub-cusp backscatter lay above this value.Their algorithm specified that the average spectral width in the three range gates above the suspected boundary position also had to be greater than 250 m/s.They applied their algorithm to a spatially smoothed data set for greater statistical reliability of the boundary determination.Moen et al. (2001) used the criterion that range gates with spectral width values greater than 220 m/s lay within the cusp region.The boundaries that they determined correlated closely to the equatorward boundaries of 630 nm cusp aurora.In summary, studies have used variable techniques and variable thresholds.None have fully quantified the uncertainty in their boundary determinations.
In this paper, we shall assess the accuracy of determining the SWB using a threshold-based technique, both by using probability theory and by simulating HF radar spectral width data sets typical of the cusp region and by applying a number of threshold-based algorithms.The accuracy of each algorithm will be measured both in terms of the uncertainty in the boundary location and the probability that a boundary will be identified at all.As a result of this analysis, we propose a new threshold-based method with high accuracy and reliability in identifying the SWB.The method can be fully automated to allow us to easily carry out large statistical studies of processes occurring at the boundary.We also test these algorithms by applying them to spectral width data from the Halley SuperDARN radar.

Technique and instrumentation
In this paper we study the reliability and effectiveness of three different threshold algorithms for determining the SWB in the cusp region.For the simplest algorithm it is possible to study it both theoretically and by simulation.The more complicated algorithms were studied using simulations only.The simulation was designed to represent a typical cusp region spectral width data set which might be observed in a meridionally-aligned SuperDARN beam.In the simulation, each scan is comprised of a single meridional beam with 12 range gates.The SWB was placed between range gates 6 and 7.The earlier study of Baker et al. (1995) suggested that the distribution of spectral width values in the cusp was approximately a Gaussian, whereas that equatorward of the cusp was approximately exponential (see Introduction).In accordance with this, the spectral width values for range gates 1 to 6 (below the boundary) were taken randomly from an exponential distribution of values with a mean of 100 m/s.The spectral width values for range gates 7 to 12 (above the boundary) were taken randomly from a Gaussian (normal) distribution of values with a mean of 230 m/s and a standard deviation of 100 m/s.Throughout this paper, references to above the boundary always relate to regions poleward of the boundary, and references to below the boundary relate to regions equatorward of the boundary.Taking random values in the simulation assumes that the only relationship between adjacent spectral width measurements is that they originate from the same parent statistical distribution.This assumes that there is little direct correlation between adjacent measurements, which matches the variation of spectral width values typically observed in the cusp region.Each simulation is comprised of 10 6 independent simulated radar scans and we applied the threshold algorithm to each scan, using four spectral width thresholds (150,200,250, and 300 m/s).From the simulations we detect the percentage of correctly identified boundaries, and the rms error in the estimated boundary location.We also determine the spectral width distributions above and below the boundary which resulted from applying the threshold algorithm.
The threshold algorithms were also applied to spectral width data sets from the dayside ionosphere measured by the Halley SuperDARN radar.SuperDARN (The Super Dual Auroral Radar Network) is a network of coherent scatter HF radars (Greenwald et al., 1995) which measure backscatter from magnetic field-aligned decametre-scale ionospheric irregularities.The radars transmit HF signals which are refracted towards the horizontal as they enter ionospheric regions with higher electron concentrations.If these regions contain irregularities, the radar signals are backscattered when they are propagating perpendicular to the magnetic field (i.e.perpendicular to the irregularities).In the highlatitude ionosphere, these irregularities are often present (Tsunoda, 1988), they move with the background plasma drift at F-region altitudes (Villain et al., 1985;Ruohoniemi et al., 1987), and hence provide information about large-scale convection and related processes in the radar field-of-view.
The radars transmit power at a frequency in the range of 8-20 MHz and from the return signals, an estimate of the variation in backscatter power, line-of-sight Doppler velocity and Doppler spectral width in the radar field-of-view is derived (Baker et al., 1995).The SHARE (Southern Hemisphere Auroral Radar Experiment) Halley radar is part of the Super-DARN network.It is located at Halley, Antarctica (75.5 • S, −26.6 • E) and transmits in the direction of the geomagnetic south pole.The radar scan sweeps through 16 beam positions differing by 3.25 • in azimuth.In this study we have only used spectral width data from intervals when the radar is operating in its common mode.During common mode operations, each beam comprises 75 range gates with a pulse length of 300 µs (equivalent to 45 km) and a lag to first range of 1200 µs (180 km).This study employs data from Halley beam 8, which is directed approximately along a magnetic meridian and covers a geomagnetic latitude range from −67 • to −85 • .

Basic threshold algorithm (Algorithm 1)
We start by considering the most basic threshold algorithm (termed algorithm 1) for determining the SWB.This algorithm can be described as follows: (1) For the radar beam in question, start at the most equatorward range gate for which data exist; (2) search poleward to the first range gate for which the spectral width threshold is exceeded.This range gate represents the estimate of the SWB position for this beam.This algorithm is similar to that used by Moen et al. (2001).The simplicity of this basic algorithm (no additional rules) allows us to perform a simple theoretical study of the expected variation in the boundary accuracy for different spectral width thresholds.This helps in understanding the results of subsequent numerical simulations employing more complicated threshold algorithms.
If we consider the spectral width measurements, w i , made along a beam at range gates i {1, L}, and that the true SWB lies at the interface between range gates m − 1 and m, then we can state that the probability density function (pdf) of w i is given by, where B(w) represents the unknown distribution of spectral width values below the SWB (approximated by an exponential in this study) and C(w) represents the unknown distribution of spectral width values above the SWB (approximated by a Gaussian in this study).We assume that B(w) and C(w) are overlapping, but different, pdfs such that a threshold spectral width value, x, may be chosen where it is more likely that w i ≥ x corresponds to range gates above the boundary (i ≥ m).
If we let our estimated SWB be located at i = k, where w i < x for i < k, and w k ≥ x, (i.e. the SWB is the first range gate for which w i ≥ x), then we can write the probability of a boundary being identified at range gate k as, where, is the cumulative distribution function (cdf) of the distribution below the boundary, in this case an exponential distribution with mean 1/λ, and is the cdf of the distribution above the boundary, in this case a Gaussian (normal) distribution with mean µ and standard deviation σ ( represents the standard normal cdf).
Using the same beam design and distribution parameters as those designed for the simulations, as discussed in Sect.2, we have m = 7, L = 12, 1/λ = 100 m/s, µ = 230 m/s, and σ = 100 m/s.Thus, we can use this theoretical analysis to study the accuracy of this basic threshold algorithm.In Fig. 1 we present histograms of the percentage occurrence of the estimated location, k, of the first range gate above the SWB derived from this theoretical analysis, for 4 different spectral width thresholds (x = 150, 200, 250, and 300 m/s).The first noticeable feature of the figure is that even in the best case scenarios (for thresholds of 200 and 250 m/s), the boundary is only correctly identified in ∼26% of the cases.There are many cases where the estimated boundary range is some distance from the actual SWB.This is seen especially when using a threshold of 150 m/s; the SWB is often placed at very low ranges.This is a result of (1 − p) being large for lower thresholds and hence, there is a higher likelihood of a cusp identification in the sub-cusp region.For larger thresholds, q is increasingly large and hence, P (k > m) is increased, resulting in the long tail seen in the cusp region.Generally, there is a large overlap between B(w) and C(w) for any x.The simulation employing the basic threshold method reproduced the theoretical results presented in Fig. 1 exactly.
The probability of identifying a boundary anywhere along a beam is given by (5) An ideal algorithm would identify 100% of the existing boundaries.However, for a finite number of range gates, L, there is a non-zero possibility that w i < x for all i {1, L}.
Less boundaries are identified when employing higher spectral width thresholds, since the probability that w i > x is reduced both below ((1 − p) is small) and above ((1 − q) is small) the SWB.Consequently, with higher thresholds it is harder to satisfy the requirements of the algorithm within the finite beam length.Figure 2 presents the variation of the percentage of identified boundaries with spectral width threshold as predicted by the theoretical analysis using the simulation design outlined in Sect. 2. It illustrates that for low threshold values the majority of boundaries can be identified.The number of boundaries identified starts to fall off at a threshold of ∼230 m/s and has fallen below 30% for a threshold of 400 m/s.This would suggest that a low threshold needs to be employed when using the basic algorithm, to identify an appreciable number of boundaries.Again, the simulation employing the basic threshold method (algorithm 1) reproduced the theoretical results exactly.
The accuracy of the SWB determination can be quantified by the rms error Figure 2 presents the rms error in the boundary location (in range gates) for each threshold value.In an ideal algorithm this error would be less than one range gate at the optimum spectral width threshold, because one range gate represents the resolution of the system and hence, is the minimum uncertainty that can be realistically achieved.The error displays a clear minimum in its variation, placing the optimum spectral width threshold for this analysis at ∼270 m/s.However, in this case the boundary error is still very large, being, on average, ∼3 range gates, which for real common mode SuperDARN data would represent 135 km, or ∼1 • -1.5 • of latitude.This does not represent a very reliable boundary determination.Once again, the simulation employing the basic threshold method (algorithm 1) reproduced these theoretical results exactly.
We can also determine the pdfs of the output spectral width distributions resulting from the application of the basic algorithm.The spectral width distributions below and above the estimated SWB are given by where is the probability that measurements below the identified SWB come from B(w), and where is the probability that measurements below the identified SWB come from C(w).The spectral width distribution above the estimated SWB is given by where is the probability that measurements above the identified SWB come from B(w), and where is the probability that measurements above the identified SWB come from C(w).
The output spectral width distributions predicted by the theory are presented in Fig. 3.Although the input distributions were an exponential and a Gaussian, we see that these distributions are not reproduced particularly well by the application of the basic algorithm.In particular, within each distribution there exists a discontinuity at the threshold value.Below the spectral width boundary the distribution drops to zero above the threshold spectral width value, by definition.For small w, B(w) C(w) and hence, the distributions all start with an exponential-like drop off, as expected from the input distribution, B(w).Similarly, the distributions above the SWB also start by dropping off exponentially, since B(w) C(w) initially.This part of the distribution arises from range gates below the boundary that have been erroneously placed above the boundary due to the placement of the boundary at too low a range gate.The low spectral width part of this distribution is a combination of both input distributions; as the exponential B(w) term in the distribution starts to drop off, so the Gaussian C(w) term starts to increase, and the distribution becomes more Gaussian.Like the spectral width distribution below the boundary, that above shows a discontinuity at the threshold value.Above the threshold this distribution contains values from both input distributions.For large w, the distribution tends towards the Gaussian C(w).This ill-matching of the output and input distributions further illustrates the shortcomings of this basic algorithm.Another feature of the distributions is the reduction in occurrence number with increasing threshold value.This is a result of less boundaries being identified for higher threshold values, as discussed earlier in this section.Performing the simulation employing this basic threshold method results in identical output distributions of the spectral width values below and above the estimated boundary location.

Threshold algorithm using spatial filtering on one beam (Algorithm 2)
The results presented in the previous section illustrate that algorithm 1 is too simple to consistently make an accurate identification of the boundary location.We need to adjust the algorithm by adding additional rules (as discussed in the Introduction), in order to increase accuracy.The major problem with algorithm 1 is that there is a large overlap between the two input spectral width distributions B(w) and C(w) such that for any threshold value, x, there is an appreciable probability that either a high spectral width value will be measured below the true SWB, with probability (1−p), causing the estimated SWB to be erroneously low, or that a high spectral width value will not be measured at or above the true SWB, with probability q, causing the estimated SWB to be erroneously high.
A solution that has been offered to this problem is to use spectral width measurements from more than one range gate to estimate the SWB.This is the general approach used by Baker et al. (1997), Pinnock et al. (1999), Pinnock andRodger (2001), andChisham et al. (2001).All used some form of weighted average of spectral width measurements at several range gates to decide if a point was above the SWB.The expected value of a distribution is unchanged by averaging but its variance is reduced by 1/n, effectively resulting in a thinning of the distributions.Thus, the overlap between B(w) and C(w) is reduced and the likelihood of an erroneous boundary identification is reduced.For example, let us define the SWB as the first range gate with a spectral width value above the chosen threshold (as in the basic algorithm), and for which the spectral widths of two of the subsequent three range gates poleward of this range gate are also above the threshold.Hence, the probability of a range gate below the true SWB being erroneously identified as being above the SWB is This is less than (1 − p), the probability of erroneous identification for the basic threshold method.The probability of a range gate above the true SWB being erroneously identified as being below the SWB is This is actually greater than q and so we would anticipate that the probability of overestimating the SWB latitude would be increased but the probability of underestimating the SWB latitude would be reduced.A similar rule was employed by Chisham et al. (2001).This rule defines algorithm 2 which we will apply in the following simulation.Additionally, to avoid the problem of multiple high spectral width values at low ranges we will start our poleward search of a beam at the first range gate with a spectral width value below the threshold value.Such an algorithm is too complex to allow for a simple theoretical analysis and hence, its accuracy is studied by simulation only.We performed the simulation described in Sect.2, applying threshold algorithm 2 to the spectral width data.In Fig. 4 we present histograms of the percentage occurrence of the estimated location of the first range gate above the SWB which results from the application of algorithm 2, for the 4 different spectral width thresholds.There is a significant improvement in accuracy over algorithm 1 (c.f.Fig. 1).However, even in the best case scenario (for a threshold of 150 m/s), the boundary is only correctly identified in ∼46% of the cases.Using a threshold of 300 m/s reduces this figure to ∼32%.Note that, as predicted above, the likelihood of overestimating the SWB latitude is increased, as seen by the less rapid fall-off of probabilities with increasing range gate > 6 for a 300 m/s threshold.Thus, even using the improved algorithm 2, there are many cases where the estimated boundary range is some distance from the actual SWB.
Similar to Fig. 2, we present in Fig. 5 the variation of the percentage of scans within which a boundary was identified, and the rms error in the boundary location, with increasing spectral width threshold when applying algorithm 2. Figure 5 illustrates that it is only for very low threshold values that the majority of boundaries can be identified for these simulation conditions.The number of boundaries identified falls below 50% for a threshold of 230 m/s and below 10% for a threshold of 300 m/s.This is a result of needing at least three range gate measurements to identify a boundary; no boundaries can be identified at the highest two range gates in a beam.Figure 5 suggests that a very low threshold needs to be employed, when using algorithm 2, to have the best chance of identifying a boundary.The rms boundary error displays a clear minimum in its variation, placing the optimum spectral width threshold for this analysis at ∼200-210 m/s.In this case the boundary error is ∼1.4 range gates, which for a real SuperDARN data set would represent ∼65 km, or ∼0.5 • -1 • of latitude.Using this threshold, only ∼70% of the boundaries are identified by algorithm 2.
In Fig. 6 we present the spectral width distributions which result from this simulation, both below and above the estimated SWB.As with the results of the basic algorithm (c.f.Fig. 3) we see that within each distribution there exists a discontinuity at the chosen threshold value.Otherwise, the distributions resemble the input distributions more closely than with algorithm 1 (c.f.Fig. 3); the distributions below the boundary appear to drop exponentially at low spectral widths before dropping sharply at the threshold value and then continuing to drop exponentially towards higher spectral widths.The distributions above the spectral width boundary start by growing in a Gaussian manner at low spectral widths before sharply rising at the threshold value and then continuing to vary in a similar way to the Gaussian input distribution.These results represent an improvement over those of algorithm 1, although the presence of the discontinuities in the distributions shows that there is still a large degree of mixing of the two input distributions in the output.This implies that there are still too many boundary locations that are misidentified.
In order to be able to usefully compare the results of this simulation with real observations, we need to understand the sensitivity of the simulation results to the simulation input parameters and conditions.In the simulation we have used a number of static input parameters which will vary in a real data set.First, there are the input distribution types and variables.The choice of exponential and Gaussian distributions for the input spectral width distributions below and above the boundary, respectively, may not be strictly identical to the distributions presented in observational studies (e.g.Baker et al., 1995;Chisham et al., 2001), but there is enough of a qualitative match to allow a good study of the mechanics of the boundary determination algorithm.More difficult is the choice of the distribution parameters (namely the mean of the exponential distribution, and the mean and standard deviation of the Gaussian distribution).The choice of these parameters affects the overlap of the two distributions and hence, the ability of the algorithm to distinguish between them.This represents a difficult choice as various studies have identified different distribution parameters (see Introduction).For example, the distribution parameters used in the current simulation result in an overlap of the two distributions (above and below the boundary) of 43.1% of each distribution.If we change the mean of our Gaussian input distribution from 230 to 350 m/s (matching the cusp spectral width distributions as observed by Provan et al., 1998;Chisham et al., 2001), the total overlap of the distributions reduces to 20.2%.In this case the two distributions are more distinct, and the accuracy of the boundary identification is enhanced.
The results of the simulation are also affected by the number of range gates chosen for the simulated scan, and how these range gates are distributed below and above the actual SWB (this corresponds to the amount, and distribution, of radar backscatter in a real data set).Increasing the total number of range gates increases the percentage of boundaries identified, but also increases the rms error in the boundary location; there are more ranges where erroneous determinations can be made, and at larger distances from the SWB.The optimum threshold for boundary identification also changes when the number of range gates below or above the boundary is increased or decreased.These results suggest that, since the spectral width distributions seen in real observations may vary, and as the number of range gates containing usable data is also often highly variable, that it may be difficult to find a single optimum threshold for the determination of the SWB in a real SuperDARN data set.
5 Enhanced threshold algorithm using spatial and temporal filtering (Algorithm 3) The simulation and data analysis in Sect. 4 have shown that the determination of the SWB by algorithm 2 (which included additional rules) has modest uncertainties on a large number of occasions.The big question is how to further adjust the algorithm in order to increase the reliability of the boundary determination further and hence, recover the most accurate spectral width distributions from above and below the SWB.
The accuracy of the boundary determination is highly dependent on the degree of overlap between the spectral width distributions below and above the actual SWB.As discussed in Sect.4, smoothing or averaging the data set before the application of the boundary determination algorithm makes it possible to effectively reduce the width of the distributions so that they become increasingly distinct from each other, resulting in a large increase in the accuracy of the boundary determination.This has already been done to some extent with algorithm 2. This smoothing can be performed spatially (using data from adjacent radar beams), or temporally (using data from previous and subsequent scans), or both.Chisham et al. (2001) spatially smoothed their spectral width data set before the application of their threshold algorithm.This would have increased the accuracy of their boundary determination.The downside of smoothing can be a loss of spatial and/or temporal resolution in the boundary location.In this section, we illustrate how smoothing increases the reliability of the threshold method in determining the SWB, and discuss the effects of the potential loss of resolution.
An effective way to reduce the width of the input spectral width distributions is to median filter the spectral width data over an adjacent number of measurements.In algorithm 3 we apply this filtering both spatially and temporally.First, we spatially median filter the spectral width measurements from each range gate across corresponding range gates from three adjacent radar beams (using one from either side of the selected radar beam).Second, we temporally median filter the resulting spectral width for each range gate across five consecutive scans (using two on either side of the scan of interest).In Fig. 7, we present occurrence histograms illustrating, in black, the exponential and Gaussian distributions that we have used as input to our simulations.There is a big overlap between the exponential distribution used to represent the spectral width values below the boundary, and the Gaussian distribution used to represent the spectral width values above the boundary (as discussed in previous sections).The yellow occurrence histograms in Fig. 7 represent the effective distributions that result after employing the spatial and temporal median filtering.The overlap between the two distributions has been greatly reduced from 43.1% to 3.0%.It is now a rather trivial task to distinguish between these two distributions and accurately identify the SWB location.Algorithm 3 first performs this median filtering and then applies the additional rules from algorithm 2, as described in Sect. 4.
We repeated our simulation using algorithm 3.In Fig. 8 we present the distributions of the estimated boundary locations (in percentage occurrence) which result from the application of algorithm 3, for the same 4 spectral width thresholds.It is clear that there has been an increase in the accuracy of the boundary determination, for some thresholds, over the simulation results presented in Figs. 1 and 4. Using a threshold of 150 m/s results in ∼96% of the boundaries being accurately identified at the correct range gate.For a threshold of 200 m/s this figure is still high, but reduced to ∼77%.Using thresholds of 250 and 300 m/s provides a poor estimate of the boundary, but, as we will soon show, there are very few boundaries identified in this simulation when using these thresholds.
In Fig. 9 we present the variation in the percentage of boundaries identified and the rms boundary error, with increasing spectral width threshold (c.f.Figs. 2 and 5), for the present simulation.There are some distinct changes between this figure and Fig. 5.There is a sharp cutoff between almost 100% of the boundaries being identified (< 180 m/s) and almost no boundaries being identified (> 270 m/s).The boundary error has been reduced for a small range of thresholds (down to ∼0.3 range gates at 160 m/s) which clearly selects an optimum threshold for this simulation.Any error below one range gate is good, as this represents the minimum practical uncertainty of any measurement.However, we must stress that these results only apply to the model distributions that form the input to the simulation, and that the real cusp and sub-cusp spectral width distributions will differ from these.However, this analysis illustrates the improvement made to the boundary determination by median filtering the spectral width data before the application of the boundary determination algorithm.
In Fig. 10 we present the spectral width distributions which result from this simulation.The output distributions match more closely to the input distributions than in the previous simulations, being approximately an exponential curve below the boundary, and a Gaussian above it.There is very little evidence of a discontinuity in the distributions at the threshold value, as occurred when applying algorithms 1 and 2. The effective thinning of the input distributions has also reduced the number of boundaries determined when using the higher threshold of 250 m/s, and almost no boundaries are detected for a threshold of 300 m/s.This is not suprising as Fig. 7 illustrates that in the effectively thinned distributions the majority of the spectral width values (both above and below the boundary) are below 300 m/s.When applied to real data, the details of this effect will differ depending on the underlying spectral width distributions.
The downside of using algorithm 3 is the potential loss of spatial and/or temporal resolution in the boundary variation.Our simulations have used a SWB located at a fixed range gate and so no latitudinal resolution has been lost, or additional error introduced, when the data were median filtered over adjacent estimates.In a real data set the boundary location might change its latitudinal position from one scan to the next and hence, any smoothing of the data would potentially lead to a loss of resolution.This has the potential to increase the error in the boundary location estimate.Hence, when choosing the median filtering characteristics it is necessary to compromise between the increased thinning of the input distributions provided by increased median filtering, and the associated loss of resolution in the boundary variation.The filter characteristics chosen for algorithm 3 were found to provide the best balance between these two aspects.Reducing the temporal filtering to 3 consecutive scans resulted in the reappearance of small discontinuities in the output distributions at the threshold values.
In order to study the effect of the median filtering in algorithm 3 on the detection of temporal variations in the boundary location, we performed a number of simulations for which the boundary location varied from scan to scan.In these simulations the boundary varied sinusoidally (or as close to sinusoidally as possible, considering the finite range gate size), and the simulations were repeated for sinusoidal variations with different wavelengths and amplitudes.The input spectral width distributions above and below the boundary were the same as those used in the previous simulations.
In Figs.11 and 12 we compare the results of using algorithms 2 and 3 in these variable boundary simulations, employing a threshold value of 150 m/s.In these figures the black lines represent the results of algorithm 3 and the yellow lines represent the results of algorithm 2. In Fig. 11 we present the percentage of correct boundaries identified using the two algorithms for a range of boundary variation wavelengths (in scans) and boundary variation amplitudes (in range gates).Figures 11a-c represent results for boundary variation amplitudes of 2, 3, and 4 range gates, respectively (4, 6, and 8 range gates peak-to-peak).The dashed black line represents the number of correct boundaries identified by algorithm 3 when there is no variation in the boundary location (equivalent to an infinite wavelength or zero amplitude boundary variation).The reliability of algorithm 2 (yellow lines) does not change with the wavelength of the boundary motion.This is not suprising as the boundary in each scan is determined independently of the adjacent scans.The reliability of algorithm 3 (solid black lines) increases with increasing wavelength, tending towards the dashed line.However, it drops off dramatically below wavelengths ∼10 to 15 scans (depending on the boundary wave amplitude) and becomes less accurate than algorithm 2 for wavelengths of <∼10 scans.
In Fig. 12 we present the rms boundary error identified using the two algorithms, in the same format as Fig. 11.Again, the boundary error resulting when applying algorithm 2 (yellow lines) does not change with the wavelength of the boundary motion.The error resulting with algorithm 3 (solid black lines) decreases markedly with increasing wavelength.The error is larger than that for algorithm 2 at wavelengths of <∼8 scans.These smaller wavelengths imply that the boundary is often changing by more than 2 range gates per scan.When the boundary is regularly fluctuating at this rate algorithm 3 is less accurate than algorithm 2. This is due to the temporal smoothing of the spectral width data removing these sharp variations from the data set.Although the loss of temporal resolution could be a problem at times of rapid boundary motion, these results show that, in the main, algorithm 3 is the most reliable algorithm to apply automatically to the spectral width data set.

Application of threshold algorithms to SuperDARN data
Figure 13 presents the results of applying algorithms 2 and 3 to spectral width data from the poleward-pointing beam 8 of the Halley radar during an interval of good backscatter between 13:30 UT (∼10:30 MLT) and 16:30 UT (∼13:30 MLT) on 20 August 1998.The data set is characterised by low spectral widths at low latitudes and higher spectral widths at higher latitudes, as is typical in the dayside ionosphere (and especially the cusp region), during intervals of southward IMF.The black solid line illustrates the temporal variation of the estimated boundary position when employing a spectral width threshold of 200 m/s with algorithm 2. Although there is an overall equatorward motion of this boundary during much of the interval, there is a high degree of variability in the estimated boundary location.It is not immediately clear whether this temporal variation reflects the actual variability of the SWB or whether it is a by-product of algorithm 2. In some cases, the derived boundary changes by ∼5 range gates (∼225 km) in one scan period, which represents an atypically large boundary motion of ∼1.3 km/s.It is important for us to understand the uncertainty in the derived boundary variations if they are to be used for any quantitative studies.The red solid line illustrates the temporal variation of the estimated boundary position when applying algorithm 3 with the same spectral width threshold.The large variability in the boundary location seen when using algorithm 2 has been largely removed, and we see a much smoothed boundary variation.Only twice do we see changes greater than 2 range gates per scan.
We have applied both algorithms 2 and 3 to one year's worth of cusp-region spectral width data (from 1998) from beam 8 of the Halley SuperDARN radar, with the prime motive of examining the spectral width distributions above and below our estimated boundary location for comparison with earlier studies (e.g.Baker et al., 1995) and with the simulation distributions.In this study we have used only ionospheric backscatter from common mode intervals.In applying algorithm 3 to real data sets which are characterised by patchy data coverage, we have relaxed the temporal median filtering requirements so that estimates are median filtered over 3-5 scans, depending on the data available.This is in order to optimise the number of boundaries identified.
In Fig. 14 we present the resulting distributions of the spectral width values observed below and above the SWB, as determined using algorithm 2 with the same four spectral width thresholds as used in the simulations (150,200,250, and 300 m/s).Only spectral width data from the cusp region (08:00-12:00 MLT), and from within 10 range gates (450 km) of the estimated boundary location, were used in the compilation of these distributions.The observed distribu-tions illustrate similarities with the simulation results and further illustrate how the choice of threshold, and factors within the algorithm, have affected the resulting distributions.As the simulations showed, the presence of a large discontinuity in all the distributions at the threshold value is evidence that the boundary location is often being misidentified and that the distributions above and below the boundary are being intermingled in our results.
In Fig. 15 we present the resulting distributions of the spectral width values observed below and above the SWB, as determined using algorithm 3 with the same 4 spectral width thresholds (150,200,250, and 300 m/s).Again, only spectral width data from the cusp-region ionosphere (08:00-12:00 MLT), and from within ± 10 range gates (450 km) of the estimated boundary location, were used in the compilation of these distributions.As with the simulation results for algorithm 3, the discontinuity at the threshold value (which was evident in the case of algorithm 2 in Fig. 14) has been completely removed.This suggests that there has been a reduction in the mixing between the input distributions, and consequently, that the boundary determination is more accurate.
One difference from the simulation distributions is the absence of a reduction in the size of the distributions with increasing spectral width threshold.This is likely due to the above-boundary distribution appearing to be more of a longtailed distribution than the Gaussian distribution used in the simulations.This will raise the median of the distribution (and hence, of the reduced distribution which results from the median filtering) to a value above the threshold values employed.In this case there will be very few instances of no boundary being identified within a scan.There is still a feature of the distributions which appears threshold dependent.The peak of the above-boundary distribution shifts to higher spectral width values when employing higher spectral width thresholds.In other regions of the dayside ionosphere, away from the cusp (not shown), this effect is more pronounced.The possible reasons for this are discussed in the following section.
This section has presented results of the application of algorithm 3 to common mode SuperDARN data only.There may be instances, when analysing non-common mode data, when different median filtering parameters may be more applicable to the analysis.For instance, spatial filtering may not be suitable for special modes with non-standard scans.It may also be desirable to increase the number of scans over which temporal filtering is applied in cases of high-time resolution data.

Discussion
In this study we have applied three different threshold algorithms to both simulated and actual spectral width data which represent the cusp-region ionosphere, with the prime motive of determining which best estimates the SWB, and hence, the PCB in the cusp region.Both the simulations and the data analysis have shown that the most accurate boundary determination results from using an enhanced algorithm which first spatially and temporally median filters the spectral width data (algorithm 3).Applying this algorithm removes the discontinuity at the threshold value in the output spectral width distributions, which is a major indicator of intermixing of the input distributions, and hence, inaccurate boundary determinations.This is a clear sign that the algorithm is being successfully applied.However, there is the caveat that, in data sets where the boundary is moving rapidly (at >∼2 range gates/scan), the boundary determination accuracy is reduced.
We have applied our analysis to spectral width data from the typical location of the cusp region (08:00-12:00 MLT).The original study of Baker et al. (1995) focussed only on the spectral width variations seen in the cusp and low-latitude boundary layer (LLBL) (as defined by low-altitude satellite observations).André et al. (2000b) have since presented a statistical study of the average spectral width variations observed across the whole polar ionosphere by the Northern Hemisphere SuperDARN radars.They showed that the average spectral width is at a maximum within the cusp region (>250 m/s between 08:00 and 12:00 MLT) and at a minimum at mid-latitudes and within the polar cap (<150 m/s).However, they also observed that high spectral widths are a feature of the whole auroral oval (∼200 m/s).Lowfrequency wave activity similar to that seen in the cusp, but of a lower amplitude, is also observed throughout the whole auroral oval.However, it is not clear how the latitudinal spectral width variation correlates with the PCB location away from the cusp, since for most of the auroral oval, the auroral Pc1/2 wave activity maximises equatorward of the PCB.Hence, there is a question as to how much of the polar cap boundary away from the cusp region can be identified using spectral width characteristics.
The MLT variation of the boundary characteristics and their relationship with the latitudinal spectral width variation is presently under investigation.It is important to identify how much of the auroral oval this method is applicable for, and if other spectral width variations can be used to identify the polar cap boundary in regions away from the cusp.The work of André et al. (2000b) showed that in the cusp the latitudinal transition from the low sub-cusp spectral width values to the higher cusp values is quite sharp.However, they also showed that away from the cusp the latitudinal gradient in spectral width is much shallower.This would explain the increasing above-boundary distribution peak with increasing spectral width threshold which is evident in Fig. 15.If this data set represents a mixture of cusp and other dayside spectral width measurements, then a gradual latitudinal variation in spectral width in part of the data set would result in the boundaries for higher thresholds being placed at higher latitudes.This would explain the changing above-boundary spectral width distributions.This effect becomes more pronounced if the analysis is repeated for the whole dayside ionosphere (not shown).This hypothesis is presently under study.
In summary, we suggest that the best technique for accurately identifying the SWB in SuperDARN meridional beams is the following: (1) median filter the spectral width data spatially across three adjacent beams and temporally across 5 consecutive scans; (2) apply a threshold algorithm with the additional rule that the median of spectral width values in the three range gates above the suspected boundary must also be above the threshold for the boundary location to be confirmed.We suggest that a threshold value between 150 and 200 m/s is most effective, depending on the data set.

Fig. 1 .
Fig. 1.The percentage occurrence of the location of the first range gate above the spectral width boundary as determined theoretically for algorithm 1.The results are presented for the 4 different spectral width thresholds used in the analysis (150, 200, 250, and 300 m/s).

Fig. 2 .
Fig. 2. The variation of the percentage of identified boundaries and the rms boundary error with changing spectral width threshold, as determined theoretically for algorithm 1.

Fig. 3 .
Fig. 3.The distribution of spectral width values below and above the spectral width boundary as determined theoretically for algorithm 1.The four different lines represent the results from using four different spectral width threshold values (150, 200, 250, and 300 m/s) to identify the boundary.

Fig. 4 .
Fig. 4. The percentage occurrence of the location of the first range gate above the spectral width boundary within the simulated data set, as estimated by algorithm 2. The results are presented for the 4 different spectral width thresholds used in the analysis (150, 200, 250, and 300 m/s).

Fig. 5 .
Fig. 5.The variation of the percentage of identified boundaries and the rms boundary error with changing spectral width threshold, as estimated by the application of algorithm 2 to the simulated data set.

Fig. 6 .
Fig. 6.The distribution of spectral width values below and above the spectral width boundary as determined by applying algorithm 2 to the simulated data set.The four different lines represent the results from using four different spectral width threshold values (150, 200, 250, and 300 m/s) to identify the boundary.

Fig. 7 .
Fig. 7.A comparison of the actual spectral width distributions employed in the simulations (black lines) and the effective distributions that result after spatially and temporally median filtering the data as in algorithm 3 (yellow lines).

Fig. 8 .
Fig. 8.The percentage occurrence of the location of the first range gate above the spectral width boundary within the spatially and temporally median filtered, simulated data set, as estimated by algorithm 3. The results are presented for the 4 different spectral width thresholds used in the analysis (150, 200, 250, and 300 m/s).

Fig. 9 .
Fig. 9.The variation of the percentage of identified boundaries and the rms boundary error with changing spectral width threshold, as estimated by the application of algorithm 3 to the simulated data set.

Fig. 10 .
Fig. 10.The distribution of spectral width values below and above the spectral width boundary as determined by applying algorithm 3 to the simulated data set.The four different lines represent the results from using four different spectral width threshold values (150, 200, 250, and 300 m/s) to identify the boundary.

Fig. 11 .
Fig.11.The variation of the percentage of correct boundaries identified by algorithm 2 (solid orange line) and algorithm 3 (solid black line), with a threshold of 150 m/s, when applied to a simulated data set with a variable sinusoidal boundary.The variations are presented for a range of boundary wavelengths and for sinusoidal amplitudes of (a) 2, (b) 3, and (c) 4 range gates.The black dashed line presents the value measured by algorithm 3 when no boundary variation is present (as in Fig.8).

Fig. 12 .
Fig.12.The variation in the rms boundary error measured by algorithm 2 (solid orange line) and algorithm 3 (solid black line), with a threshold of 150 m/s, when applied to a simulated data set with a variable sinusoidal boundary.The variations are presented for a range of boundary wavelengths and for sinusoidal amplitudes of (a) 2, (b) 3, and (c) 4 range gates.The black dashed line presents the value measured by algorithm 3 when no boundary variation is present (as in Fig.9).

Fig. 13 .
Fig.13.An example of the determination of the spectral width boundary using both algorithm 2 (black solid line) and algorithm 3 (red solid line).The spectral width data is taken from beam 8 of the Halley SuperDARN radar on 20 August 1998.

Fig. 14 .
Fig. 14.The distribution of spectral width values below and above the spectral width boundary as determined by applying algorithm 2 to one year of data (from 1998) from beam 8 of the Halley Su-perDARN radar.Only cusp-region spectral widths (from 08:00-12:00 MLT), from within 10 range gates of the estimated boundary position, are shown.The four different lines represent the results from using four different spectral width threshold values (150, 200, 250, and 300 m/s) to identify the boundary.

Fig. 15 .
Fig. 15.The distribution of spectral width values below and above the spectral width boundary as determined by applying algorithm 3 to one year of data (from 1998) from beam 8 of the Halley Su-perDARN radar.Only cusp-region spectral widths (from 08:00-12:00 MLT), from within 10 range gates of the estimated boundary position, are shown.The four different lines represent the results from using four different spectral width threshold values (150, 200, 250, and 300 m/s) to identify the boundary.