# siddheshpohare/landslide-risk-mapping-himachal-pradesh architecture

> Architecture diagram of the GitHub repository siddheshpohare/landslide-risk-mapping-himachal-pradesh, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh
- Repository: https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh

## Overview

This repository supports a Himachal Pradesh landslide-risk research workflow: acquire pre/post-event satellite imagery and point-level features, prepare inventory and training data, build susceptibility products, validate and refine them, and present results. It also documents both Earth Engine and local-download routes. The graph preserves the separate ML and AHP analysis branches. Some connections are documented in the README or visible excerpts; unsampled modules are represented only where their role is supported by the tree or documentation.

Main entry points: [`download_landslide_images.py`](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/download_landslide_images.py) (Local image download), [`run_ml_pipeline_v3.py`](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/run_ml_pipeline_v3.py) (ML training pipeline), [`gee_extract_features_ml.js`](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gee_extract_features_ml.js) (Point feature extraction), [`gee_landslide_hp.js`](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gee_landslide_hp.js) (Image collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Data acquisition"]
  node_image_export["Image collection"]
  node_image_download["Local image download"]
  node_feature_extraction["Point feature extraction"]
end

subgraph group_preparation["Data preparation"]
  node_inventory_conversion["Inventory conversion"]
  node_report_conversion["Report conversion"]
  node_gee_inputs["Earth Engine inputs"]
end

subgraph group_risk["Risk mapping"]
  node_training["ML training pipeline"]
  node_ml_plots["ML evaluation plots"]
  node_ahp["AHP susceptibility"]
  node_mosaic["Susceptibility mosaic"]
end

subgraph group_validation["Validation and refinement"]
  node_validation["Raster validation"]
  node_mask_helpers["Mask-fix functions"]
  node_mask_fixes["Mask refinement"]
  node_mask_script["Mask-fix utility<br/>[gen_mask_fixes.py]"]
end

subgraph group_communication["Reporting"]
  node_presentation["Midterm presentation"]
end

node_researcher(("Researcher"))
node_gee{{"Google Earth Engine"}}
node_sentinel[("Sentinel-2 data")]

node_researcher -->|"runs export"| node_image_export
node_image_export -->|"requests imagery"| node_gee
node_gee -->|"queries collection"| node_sentinel
node_image_export -.->|"alternative route"| node_image_download
node_researcher -->|"runs download"| node_image_download
node_image_download -->|"downloads composites"| node_gee
node_image_download -->|"queries collection"| node_sentinel
node_feature_extraction -->|"samples features"| node_gee
node_feature_extraction -->|"samples imagery"| node_sentinel
node_researcher -.->|"runs conversion"| node_inventory_conversion
node_researcher -.->|"runs conversion"| node_report_conversion
node_researcher -.->|"prepares inputs"| node_gee_inputs
node_feature_extraction -.->|"exports features"| node_training
node_training -.->|"evaluates models"| node_ml_plots
node_training -.->|"plots comparisons"| node_ml_plots
node_researcher -.->|"runs analysis"| node_training
node_researcher -.->|"runs weighting"| node_ahp
node_ahp -.->|"creates input rasters"| node_mosaic
node_researcher -.->|"builds map"| node_mosaic
node_mosaic -.->|"supplies susceptibility"| node_validation
node_researcher -.->|"runs assessment"| node_validation
node_validation -->|"writes metrics"| node_mask_fixes
node_mask_fixes -.->|"uses functions"| node_mask_helpers
node_researcher -.->|"runs utility"| node_mask_script
node_researcher -.->|"generates slides"| node_presentation

click node_image_export "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gee_landslide_hp.js"
click node_image_download "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/download_landslide_images.py"
click node_feature_extraction "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gee_extract_features_ml.js"
click node_inventory_conversion "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/convert_landslide_inventory.py"
click node_report_conversion "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/convert_landslide_report.py"
click node_gee_inputs "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/prepare_gee_inputs.py"
click node_training "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/run_ml_pipeline_v3.py"
click node_ml_plots "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/generate_plots_v3.py"
click node_ahp "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/ahp_susceptibility.py"
click node_mosaic "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase2_susceptibility_map.py"
click node_validation "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase3_validation.py"
click node_mask_helpers "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase3_fix_funcs.py"
click node_mask_fixes "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase3_mask_fixes.py"
click node_mask_script "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gen_mask_fixes.py"
click node_presentation "https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/create_midterm_pptx.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_image_export,node_image_download,node_feature_extraction toneBlue
class node_inventory_conversion,node_report_conversion,node_gee_inputs,node_sentinel toneAmber
class node_training,node_ml_plots,node_ahp,node_mosaic toneMint
class node_validation,node_mask_helpers,node_mask_fixes,node_mask_script toneRose
class node_presentation,node_researcher,node_gee toneIndigo
```

## Components

### Data acquisition

- [Image collection](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gee_landslide_hp.js): `gee_landslide_hp.js`
- [Local image download](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/download_landslide_images.py): `download_landslide_images.py`
- [Point feature extraction](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gee_extract_features_ml.js): `gee_extract_features_ml.js`

### Data preparation

- [Inventory conversion](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/convert_landslide_inventory.py): `convert_landslide_inventory.py`
- [Report conversion](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/convert_landslide_report.py): `convert_landslide_report.py`
- [Earth Engine inputs](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/prepare_gee_inputs.py): `prepare_gee_inputs.py`

### Risk mapping

- [ML training pipeline](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/run_ml_pipeline_v3.py): `run_ml_pipeline_v3.py`
- [ML evaluation plots](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/generate_plots_v3.py): `generate_plots_v3.py`
- [AHP susceptibility](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/ahp_susceptibility.py): `ahp_susceptibility.py`
- [Susceptibility mosaic](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase2_susceptibility_map.py): `phase2_susceptibility_map.py`

### Validation and refinement

- [Raster validation](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase3_validation.py): `phase3_validation.py`
- [Mask-fix functions](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase3_fix_funcs.py): `phase3_fix_funcs.py`
- [Mask refinement](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/phase3_mask_fixes.py): `phase3_mask_fixes.py`
- [Mask-fix utility](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/gen_mask_fixes.py): `gen_mask_fixes.py`

### Reporting

- [Midterm presentation](https://github.com/siddheshpohare/landslide-risk-mapping-himachal-pradesh/blob/main/create_midterm_pptx.py): `create_midterm_pptx.py`

### Other components

- **Researcher**
- **Google Earth Engine**
- **Sentinel-2 data**

## Connections

- Researcher → Image collection: runs export (evidence: `README.md`)
- Image collection → Google Earth Engine: requests imagery (evidence: `gee_landslide_hp.js`)
- Google Earth Engine → Sentinel-2 data: queries collection
- Image collection → Local image download: alternative route (evidence: `README.md`)
- Researcher → Local image download: runs download (evidence: `README.md`)
- Local image download → Google Earth Engine: downloads composites (evidence: `download_landslide_images.py`)
- Local image download → Sentinel-2 data: queries collection (evidence: `download_landslide_images.py`)
- Point feature extraction → Google Earth Engine: samples features (evidence: `gee_extract_features_ml.js`)
- Point feature extraction → Sentinel-2 data: samples imagery (evidence: `gee_extract_features_ml.js`)
- Researcher → Inventory conversion: runs conversion
- Researcher → Report conversion: runs conversion
- Researcher → Earth Engine inputs: prepares inputs
- Point feature extraction → ML training pipeline: exports features
- ML training pipeline → ML evaluation plots: evaluates models
- ML training pipeline → ML evaluation plots: plots comparisons
- Researcher → ML training pipeline: runs analysis
- Researcher → AHP susceptibility: runs weighting
- AHP susceptibility → Susceptibility mosaic: creates input rasters
- Researcher → Susceptibility mosaic: builds map
- Susceptibility mosaic → Raster validation: supplies susceptibility
- Researcher → Raster validation: runs assessment
- Raster validation → Mask refinement: writes metrics (evidence: `phase3_mask_fixes.py`)
- Mask refinement → Mask-fix functions: uses functions
- Researcher → Mask-fix utility: runs utility
- Researcher → Midterm presentation: generates slides
