Skip to content
Back to skills

Spectral Features

ASecurity

Per-parcel Sentinel-1/2 feature matrix from Earth Engine: 15-day composites, band and index set, chunked reduceRegions, batch parquet, resume.

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 19, 2026
ai-agents

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add Adilmunawar/ZD-claude-plugin --skill spectral-features --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spectral Features?

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

Security grade badge for Spectral Features
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adilmunawar-spectral-features/badge)](https://www.skillsdirectory.com/skills/adilmunawar-spectral-features)

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
---
name: spectral-features
paths: ["**/Xgboost/**", "**/GEE_fetch*.py", "**/*feature*.py"]
description: Per-parcel Sentinel-1/2 feature matrix from Earth Engine: 15-day composites, band and index set, chunked reduceRegions, batch parquet, resume.
---

# Per-parcel feature matrix (Earth Engine)

Constants: `PERIOD_DAYS=15`, `TARGET_YEAR`, `HISTORY_YEARS_BACK=1`, `CHUNK_SIZE=400` parcels per request, `MAX_WORKERS=12–16`, `SCALE=10`, `TILE_SCALE=8`, `CLOUD_PCT_MAX=80`.

Bands: optical `B2 B3 B4 B5 B6 B7 B8 B8A B11 B12`; radar `VV VH` (dB). Indices: `NDVI LSWI EVI SAVI IRECI REIP NDBI BSI NDWI MNDWI`.

1. **Inputs.** Parcels zip/GPKG → GeoDataFrame in EPSG:4326 with a stable `parcel_uid`. Simplify to ≤ 5 m before upload to keep request payloads small (see `zd-gee:gee-export`).
2. **Periods.** Split `[TARGET_YEAR − HISTORY_YEARS_BACK, TARGET_YEAR]` into `PERIOD_DAYS` windows. For each: S2 SR harmonized, cloud-masked (SCL + probability), median; S1 GRD IW VV/VH mean in dB. Name bands `<band>_<periodIndex>`.
3. **Extraction.** For each chunk of `CHUNK_SIZE` parcels: `ee.FeatureCollection` from the chunk → `image.reduceRegions(mean, scale=SCALE, tileScale=TILE_SCALE)` → `getInfo` (small) or `Export.table.toDrive` (large). Threads = `MAX_WORKERS`. Write `batches/batch_<i>.parquet`; skip existing batches on resume.
4. **Assemble.** Concatenate batches → `feature_matrix.parquet`; validate: one row per `parcel_uid`, expected column count = (bands + indices) × periods (+ radar), null share per column < 30 % or flag the period as cloudy.
5. **Anomalies.** Fit `IsolationForest(contamination≈0.02)` on the matrix; drop or flag outliers before training/inference (`landuse-classify`).

Failure modes: payload too large (simplify or upload as asset), `Too many concurrent aggregations` (lower `MAX_WORKERS`), empty periods in monsoon (allow historical fallback or mark null), mixed CRS in inputs (reject).

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…