reVX.least_cost_xmission.layers.masks.Masks
- class Masks(io_handler: LayeredTransmissionH5, masks_dir='.')[source]
Bases:
object
Create, load, and store masks to determine land and sea.
- Parameters:
io_handler (
LayeredTransmissionH5
) – Transmission IO handlermasks_dir (path-like, optional) – Directory for storing/finding mask GeoTIFFs. By default,
'.'
.
Methods
create_masks
(land_mask_shp_f[, save_tiff, ...])Create the offshore and land mask layers from a polygon land vector file.
Load the mask layers from GeoTIFFs.
Attributes
One pixel width line at shore
Raw mask - landfall mask
Offshore mask filename
Rasterized land vector
Dry cells mask, does not include landfall cells
Dry cells mask, includes landfall cells
Landfalls cells mask, only one cell wide
Wet cells mask, does not include landfall cells
Wet cells mask, includes landfall cells
- LANDFALL_MASK_FNAME = 'landfall_mask.tif'
One pixel width line at shore
- RAW_LAND_MASK_FNAME = 'raw_land_mask.tif'
Rasterized land vector
- LAND_MASK_FNAME = 'land_mask.tif'
Raw mask - landfall mask
- OFFSHORE_MASK_FNAME = 'offshore_mask.tif'
Offshore mask filename
- property landfall_mask: ndarray[Any, dtype[bool_]]
Landfalls cells mask, only one cell wide
- Type:
MaskArr
- property wet_mask: ndarray[Any, dtype[bool_]]
Wet cells mask, does not include landfall cells
- Type:
MaskArr
- property dry_mask: ndarray[Any, dtype[bool_]]
Dry cells mask, does not include landfall cells
- Type:
MaskArr
- property dry_plus_mask: ndarray[Any, dtype[bool_]]
Dry cells mask, includes landfall cells
- Type:
MaskArr
- property wet_plus_mask: ndarray[Any, dtype[bool_]]
Wet cells mask, includes landfall cells
- Type:
MaskArr
- create_masks(land_mask_shp_f: str, save_tiff: bool = True, reproject_vector: bool = True)[source]
Create the offshore and land mask layers from a polygon land vector file.
- Parameters:
mask_shp_f (str) – Full path to land polygon gpgk or shp file
save_tiff (bool, optional) – Save mask as tiff if true. By default,
True
.reproject_vector (bool, optional) – Reproject CRS of vector to match template raster if True. By default,
True
.