revrt.costs.cli.build_masks#

build_masks(land_mask_shp_fp, template_file, masks_dir, reproject_vector=True, chunks='auto')[source]#

Build masks from land vector file

Masks are used in the cost layer creation step to determine where costs should be applied (e.g. wet vs dry). The land mask is the base mask that is created by rasterizing the input land vector file. The landfall mask is derived from the land mask and is a one pixel width line at the shore. The offshore mask is derived from the land mask and is the inverse of the land mask (i.e. all non-land cells are offshore).

Parameters:
  • land_mask_shp_fp (path-like) – Path to land polygon GPKG or shp file.

  • template_file (path-like) – Path to template GeoTIFF (*.tif or *.tiff) or Zarr (*.zarr) file containing the profile and transform to be used for the masks.

  • masks_dir (path-like) – Directory to output mask GeoTIFFs.

  • reproject_vector (bool, default True) – Option to reproject CRS of input land vector file to match CRS of template file. By default, True.

  • chunks (str, optional) – Chunk size to use when reading the template file. This will be passed down as the chunks argument to rioxarray.open_rasterio() or xarray.open_dataset(). By default, "auto".