Skip to content

Update notebooks to produce gridcerf data v2.1 - #4

Open
kmongird wants to merge 6 commits into
mainfrom
dev
Open

Update notebooks to produce gridcerf data v2.1#4
kmongird wants to merge 6 commits into
mainfrom
dev

Conversation

@kmongird

@kmongird kmongird commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

This pull request:

  • Updates the build_compiled_suitability.ipynb notebook: incorporates several improvements to code execution, output handling, and file management. The main changes include enabling compression for raster outputs, and simplifying directory creation logic.
  • Updates the build_geothermal_resource_potential.ipynb notebook: incorporates updated geothermal potential data to build new geothermal class rasters
  • Creates the build_offshore_bathymetry_suitability.ipynb notebook: Adds a new constraint layer for offshore wind related to bathymetry

@kmongird
kmongird requested review from crvernon and a lite review from Copilot September 9, 2026 21:42
@kmongird kmongird self-assigned this Sep 9, 2026
@kmongird kmongird added the enhancement New feature or request label Sep 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new offshore bathymetry notebook contains masking/metadata logic issues that can yield incorrect suitability outputs and/or inconsistent raster write metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the notebook-based data build pipeline to generate GRIDCERF data v2.1 outputs, including adding an offshore bathymetry constraint layer and improving compiled raster generation.

Changes:

  • Adds a new build_offshore_bathymetry_suitability.ipynb notebook to generate an offshore bathymetry exclusion raster from GEBCO data.
  • Updates build_compiled_suitability.ipynb to improve scenario-layer naming, simplify output directory creation, and enable DEFLATE compression when writing compiled rasters.
File summaries
File Description
notebooks/build_offshore_bathymetry_suitability.ipynb New notebook to warp GEBCO bathymetry to GRIDCERF CRS/extent and produce an offshore depth suitability raster.
notebooks/build_compiled_suitability.ipynb Improves compilation pipeline logic (layer renaming + directory creation) and writes compressed compiled rasters.
Review details

Suppressed comments (1)

notebooks/build_offshore_bathymetry_suitability.ipynb:231

  • The land-mask combination logic can incorrectly flip some land pixels to "suitable" when arr is already excluded (e.g., if a land cell is NaN/previously masked): arr=1 + land marker (2) becomes 3, then arr == 2 maps it to 0. Land exclusion should be an OR with the existing exclusion mask, not an equality check on a summed value.
    "            land_array = np.where(land_array==0, 1, 2)\n",
    "            \n",
    "            # apply land area mask\n",
    "            arr += land_array\n",
    "            arr = np.where(arr ==2, 1, 0)\n",
  • Files reviewed: 2/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +206 to +208
" # update metadata datatype to int16\n",
" metadata = src.meta.copy()\n",
"\n",
Comment on lines +213 to +223
" arr = bath_tif.read(1)\n",
"\n",
" # make all areas with seafloor deeper than 1000m below water unsuitable\n",
" arr = np.where(arr < maximum_depth, 1, 0)\n",
" \n",
" # apply siting mask\n",
" arr += siting_mask.astype('int64')\n",
" arr = np.where(arr >= 1, 1, 0).astype(np.float64)\n",
" \n",
" # make nan excluded\n",
" arr = np.where(np.isnan(arr), 1, arr)\n",
Comment on lines +112 to +113
"# GRIDCERF source data directory for the downloaded airport data\n",
"source_dir = os.path.join(gridcerf_dir, \"source\", \"technology_specific\", 'offshore_bathymetry' )\n",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants