stac_download_bands
Download specific satellite bands from a STAC scene as GeoTIFF or PNG, with optional bounding box cropping and cloud masking.
Instructions
Download specific bands from a scene as a GeoTIFF or PNG.
Reads band COGs via HTTP, windows to the requested bbox, and stores the result in chuk-artifacts. The bbox should be in EPSG:4326 — CRS reprojection to the raster's native CRS is handled automatically.
Args: scene_id: Scene identifier from a previous stac_search call bands: Band names to download. Common names: - Sentinel-2: red, green, blue, nir, swir16, swir22, rededge1-3, scl - Landsat: red, green, blue, nir08, swir16, swir22, coastal, qa_pixel - Sentinel-1: vv, vh - DEM: data bbox: Optional crop bbox in EPSG:4326 [west, south, east, north]. Strongly recommended to avoid downloading full tiles output_format: "geotiff" (default, lossless, for analysis) or "png" (8-bit lossy with percentile stretch, for preview/display) cloud_mask: Apply SCL-based cloud masking (Sentinel-2 only). Masked pixels become 0 (integer) or NaN (float) output_mode: Response format - "json" (default) or "text"
Returns: JSON with artifact_ref, shape, dtype, and optional preview_ref
Tips for LLMs: - Use stac_describe_scene first to see available band names - Always provide a bbox to limit download size - Use output_format="png" when the user wants to see the image - GeoTIFF preserves full radiometric precision for analysis - A PNG preview is auto-generated alongside GeoTIFF downloads - For RGB visualisation, prefer stac_download_rgb (simpler) - For spectral indices, prefer stac_compute_index (automatic)
Example: result = await stac_download_bands( scene_id="S2B_...", bands=["red", "nir"], bbox=[0.85, 51.85, 0.95, 51.92] )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bbox | No | ||
| bands | Yes | ||
| scene_id | Yes | ||
| cloud_mask | No | ||
| output_mode | No | json | |
| output_format | No | geotiff |