-
We secretly shifted LD.FOR's clock by −5.50 s. QuakeTrace named LD.FOR, and removing it cut the location error from 6.3 km to 2.5 km.
-
Rerunning the search 9 times, leaving out one station each time. Without FOR, the other 8 stations agree to 0.24 s.
-
Using every station, the best fit lands 6.3 km from the official USGS epicentre. One broken clock moved the quake.
-
QuakeTrace scores 8,100 candidate epicentres on a 2 km grid, then refines to 250 m. Dark teal marks where the stations agree on start time.
-
Try any quake: break any clock on 600+ real quakes, including ones streamed in live!
-
8 years of station timing in Tiger Data, 2.9× compressed and queried in under 300 ms. Break a clock and it finds the month it started.
Inspiration
I've been to Japan a few times. I've been with my family, with a couple of friends on a grad trip, and one of my best friends is actually there right now on an exchange term! A few weeks ago, he was woken up by a minor earthquake. Thankfully, nothing happened, but it made me worry about his safety and my family's, especially due to how little I knew about earthquakes despite how commonly they impacted the places I loved. So, when the theme of Hack Western was announced to be "Discover the Unknown", I decided there was no use just being worried, and to explore what I feared by thinking about what we could actually build to make earthquakes easier to deal with.
Coming into the hackathon, my teammate Austin was also watching YouTube and came across a technique that uses the sound of planes in the background of a video (the Doppler shift in their engine frequency) to work out where the video was filmed. We didn't end up using that technology, but it inspired our idea by flipping it around, where instead of using the audio waves and the airplane's path to find the location, you know where the sensors' location is and you're trying to find the epicentre/source of the shaking.
That's actually how every earthquake gets located! They use seismometers to record when the first wave arrives, and use software to work backwards to where it must have started. Earthquakes begin kilometres underground, and every epicentre on every map is an inference. Digging into how that inference works, we found an assumption almost nobody questions: that every station's clock is right. Stations get their time from GPS, and GPS receivers fail. When one does, nothing looks broken, but the estimated epicentre can move by kilometres! One study of historical seismic data even found 5,131 probable timing-error cases across 451 stations!
When an earthquake hits, emergency response, aftershock forecasts and decisions about which fault moved all start from where the quake was located. We wanted to make sure that answer can be trusted, so we built a tool that finds the clock that's lying.
What it does
At its core, QuakeTrace analyzes seismic arrival data to find wrong station clocks, and measures how much they distort the estimated epicentre. Every station in a seismic network reports when the first wave of an earthquake reached it. If every clock is right, all of those arrival times agree on one location and one start time. If a single clock is off by a few seconds, they no longer agree. A standard locator doesn't flag this: it settles on a compromise location kilometres from the truth, and the bad reading looks normal.
QuakeTrace catches the station that's out of line:
- Locate: First, it tests thousands of candidate epicentres on a grid. For each one, it predicts how long the wave needed to reach every station, works out the start time each station implies, and scores the point by how closely those start times agree. The best-scoring point is the estimated epicentre.
- Leave one out: It then reruns the whole search once without each station. If removing one station makes all the others suddenly agree, that station is the suspect, and the gap between its reading and what the others predict is its estimated clock error.
- Next, it decides: A station is only blamed if removing it improves the fit by a clear margin and no other station comes close. Otherwise, QuakeTrace says it can't tell, rather than guessing.
- Tracking it over time: Finally, across years of quakes, it compares each station's monthly timing against its own recent normal. Two months in a row off by 1.5 seconds or more, in the same direction, flags a clock change and dates when it started. This is the difference between just an odd reading and broken equipment someone should go and fix.
Our website also lets anyone test this for themselves! The main view, Present, puts the judge/tester in control: they secretly pick any station and shift its clock, and QuakeTrace has to work out which one they changed. Right now it uses the real April 2024 M4.8 Tewksbury, New Jersey earthquake and the real arrival times USGS recorded from nine stations.
A 12-step animated walkthrough then shows exactly how the answer is found, with one idea per step:
- the nine stations and when each one recorded the first wave
- one deliberately wrong candidate point, its distance to a station, and the wave's travel time
- what start time each station implies, and how spread out those start times are (the point's score)
- all 8,100 points on a 2 km grid scored at once, then a 250 m refinement around the best area
- the best location still landing 9.3 km from the official USGS epicentre, because one station disagrees with the rest
- nine more searches, each leaving out one station, until the liar stands out
- and the reveal: what the judge changed against what QuakeTrace found
You can also use the Try Any Quake tab to show it isn't a scripted demo! Anyone can pick from about 610 real quakes: every north-east US quake since 2018 with six or more nearby stations, plus 37 worldwide quakes from dense local networks such as Ridgecrest M7.1. Break any station's clock, or let the app break one secretly and guess before the reveal. QuakeTrace compares each result with an all-station fit and a standard outlier-weighted locator, and when it gets one wrong, it says so.
Finally, the Scale It Up tab applies the same check across eight years of station history stored in Tiger Data. Inject a clock shift into any station from any date, and QuakeTrace finds the month it started, queried live. For example: "LD.PAL flagged from May 2024, confirmed Jun 2024, about +4.9 s." This is how a seismic analyst would actually use QuakeTrace: to find which stations' clocks need fixing, and from what date their data can't be trusted.
How we built it
- Locator (Python + NumPy): a grid search that predicts P-wave travel times (6 km/s, 5 km depth) and scores each candidate by how well the stations agree on a start time. Leave-one-out refits share work through running sums, so even a 300-station quake is diagnosed in about a second.
- Tiger Data / TimescaleDB:
- Hypertable: a
pickshypertable of about 1.26 million P-wave picks from 12,000+ quakes, in yearly chunks. - Compression: columnstore compression on chunks older than 180 days, ordered by station, phase and time. Currently 9 of 10 chunks are compressed, about 2.9× smaller.
- Continuous aggregate: a real-time
station_monthlyaggregate of each station's monthly timing residual. When a judge breaks a clock in history, the shift is applied in SQL against the raw hypertable.
- Hypertable: a
- Live data: a GitHub Actions workflow pulls newly published USGS quakes every 15 minutes (north-east M1.0+ and worldwide M4.5+) straight into Tiger Data, with no redeploy needed.
- Data: USGS ComCat QuakeML phase data; EarthScope station metadata and waveforms.
- Frontend: vanilla JavaScript, canvas animations for the walkthrough, and MapLibre GL with free OpenFreeMap, Esri imagery and terrain tiles.
- Hosting: Vercel, with a standard-library Python WSGI server serving both the UI and the JSON API. ## How we used Tiger Data
Tiger Data is what turns QuakeTrace from a one-quake trick into a monitoring tool:
- Scale: relational quake data and high-frequency pick streams live side by side, with about 1.26 million picks and growing every 15 minutes.
- Compression: reordering compressed segments by station, phase and time took compression from almost no savings to about 2.9× smaller. That's what lets years of global picks fit on the free tier.
- Continuous aggregates: monthly station baselines are precomputed, so Scale it up answers "which station broke, and when?" across eight years in a few hundred milliseconds.
- Live SQL experiments: a judge's injected clock shift is applied inside the query, so stored data is never modified.
Challenges we ran into
- Hiding the bad clock is the point: the solver spreads a bad clock's error across every station, so no single residual stands out. That forced us to use leave-one-out refits with explicit thresholds for fit improvement and near-ties, rather than simple outlier detection.
- Compression at first saved nothing: regional networks report few picks per station, so segmenting by station didn't help. We fixed it by ordering by station, phase and time within batches instead!
- Hubert's laptop broke: an hour before the opening ceremony, Hubert's laptop become unusable due to a malfunctioning power unit. This forced us to improvise and use online communication and collaboration from Hubert's home PC setup while Austin remained on campus. Thankfully, we were able to work on and finish the project, but Hubert will need a new laptop after this 😅
Accomplishments that we're proud of
- Real data, real numbers: every arrival time is a real USGS pick, and every number on screen is real solver output, not an illustration.
- An honest benchmark against standard methods across 539 quakes, including where QuakeTrace doesn't win.
- Judges can try to beat it: anyone can break any clock on 600+ real quakes and watch it get caught live, or see it admit a miss.
- A live pipeline that keeps ingesting new earthquakes from around the world while the demo runs.
What we learned
- How much a single wrong clock distorts a location. Five seconds moved the quake about 9 km, and nothing looked broken.
- How hypertables, compression and continuous aggregates fit together for scientific time-series data, and how much compression depends on how the data is ordered.
- Where a simple physical model stops being trustworthy, and the value of saying so on screen.
What's next for QuakeTrace
- Identifying P and S waves ourselves, in real time. Today QuakeTrace uses arrival picks that USGS analysts have already reviewed and labelled as P or S. Those picks can take hours to be published, which is fine for auditing history but too slow for a live response. Next, we want QuakeTrace to read the raw three-component waveforms directly and label the waves itself. P waves arrive steeply from below and push and pull along their path, so they show up mostly on the vertical channel. S waves shake side to side, so they dominate the horizontal channels. Comparing vertical against horizontal motion lets us tell them apart automatically. That would let QuakeTrace check clocks within seconds of a quake instead of hours. It would also add S waves to the location itself: the gap between the P and S arrivals tells you each station's distance from the quake, which makes the epicentre more accurate and makes a lying clock even easier to spot.
- Catching two bad clocks on the same quake. On a single quake, QuakeTrace is designed to find one bad clock. With two, it usually says it can't tell rather than blaming the wrong station. Testing every pair of stations would catch both. With nine stations that's only 36 extra searches. Across years of data, each station is already checked against its own history, so multiple broken clocks get caught separately.
- A global travel-time model, built from the 1.26 million picks already in Tiger Data, so any quake worldwide can be checked.
- Continuous monitoring: run the audit on the live feed and alert station operators when a clock starts drifting.
Built With
- earthscope
- javascript
- maplibre
- numpy
- postgresql
- pyscopg
- python
- tiger-data
- timescaledb
- usgs
- vercel