Claude-skill-registry dem-pipeline
Run DEM lineament analysis to identify unmapped fault structures. Use when visually confirming orphan earthquake clusters, mapping fault extensions, or finding dark earthquake sources. Triggers on "DEM analysis", "lineament", "edge detection", "drainage analysis".
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/dem-pipeline" ~/.claude/skills/majiayu000-claude-skill-registry-dem-pipeline && rm -rf "$T"
manifest:
skills/data/dem-pipeline/SKILL.mdsource content
/dem-pipeline - DEM Lineament Analysis Skill
Purpose
Run Digital Elevation Model (DEM) analysis pipeline to identify unmapped fault structures through edge detection, drainage pattern analysis, and topographic lineament extraction. Validated in Italy where DEM revealed 25+ km unmapped fault.
Usage
/dem-pipeline <region> [--dem-path PATH] [--output-dir DIR] [--overlay GEOJSON]
Examples:
/dem-pipeline italy --dem-path dem_tiles/tinitaly_basura.tif /dem-pipeline san-diego --overlay data/fault_databases/scec_cfm_sandiego.geojson /dem-pipeline turkey --dem-path dem_tiles/sofular_srtm.tif
Prerequisites
Required Data
| Data Type | Source | Format |
|---|---|---|
| DEM tiles | TINITALY, SRTM, USGS 3DEP | GeoTIFF |
| Fault database | DISS, SCEC CFM, GEM | GeoJSON |
| Microseismicity | INGV, USGS, AFAD | CSV |
| Cave location | SISAL | Coordinates |
Python Dependencies
numpy, scipy, matplotlib, rasterio, geopandas, scikit-image (edge detection), pysheds (drainage)
Pipeline Steps
Step 1: Load and Preprocess DEM
# Load DEM dem = rasterio.open(dem_path) elevation = dem.read(1) # Resample if needed (target: 10-30m resolution) if resolution > 30: elevation = resample_dem(elevation, target_res=30) # Fill voids/nodata elevation = fill_voids(elevation)
Step 2: Generate Hillshade
# Calculate hillshade for visualization hillshade = calculate_hillshade( elevation, azimuth=315, # NW illumination altitude=45 ) # Save as GeoTIFF save_geotiff(hillshade, 'hillshade.tif')
Step 3: Edge Detection
Apply multiple edge detection algorithms:
# Sobel edge detection (gradient-based) sobel_edges = sobel(elevation) # Canny edge detection (multi-scale) canny_edges = canny(elevation, sigma=2) # Save results save_geotiff(sobel_edges, 'edge_sobel.tif') save_geotiff(canny_edges, 'edge_canny.tif')
Look for:
- Linear features at consistent azimuths
- Edges that align with orphan earthquake clusters
- Topographic breaks/scarps
Step 4: Drainage Network Analysis
# Calculate flow direction flow_dir = calculate_flow_direction(elevation) # Calculate flow accumulation flow_acc = calculate_flow_accumulation(flow_dir) # Extract drainage network (threshold: 1000 cells) drainage = extract_drainage(flow_acc, threshold=1000) # Save results save_geotiff(drainage, 'drainage.tif')
Look for:
- Drainage anomalies (right-angle bends, beheaded streams)
- Linear valley alignments
- Offset drainage patterns (strike-slip indicators)
Step 5: Lineament Extraction
# Automated lineament extraction lineaments = extract_lineaments( sobel_edges, min_length=5000, # 5 km minimum max_gap=500 # 500m max gap ) # Calculate azimuths for lineament in lineaments: lineament.azimuth = calculate_azimuth(lineament) lineament.length = calculate_length(lineament) # Group by azimuth azimuth_groups = group_by_azimuth(lineaments, bin_size=15)
Step 6: Overlay Analysis
# Load fault database faults = gpd.read_file(fault_geojson) # Load microseismicity earthquakes = pd.read_csv(eq_csv) orphans = earthquakes[earthquakes['is_orphan'] == True] # Create overlay figure fig, ax = plt.subplots(figsize=(12, 10)) ax.imshow(hillshade, cmap='gray') faults.plot(ax=ax, color='red', linewidth=2, label='Mapped faults') ax.scatter(orphans.lon, orphans.lat, c='yellow', s=10, label='Orphan EQs') lineaments.plot(ax=ax, color='cyan', linewidth=1, label='DEM lineaments') plt.savefig('overlay_analysis.png', dpi=300)
Output Products
1. GeoTIFF Rasters
| File | Description |
|---|---|
| Hillshade visualization |
| Sobel edge detection |
| Canny edge detection |
| Drainage network |
| Slope map (optional) |
| Aspect map (optional) |
2. Publication Figures (300 DPI PNG)
| Figure | Content |
|---|---|
| Hillshade base map |
| Edge detection results |
| Drainage network |
| Full overlay (faults + EQs + lineaments) |
| Rose diagram of lineament azimuths |
3. Analysis Report
## DEM Lineament Analysis: [Region] **DEM source**: [TINITALY/SRTM/etc.] **Resolution**: [X] m **Analysis date**: [date] --- ### Lineament Statistics | Azimuth Bin | Count | Total Length | Avg Length | |-------------|-------|--------------|------------| | N-S (0-15°) | [N] | [X] km | [X] km | | NNE (15-30°) | [N] | [X] km | [X] km | | ... | ... | ... | ... | ### Dominant Lineament Sets 1. **[Azimuth]° trend**: [N] lineaments, [X] km total - Correlation with: [orphan cluster / mapped fault / etc.] 2. **[Azimuth]° trend**: ... --- ### Comparison with Mapped Faults | Mapped Fault | Strike | DEM Lineament Match? | |--------------|--------|---------------------| | [fault name] | [X]° | [YES/NO] | ### Unmapped Structures Identified | Structure | Azimuth | Length | Evidence | |-----------|---------|--------|----------| | NNW lineament | 340° | 25+ km | Edge + drainage + 85 orphan EQs | --- ### Interpretation [2-3 paragraphs on geological interpretation] --- ### Files Created | File | Path | |------|------| | Hillshade | `dem_tiles/[region]/hillshade.tif` | | Edge detection | `dem_tiles/[region]/edge_sobel.tif` | | Overlay figure | `dem_tiles/[region]/fig_overlay.png` |
Example: Italy Bàsura Results
DEM Lineament Analysis: Ligurian Alps (Italy) DEM: TINITALY 10m Area: 50 km radius around Bàsura Cave Key Finding: NNW-SSE Lineament Set - Azimuth: 335-345° (NNW) - Length: 25+ km - Evidence: - Strong edge detection signal - Anomalous drainage (right-angle bends) - 85 orphan earthquakes aligned - NOT in DISS, ITHACA, or EFSM20 Interpretation: Previously unmapped fault structure, primary candidate for 1285/1394 dark earthquakes. Strike consistent with regional stress field. Recommend InSAR/GPS validation.
Integration with Other Skills
| Skill | Integration |
|---|---|
| Use orphan clusters to guide DEM interpretation |
| DEM findings inform "unmapped fault" classification |
| Document findings in |
Scripts Reference
Existing scripts in
paleoseismic_caves/scripts/:
| Script | Purpose |
|---|---|
| Italy Bàsura analysis |
| Rose Canyon analysis |
| Full SD pipeline |
| Multi-layer visualization |
Important Notes
- Resolution matters - 10-30m optimal for fault detection
- Multiple methods - Sobel + Canny + drainage gives confidence
- Ground truth needed - DEM alone is not proof
- Orphan correlation key - Lineaments matching orphan clusters are strongest evidence
- Publication quality - 300 DPI, proper color scales, scale bars
Regional DEM Sources
| Region | Source | Resolution | Coverage |
|---|---|---|---|
| Italy | TINITALY | 10m | Complete |
| California | USGS 3DEP | 1-10m | Complete |
| Turkey | SRTM | 30m | Complete |
| Belize | SRTM | 30m | Limited |
| Brazil | SRTM | 30m | Complete |