run2_plate-boundary-analysis
Finding earthquakes within tectonic plates and computing distances to plate boundaries using PB2002 data.
- License 许可
- MIT
- 最近更新
- 2026-10-02
- Stars
- ★ 93
- Forks
- 7
01 前言 Front Matter
- name
- run2_plate-boundary-analysis
- description
- Finding earthquakes within tectonic plates and computing distances to plate boundaries using PB2002 data.
03 SKILL.md 正文
Plate Boundary Analysis with PB2002
Data Files
- PB2002_plates.json: GeoJSON with plate polygons. Key fields:
Code(e.g., "PA"),PlateName(e.g., "Pacific"). - PB2002_boundaries.json: GeoJSON with boundary LineStrings. Key fields:
PlateA,PlateB(two-letter plate codes).
Step-by-Step: Finding Furthest Earthquake from Boundary
1. Load and filter
plates = gpd.read_file("PB2002_plates.json").set_crs("EPSG:4326", allow_override=True)
boundaries = gpd.read_file("PB2002_boundaries.json").set_crs("EPSG:4326", allow_override=True)
earthquakes = gpd.read_file("earthquakes_2024.json").set_crs("EPSG:4326", allow_override=True)
pacific_plate = plates[plates["Code"] == "PA"]
pa_boundaries = boundaries[(boundaries["PlateA"] == "PA") | (boundaries["PlateB"] == "PA")]
2. Spatial join for containment
eq_in_pacific = gpd.sjoin(earthquakes, pacific_plate, predicate="within")
3. Compute distances in projected CRS
from shapely.ops import unary_union
crs = "+proj=aeqd +lat_0=0 +lon_0=-160 +datum=WGS84 +units=m"
pa_boundary_union = unary_union(pa_boundaries.geometry)
pa_boundary_proj = gpd.GeoSeries([pa_boundary_union], crs="EPSG:4326").to_crs(crs).iloc[0]
eq_proj = eq_in_pacific.to_crs(crs)
distances_km = eq_proj.geometry.distance(pa_boundary_proj) / 1000.0
4. Find maximum
max_idx = distances_km.idxmax()
result = eq_in_pacific.loc[max_idx]
USGS Earthquake Time Format
from datetime import datetime, timezone
epoch_ms = result["time"]
iso = datetime.fromtimestamp(epoch_ms / 1000, tz=timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
Expected Result
Hawaii earthquakes are typically furthest from the Pacific plate boundary (~3500+ km), as Hawaii sits in the interior of the Pacific plate.
04 同仓库更多 Skills
object_counter
Count occurrences of an object in the image using computer vision algorithm.
travel-planning-workflow
Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.
bundled-dataset-search-tool
invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.
glm-output
Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final /root/metrics.json.
glm-calibration
Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.
glm-basics
A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.