{
  "name": "sc26-gdal-terrain",
  "display_name": "SC26 GDAL terrain hillshade",
  "summary": "Generate a synthetic 256x256 elevation model (two hills and a valley) over the Atlanta area, then use GDAL in a container to georeference it, reproject to Web Mercator, compute hillshade and slope, and export PNG previews.",
  "containers": [
    "gdal/2026.09"
  ],
  "steps": [
    {
      "id": "s1",
      "kind": "slurm-cpu",
      "name": "terrain",
      "script": "jobs/s1.sh",
      "after": [],
      "container": "gdal/2026.09",
      "use_slurm": false,
      "copies": [],
      "shape": {
        "cpus": 2,
        "mem": "4G",
        "nodes": 1
      }
    }
  ],
  "spans": [],
  "files": {
    "jobs/s1.sh": "#!/bin/bash\nset -euo pipefail\npublish() { d=/vault/projects/sc26geospatial/sc26-results/gdal/$(date -u +%Y%m%dT%H%M%SZ); mkdir -p \"$d\" 2>/dev/null && cp -r results/. \"$d/\" 2>/dev/null && echo \"published to $d\" || echo \"results kept in $PWD/results\"; }\nG=\"apptainer exec /tmp/image.sif\"\nmkdir -p results\n$G gdalinfo --version\n# synthetic DEM as an ASCII grid (lon -84.6..-84.2, lat 33.6..34.0), elevations in metres\nawk 'BEGIN{n=256; x0=-84.6; y0=34.0; d=0.4/n; print \"ncols \" n; print \"nrows \" n; printf \"xllcorner %.6f\\nyllcorner %.6f\\ncellsize %.9f\\nNODATA_value -9999\\n\", x0, y0-0.4, d;\n  for(r=0;r<n;r++){line=\"\"; for(c=0;c<n;c++){x=c/n; y=r/n; z=250+180*exp(-((x-0.3)^2+(y-0.35)^2)/0.02)+120*exp(-((x-0.72)^2+(y-0.6)^2)/0.03)-60*exp(-((x-0.5)^2)/0.004)+8*sin(25*x)*cos(19*y); line=line sprintf(\"%.1f \",z)} print line}}' > dem.asc\n$G gdal_translate -of GTiff -a_srs EPSG:4326 -co COMPRESS=DEFLATE dem.asc results/dem_wgs84.tif\n$G gdalwarp -t_srs EPSG:3857 -r bilinear -co COMPRESS=DEFLATE -overwrite results/dem_wgs84.tif results/dem_webmercator.tif\n$G gdaldem hillshade -z 2 -az 315 -alt 45 results/dem_webmercator.tif results/hillshade.tif\n$G gdaldem slope results/dem_webmercator.tif results/slope.tif\n$G gdal_translate -of PNG -scale results/hillshade.tif results/hillshade.png\n$G gdal_translate -of PNG -ot Byte -scale results/dem_webmercator.tif results/elevation.png\n$G gdalinfo -stats results/dem_webmercator.tif | grep -E 'Size is|PROJCRS|STATISTICS_(MIN|MAX|MEAN)' | tee results/summary.txt\nls -la results\npublish\n"
  }
}
