roms_tools.Grid.update_mask

roms_tools.Grid.update_mask#

Grid.update_mask(mask_shapefile: str | Path | None = None, close_narrow_channels: bool | None = None, verbose: bool = False) None#

Update the land mask of the current grid dataset.

The following steps are executed:

  1. Infer mask from coastlines

  2. Close narrow channels if requested

  3. Fill enclosed basins

  4. Update dataset stored in self.ds.

Parameters:
  • mask_shapefile (str or Path, optional) – Path to a coastal shapefile to derive the land mask. If None, the default Natural Earth 10m coastline dataset is used.

  • close_narrow_channels (bool, optional) – Whether to close narrow water channels. If None, uses the value from self.close_narrow_channels. Default is None.

  • verbose (bool, default False) – If True, prints timing and progress information.

Returns:

None – Updates the self.ds attribute in place with the new mask.