We explore the use of real-time high-rate GPS displacement data for earthquake early warning using 1 Hz displacement waveforms from the April 4, 2010, Mw 7.2 El Mayor-Cucapah earthquake. We compare these data to those provided by the broadband velocity and accelerometer instrumentation of the Southern California Seismic Network. The unique information provided by the GPS-based displacement timeseries is the permanent/static displacement. Using a simple algorithm that can be applied in real-time, we extract the static offset shortly after the S-wave arrival, around the time of the observed peak shaking at the same site, and before shaking at more distant locations. These data can be used, as they become available, to provide a robust estimate of the earthquake magnitude, which ranges from 6.8 to 7.0 in this case. We therefore conclude that real-time high-rate GPS can provide a useful and independent assessment of earthquake magnitude for the purpose of earthquake early warning and real-time earthquake information systems in general including tsunami warning systems.
 Earthquake early warning (EEW) is the rapid detection of an earthquake underway, and prediction of the expected ground shaking within seconds so that a warning can be broadcast to those in harm's way. Currently, such systems are implemented in Mexico [Espinosa-Aranda et al., 2011] and Japan [Doi, 2011], and are being tested in other parts of the Americas, Asia and Europe [see Allen et al., 2009a, and references therein]. One of the challenges for EEW development is to ensure that the system functions appropriately for the largest and least frequent earthquakes. Many of the EEW methodologies use just a few seconds of the P-wave to estimate the magnitude of an event, and it remains controversial how accurate this approach is for larger earthquakes [Olson and Allen, 2005; Rydelek and Horiuchi, 2006; Lewis and Ben-Zion, 2008; Brown et al., 2009]. In the March 11, 2011 M9 Tohoku-oki earthquake the JMA warning system issued an alert, but the seismically based magnitude for the warning system peaked at M8.1 [Sagiya et al., 2011]. The now available real-time GPS data streams have the potential to contribute to EEW system for these larger events [e.g., Crowell et al., 2009]. New techniques to rapidly characterize large magnitude events will also benefit all rapid earthquake information systems used by the emergency response and scientific response communities.
 In this paper we present a practical application of a simple method for extraction of real-time constraints on earthquake magnitude. We apply the method to real-time 1Hz GPS total displacement waveforms generated from California Real Time Network (CRTN) data as described by Bock et al.  during the April 4, 2010, Mw 7.2 El Mayor-Cucapah earthquake, which straddled the California-Mexico border. We use these data to compare the GPS and seismic waveforms, explore what constraints the GPS data can provide, determine the timeline when the GPS constraints are available, and illustrate how the GPS could be incorporated into existing seismic EEW methodologies. While the algorithm development and application was obviously done after the fact, it is fully causal and the algorithm/code has been written in such a way that it could be running in real-time. The focus here is on how displacement timeseries could be used for EEW, whereas issues related to the different processing approaches to generate the displacement timeseries are beyond the scope of the present study. We assess the utility of GPS-based real-time earthquakes information in the context of the existing ElarmS EEW methodology that is currently operating in California [Allen and Kanamori, 2003; Allen et al., 2009b; Brown et al., 2011].
 The 1 Hz GPS displacement timeseries come from the California Real Time Network (CRTN), a network of more than 100 science-based continuous GPS stations that have been upgraded to real-time (<1 sec latency) high sample rate (1 sample per second) operations [http://sopac.ucsd.edu/projects/realtime/]. Raw CRTN data are processed by the Scripps Orbit and Permanent Array Center (SOPAC) in real-time using the method of instantaneous positioning [Bock et al., 2000], as further described by Crowell et al.  for the 2003 Mw 8.3 Tokachi-oki earthquake and by Bock et al.  for the El Mayor-Cucapah earthquake. For the El Mayor-Cucapah earthquake on-the-fly 1 Hz relative displacements were computed in 9 sub-networks with overlapping stations (http://geoapp03.ucsd.edu/gridsphere/gridsphere?cid=El+Mayor+Cucapah) and the displacement waveforms were referenced to the most distant CRTN station (GNPS with a north coseismic displacement of −3.7 ± 0.5 mm, east displacement of 1.2 ± 0.4 mm, and vertical displacement of −1.7 +− 0.5 mm. For this study, the displacement waveforms were re-processed in a simulated real-time mode by SOPAC and stored in SAC (http://www.iris.edu/software/sac/) format at the Southern California Earthquake Data Center (SCEDC) where they are openly available to the community for studies such as this one (http://www.data.scec.org/research/MayorCucapah20100404/). The use of a single reference station could be a cause of concern in large earthquakes when the reference station needs to be far enough away to be stationary, but close enough to work as a reference. This is becoming less of a problem as the geographic extents of real-time networks at plate boundaries are expanding, e.g., the GEONET in Japan [Miyazaki et al., 1998] and PBO in the Western U.S. (http://www.unavco.org/community_science/science_highlights/2010/RealTimeGPSWhitePaper2010.pdf). Still, the focus of this study is not the GPS processing technique, instead we focus on how displacement timeseries can be used for early warning, and look to the geodetic community to provide them to us.
 The Mw 7.2 El Mayor-Cucapah earthquake ruptured a series of faults occupying a general NW-SE zone in northern Baja California. The aftershock zone extends 120 km from the south end of the Elsinore fault zone north of the US–Mexico border almost to the northern tip of the Gulf of California [Hauksson et al., 2010] (Figure 1). At the time of the earthquake, there were 30 CRTN stations within 100 km of the fault rupture (Figure 1), and the real-time displacement waveforms are available from the SCEDC (http://www.data.scec.org/research/MayorCucapah20100404/). Despite all the CRTN stations being situated north of the US-Mexico border while most of the earthquake ruptured south of it, this event is the best example in California of a large earthquake for which real-time GPS-based displacement waveforms are available.
3. Comparing GPS and Seismic Waveforms
 Some of the CRTN stations are co-located with seismic stations from the Southern California Seismic Network (SCSN) operated by the USGS and Caltech. The closest CRTN GPS station to the rupture was PBO station P494, which is co-located with SCSN seismic station WES that has both a broadband velocity instrument and an accelerometer. It is important to note that almost all broadband velocity network instruments in California also have an accelerometer in order to record local large magnitude events on scale when the velocity instruments are likely to clip. The seismic and geodetic waveforms from WES and P494 for the El Mayor-Cucapah earthquake are shown in Figure 2 and Figure S1 of Text S1 of the auxiliary material. Indeed, the velocity channels clip, but not until the S-wave arrival some ∼10 sec after the P-wave arrival. The velocity instrument data are, therefore, still useful for EEW methodologies that only use a few seconds of the P-wave.
 The accelerograms do not clip, and velocity and displacement waveforms can be obtained through single and double integrations, respectively. The challenge with such integration is that tilt and rotation of the instrument result in distortions and baseline offsets. These effects are largely removed by applying a relatively low-cut (10s of seconds) high-pass filter at the price of low-frequency information loss, including the loss of permanent station offsets. We apply the real-time recursive relations used by the ElarmS methodology [Brown et al., 2011] to determine the displacement waveforms.
 The displacement waveforms from the WES accelerometer can then be compared directly to those generated from GPS station P494. The horizontal components show a great degree of similarity, with aligned phase and very similar amplitudes of the dynamic component (Figure 2 and auxiliary material). The difference, i.e. the additional information that only the GPS-displacement waveform can provide, is the permanent/static offset, which is best seen on the north component. Note that significant ground displacement begins only after the S-wave arrival. The vertical components differ significantly, and we find GPS-constraints on the vertical component to be unreliable. For more information and waveform comparisons see the auxiliary material.
4. Rapid Extraction of Static Offset Information
 Because the unique information provided by the GPS displacement timeseries is the permanent displacement, we develop a simple algorithm to extract this information in real-time. Inspection of the displacement waveforms (Figure 2) shows that the permanent displacement is visible shortly (5–10 sec) after the arrival of the dynamic oscillations, i.e. the dynamic component is superimposed on the permanent displacement. Therefore, we apply a simple algorithm to remove the dynamic oscillations.
 We start by using a simple short-term average vs. long-term average trigger algorithm [Allen, 1978] to detect the onset of the dynamic component. The short- and long-time windows were 2 and 100 sec respectively; the short-term average was required to be greater than 10 times the long-term average to trigger. Starting at this onset time, we calculate a running average of the displacement values. Once one full oscillation has occurred (about 7 sec in this case) this running average is a useful approximation to the permanent displacement. The algorithm therefore looks for the waveform to cross the trigger amplitude twice, and then starts to “deliver” the values of the running average for use in source magnitude estimation. There is a danger that the waveform will not cross the trigger amplitude twice when there is a large permanent offset and a small dynamic component. To address this possibility the algorithm starts to deliver the running average values after either two trigger-amplitude crossings or 10 sec after the trigger, whichever comes first.
 The result of applying this algorithm is shown in Figure 2. The real-time, every second, estimate of the permanent offset provided by the above algorithm (green line), is compared to the pre- vs. post-trigger average offset calculated from the real-time waveforms. This “pre vs. post” offset is determined by calculating the average displacement value over 100 sec windows that end 50 sec before the trigger and start 200 sec after the trigger. The difference between these pre- and post-trigger averages is then the “pre vs. post” permanent displacement (grey line). The example waveforms show that the real-time estimate of the permanent displacement improves with time, the estimates all approach the pre vs. post with increasing time as would be expected, but also oscillate around the value due to imperfect removal of the dynamic oscillations.
 The horizontal displacement vectors are shown on Figure 1, including the every second real-time estimates (grey arrows) and the “pre vs. post” estimate (red arrows). The post-earthquake estimate of the permanent displacement (green arrows) is also shown at each site. We show the post-earthquake estimate provided by SOPAC (which is nearly identical to the PBO combined solution). There is clearly significant variability in the real-time estimates both in the azimuths, which show ranges of ∼30°, and amplitudes. The real-time amplitude estimates for the larger values at the closer stations are similar to the pre vs. post and post-earthquake estimates, but the real-time estimates at the more distant stations can be over-estimates by more than a factor of two. There is also a systematic ∼20° rotation between the azimuths derived from the real-time GPS data, and the post-earthquake estimates.
 Based on these observations we conclude that the most robust information that can be extracted from the available real-time GPS displacement waveforms is the horizontal amplitude of displacement. We therefore use only this information in our estimation of source magnitude, and disregard both the vertical component and the horizontal azimuth information.
5. Rapid GPS-Based Magnitude Determination
 We determine the earthquake magnitude via an implementation of a static slip inversion scheme. In cases where the rupture plane is known or may be assumed at a high confidence level, such an inversion can be formulated in terms of a standard linear inverse problem. The computation time then becomes practically negligible, and potentially suitable for the purpose of EEW. The construction of a model rupture plane is therefore the first step in our GPS-based earthquake magnitude determination.
 Two pieces of information are vital for the construction of a model rupture plane; a preliminary earthquake hypocenter and a catalog of active faults that includes geographic coordinates, average strike, dip and rake of each fault. The former can be provided by the seismic EEW methodologies that currently deliver an estimate within a few seconds of the first few P-wave triggers, and the latter can be drawn from known fault maps [e.g., Plesch et al., 2007; Working Group on California Earthquake Probabilities, 2007]. The model rupture plane is then chosen to be the one that is closest to the hypocenter. If, however, the hypocenter is located too far from any of the pre-recognized faults, we may still proceed by creating a model plane with strike, dip and rake that are identical to that of the nearest fault, but a location that is centered about the hypocenter. This latter possibility is only sensible to the extent that the faulting style throughout the area in question is uniform. This approach is not perfect, and ruptures do occur on unknown faults with very different geometries. We would therefore need a test to ensure that the solution is a reasonable fit to the data before the GPS-based magnitude is used. In Figure 1 we show SCSN's epicenter of the El Mayor-Cucapah earthquake and the Laguna Salada fault trace. Based on the close proximity between the two, we constructed a model plane by simply fitting a best straight line to the fault surface trace and the epicenter (Figure 1). In the auxiliary material we assess the appropriateness of that plane using the data that are available to us today.
 The model fault plane is vertical with length and width that are equal to 120 and 20 kilometers, respectively. It is discretized into 30 along-strike by 5 down-dip rectangular cells, with each being treated as a uniformly slipping patch embedded within a homogeneous elastic half-space (i.e., an elastic dislocation). The amplitude of the horizontal ground displacement, d, and the right-lateral fault slip, u, are related through:
where G is an elastic kernel equation for dislocations [Harris and Segall, 1987; Okada, 1992]. The above equation is solved for the slip distribution, and slip is constrained to be right-lateral using non-negative least-squares algorithm [Lawson and Hanson, 1974; Harris and Segall, 1987]. Slip distribution is being calculated once the first real-time static displacement becomes available, and is thereafter being recalculated every second. For each solution, the GPS-based seismic moment is obtained by multiplying the shear modulus and the integral of the slip over the fault area. Results presented in this study were obtained with a shear modulus of 30 GPa. The moment magnitude is calculated from the seismic moment using the Hanks and Kanamori  moment-magnitude relation.
 We find that the moment magnitude is extremely robust (see Figure 3), and is close to the true moment magnitude right from the very first data point. The first magnitude estimate is 6.9, and the estimated values each second range between 6.8 and 7.0 for this Mw7.2 earthquake. However, the estimate of the slip distribution is not robust and, while the magnitude estimate remains fairly constant, the slip distribution is quite changeable from second to second.
6. Comparison of GPS and Seismic Methods
 Seismic-based EEW methods in general, and the ElarmS methodology specifically, use a few seconds of the P-wave data to detect an earthquake, locate it, and estimate the magnitude [Brown et al., 2011]. ElarmS provides the first estimate of magnitude one second after the first P-wave arrival. The ElarmS algorithm was run offline on the velocity instruments of the SCSN for the El Mayor-Cucapah earthquake, all of which are surface instruments. No changes were made to the algorithm for this earthquake. As shown in Figure 3, the initial ElarmS magnitude estimate is 5.9 and available 13 sec after the origin time, it oscillates for 5 or 6 sec, before stabilizing at magnitude 6.8. It is important to note that the El Mayor-Cucapah earthquake is not a “huge” earthquake and the limitations of rapid P-wave-based magnitude may be greater for larger earthquakes as demonstrated in the March 2011 M9 Tohoku-oki earthquake [Sagiya et al., 2011].
 In comparison, the GPS information and the geodetic (or GPS-based) magnitude estimate become available at a much later time. The above analysis for the El Mayor-Cucapah earthquake shows that the permanent displacement information is available 5–10 sec after the onset of the large (low frequency) dynamic displacements, which are in turn 10–15 sec after the S-wave arrival. This means that the GPS-based information is available around the same time as the peak-shaking at the same site. This is illustrated in the time-distance plot in Figure 3. In terms of warning times, the ElarmS magnitude estimate stabilizes 16 sec before the first GPS-based magnitude estimate (Figure 3), and so a seismically-based warning would be available ∼16 sec before the GPS-based constraints are available. However, the warning would become more reliable once the GPS-based magnitude estimate is also available.
 The 2010, Mw 7.2 El Mayor-Cucapah earthquake in northern Baja California provides an opportunity to evaluate real-time GPS-based total displacement waveforms for possible use in earthquake early warning (EEW). Comparison of the GPS-based displacement waveforms with those derived from accelerograms show good agreement in phase and amplitude for the horizontal components, but not the vertical component. The unique information that the GPS timeseries provides is the permanent coseismic static displacement that is very difficult to extract from accelerograms, particularly in real-time. This permanent displacement becomes visible in the waveforms around the time of the larger amplitude (low frequency) dynamic oscillations that are 10–15 sec after the S-wave arrival for this earthquake. Using a simple algorithm to remove the dynamic oscillations, an estimate of the permanent displacement is available one oscillation after the onset of the dynamic component. The permanent displacement information is available around the time of the peak shaking at the same site. We find that the most robust information is the amplitude (not azimuth) of the horizontal component only, and use this in a linear inversion for slip on a strike-slip fault plane. The only robust information provided by the slip inversion is the magnitude.
 We conclude that real-time GPS displacement timeseries could provide an important contribution to EEW systems around the world during large magnitude earthquakes. The GPS-based magnitude estimate is robust and independent of existing seismic methods. The most effective use of the GPS data would be to integrate the GPS information with seismically derived information. Seismic networks are very good at detecting earthquakes and locating the epicenters. Seismic waveforms also provide very rapid initial magnitude estimates (1 sec after the P-wave), however, they may saturate in very large earthquakes (M > 7). When the seismic magnitude estimates are large, say larger than 6, the GPS data could be interrogated for any evidence of permanent static offset using an algorithm such as that described above. The likely fault plane is needed for the source inversion. This could be chosen from existing fault maps based on the proximity of the epicenter. Linear slip inversion of the GPS displacements would then provide another, independent magnitude estimate to confirm, or counter, the seismic assessment.
 The GPS displacement waveforms are a product of the National Aeronautics and Space Administration (NASA) AIST project (grant NNX09AI67G) at Scripps, JPL and Caltech, and were obtained from the SCEDC (http://www.data.scec.org/research/MayorCucapah20100404/). Raw GPS data used in computation of the displacement waveforms were provided by the Southern California Integrated GPS Network and its sponsors, the W. M. Keck Foundation, NASA, NSF, USGS, and SCEC; the Plate Boundary Observatory operated by UNAVCO for EarthScope (http://www.earthscope.org) and supported by NSF grant EAR-0323309; and the USGS. This work was partially supported by the USGS and SCEC, and was largely completed while R.A. and A.Z. were on sabbatical at the Institut de Physique du Globe de Paris and École Normale Supérieur in Paris, respectively.
 The Editor thanks Jessica Murray-Moraleda and an anonymous reviewer for their assistance in evaluating this paper.