$npx -y skills add ma-compbio-lab/SkillFoundry --skill rasterio-windowed-raster-preprocessing-starterUse this skill to generate a tiny toy raster with Rasterio, extract a window, downsample it, and summarize the preprocessing result in compact JSON.
| 1 | # Rasterio Windowed Raster Preprocessing Starter |
| 2 | |
| 3 | Use this skill to generate a tiny toy raster with Rasterio, extract a window, downsample it, and summarize the preprocessing result in compact JSON. |
| 4 | |
| 5 | ## What it does |
| 6 | |
| 7 | - Creates a deterministic single-band GeoTIFF with a simple `EPSG:4326` transform. |
| 8 | - Reads a 2x2 window from the raster. |
| 9 | - Produces a 2x2 average-resampled version of the whole raster. |
| 10 | - Emits a compact JSON summary with bounds, means, and extracted values. |
| 11 | |
| 12 | ## When to use it |
| 13 | |
| 14 | - You need a local starter for raster preprocessing or remote-sensing data handling. |
| 15 | - You want a minimal example of `rasterio.open`, `Window`, and average resampling. |
| 16 | - You want a deterministic JSON artifact before moving on to larger raster pipelines. |
| 17 | |
| 18 | ## Example |
| 19 | |
| 20 | ```bash |
| 21 | slurm/envs/geospatial/bin/python skills/earth-climate-and-geospatial-science/rasterio-windowed-raster-preprocessing-starter/scripts/run_rasterio_windowed_preprocessing.py \ |
| 22 | --out scratch/geospatial/rasterio_preprocessing_summary.json |
| 23 | ``` |
| 24 | |
| 25 | ## Verification |
| 26 | |
| 27 | - Skill-local tests: `python3 -m unittest discover -s skills/earth-climate-and-geospatial-science/rasterio-windowed-raster-preprocessing-starter/tests -p 'test_*.py'` |
| 28 | - Expected summary: `window_values == [[6.0, 7.0], [10.0, 11.0]]` |