Datchthana's picture
Add Thailand earthquake dataset (earthquake_events, earthquake_reports_raw)
82152b8 verified
|
Raw
History Blame Contribute Delete
4.99 kB
---
license: cc-by-4.0
language:
- th
- en
tags:
- earthquake
- seismology
- thailand
- geospatial
pretty_name: Thailand Earthquake Dataset
size_categories:
- 1K<n<10K
configs:
- config_name: earthquake_events
data_files:
- split: train
path: earthquake_events.csv
- config_name: earthquake_reports_raw
data_files:
- split: train
path: earthquake_reports_raw.csv
---
# Thailand Earthquake Dataset
Seismic event data from the [Thai Meteorological Department (TMD)](https://data.tmd.go.th/)
`DailySeismicEvent` API, collected by an Airflow pipeline (the earthquake side
of the same `Air_Pipeline_2` project as
[Datchthana/WeatherDatasetThailand](https://huggingface.co/datasets/Datchthana/WeatherDatasetThailand))
that polls roughly hourly.
This is a separate repo from the weather dataset on purpose — it only covers
earthquakes, no air-quality/weather data.
## Files
| File | Rows (as of 2026-08-08) | Description |
|---|---|---|
| `earthquake_events.csv` | 923 | Cleaned, deduplicated event list — one row per unique quake, deduped on `(datetime_utc, lat, lon)`. **Recommended table for most uses.** |
| `earthquake_reports_raw.csv` | 525 | Full raw archive: one row per API poll, each containing the complete JSON `payload` TMD returned at that moment (`DailyEarthquakes` list + response header). Kept for audit/reproducibility. |
`earthquake_reports_raw.csv` is much bigger (~180 MB vs ~0.2 MB) than its row
count suggests: TMD's API returns a rolling window of recent events on every
call, so consecutive polls re-embed mostly the same events verbatim inside
the JSON payload. `earthquake_events.csv` is the deduplicated result of
parsing all of those payloads over time — use that unless you specifically
need the raw API responses.
## Schema — `earthquake_events.csv`
- `datetime_utc` / `datetime_thai` — event time in UTC and Thailand local time
- `magnitude` — Richter magnitude
- `depth_km` — focal depth in km
- `lat` / `lon` — epicenter coordinates
- `title_th` — original Thai-language title string from TMD
- `tambon_th` / `amphoe_th` / `province_th` — Thai administrative location
parsed out of `title_th` (null when the quake is outside Thailand)
- `location_en` — English location name
- `is_domestic``true` if the event was located within a Thai province
- `created_at` — when the row was first written to the database
## Schema — `earthquake_reports_raw.csv`
- `fetched_at` — when this API poll happened
- `payload` — the full TMD API JSON response as a string (header + list of
events as returned, before parsing/cleaning)
## ⚠️ Known data gaps
Same pipeline host as the weather dataset, same downtime pattern — mostly
Windows Update restarts. Checked against `fetched_at` in
`earthquake_reports_raw.csv` (2026-07-11 to 2026-08-08, ~28 days): 14 gaps
longer than 1.5h, totaling roughly **6 days** of missed polls. The largest
gaps line up almost exactly with the ones documented in
[WeatherDatasetThailand](https://huggingface.co/datasets/Datchthana/WeatherDatasetThailand)
(same host, same outage):
| Gap start | Gap end | Duration | Likely cause |
|---|---|---|---|
| 2026-07-15 23:00 | 2026-07-19 11:13 | ~3d 12h | Windows Update restart — pipeline wasn't manually restarted afterward |
| 2026-07-27 10:00 | 2026-07-29 14:00 | ~2d 4h | Windows Update restart |
| 2026-08-06 00:00 | 2026-08-06 04:24 | ~4.5h | Windows Update restart |
| 2026-08-06 14:01 | 2026-08-06 18:00 | ~4h | Windows Update restart |
Plus several smaller ~2h gaps (single missed hourly poll) scattered through
late July/early August, also mostly Windows Update restarts.
Unlike the weather pipeline, a short gap here usually **doesn't** lose data —
TMD's rolling-window report tends to still contain an event on the next
successful poll. But the 3.5-day gap is long enough that any event whose
window had already rolled off the API response by the time the pipeline
came back up is permanently missing from this dataset.
## Source & license
Data is sourced from the public TMD `DailySeismicEvent` API. TMD's own data
catalog ([catalog.tmd.go.th](https://catalog.tmd.go.th/)) lists an "Open Data
Common" license on its datasets, which is why this repo defaults to
**CC BY 4.0** (attribution) rather than a software license like Apache 2.0 —
but I could not pull TMD's exact terms text to confirm the precise clauses,
so verify against their published terms before relying on this for anything
commercial.
One more caveat worth knowing: the ingestion code calls the API with the
literal demo credentials (`uid=demo`, `ukey=demokey`) that ship in TMD's own
docs, not a registered production key. It has worked so far, but there's no
confirmation these credentials are meant for sustained/redistributed use —
treat the ongoing availability of this data source as unverified.
## Update cadence
The upstream pipeline polls roughly hourly; this snapshot reflects a manual
export and is not kept in continuous sync.