Skip to content
Back to skills

Docs

ASecurity

Derive the HEC-HMS loss-method parameters used by this KI from HWSD soil texture and AVHRR land cover. The implemented stage is `tools/convert_soil_to_hms.py`, which maps HWSD texture classes to hydrologic soil groups, combines those groups with AVHRR land-cover classes, and writes basin-average SCS Curve Number and Green-Ampt reference parameters.

  • 200 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 11, 2026
toolspythonbash

Works with

  • cli

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lzwei196-docs-28eabcdd/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-28eabcdd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# S2-S3: Soil Parameters and Land Cover Skill

## Purpose

Derive the HEC-HMS loss-method parameters used by this KI from HWSD soil texture
and AVHRR land cover. The implemented stage is `tools/convert_soil_to_hms.py`,
which maps HWSD texture classes to hydrologic soil groups, combines those groups
with AVHRR land-cover classes, and writes basin-average SCS Curve Number and
Green-Ampt reference parameters.

## Inputs

| Input | Format | Required by |
|-------|--------|-------------|
| HWSD soil raster | GeoTIFF/IMG raster | `--soil_file` |
| AVHRR land-cover raster | GeoTIFF raster | `--landcover_file` |
| Basin shapefile | `.shp`, readable by geopandas | `--basin_shp` |

## Outputs

| Output | Format | Produced by |
|--------|--------|-------------|
| Soil parameter file | JSON | `--output_file` |
| `curve_number` | dimensionless | `tools/convert_soil_to_hms.py` |
| `soil_groups` | A/B/C/D fractions | `tools/convert_soil_to_hms.py` |
| `green_ampt` | suction, Ksat, porosity, deficit | `tools/convert_soil_to_hms.py` |

## Procedure

1. Run the KI preflight first so missing raster/geospatial dependencies are caught
   before parameter generation:

   ```bash
   cd KISSPATH_KI_ROOT/HEC_HMS/knowledge_infrastructure
   python3 preflight_check.py
   ```

2. Convert HWSD and AVHRR into the JSON consumed by `tools/run_hec_hms.py`:

   ```bash
   python3 tools/convert_soil_to_hms.py \
     --soil_file KISSPATH_STATIC/HWSD_China_Geo.img \
     --landcover_file KISSPATH_DATA/landcover/AVHRR_1km_LANDCOVER_1981_1994.GLOBAL.tif \
     --basin_shp KISSPATH_DATA/shp/bengbu_shp/bengbu_clip.shp \
     --output_file ./params/soil_params.json
   ```

3. Preserve the JSON as the stage handoff to model execution. `tools/run_hec_hms.py`
   reads its `curve_number` field when passed through `--soil_params`.

## Verification

- Confirm the command exits successfully and prints a basin-average CN.
- Inspect `./params/soil_params.json` and verify `curve_number` is in the
  valid SCS-CN range used by `run_hec_hms.py`.
- Confirm `soil_groups` contains A/B/C/D fractions that sum to approximately 1.0.
- Confirm `green_ampt.ksat_cm_hr` is positive and `green_ampt.porosity` is between
  0 and 1.

## Traps

- **dt_103**: A failed HWSD overlap or bad soil lookup can produce CN below 30,
  NaN, or zero. The remedy is to verify basin/raster overlap and CRS before using
  the generated JSON.
- **dt_111**: Green-Ampt suction or conductivity outside the lookup-table ranges
  indicates the soil class mapping or raster values are wrong.
- **dt_104**: The generated JSON reports initial abstraction notes, but the actual
  Ia ratio is selected during execution or calibration; using 0.20 in humid basins
  can understate runoff volume.

## Example

```bash
cd KISSPATH_KI_ROOT/HEC_HMS/knowledge_infrastructure
mkdir -p params
python3 tools/convert_soil_to_hms.py \
  --soil_file KISSPATH_STATIC/HWSD_China_Geo.img \
  --landcover_file KISSPATH_DATA/landcover/AVHRR_1km_LANDCOVER_1981_1994.GLOBAL.tif \
  --basin_shp KISSPATH_DATA/shp/bengbu_shp/bengbu_clip.shp \
  --output_file ./params/soil_params.json
```

Files in this skill

  • format_spec.yaml22.3 KB
  • papers.json6 KB
  • s0_configuration_skill.md3.1 KB
  • s1_domain_setup_skill.md2.9 KB
  • s2_soil_parameters_skill.md3 KB
  • s4_forcing_conversion_skill.md3.1 KB
  • s5_model_execution_skill.md3.9 KB
  • s6_output_analysis_skill.md3.2 KB
  • s7_calibration_skill.md3.3 KB
  • validation_convention.yaml10.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…