windkit.raster_map.validate_roughness_raster_map
- windkit.raster_map.validate_roughness_raster_map(da, raise_or_warn='warn', max_roughness=5.0, n_max_unique=100)[source]
Validate roughness raster map. Some common issues are checked for and warnings are raised.
# TODO: move PyWAsP related checks to pywasp in the future.
Warning
This function is experimental and its signature may change or it may be removed in the future.
- Parameters:
da (xarray.DataArray) – Roughness raster map to validate
raise_or_warn (str) – Whether to raise or warn on validation errors
max_roughness (float) – Maximum roughness value
n_max_unique (int) – Maximum number of unique roughness values
- Raises:
ValueError – If the input raster map is not a raster and raise_or_warn is set to ‘raise’
ValueError – If the input raster map is not named ‘roughness’ and raise_or_warn is set to ‘raise’
ValueError – If the roughness map contains negative values and raise_or_warn is set to ‘raise’
ValueError – If the roughness map contains values between 0 and 0.0002 and raise_or_warn is set to ‘raise’
ValueError – If the roughness map contains values above max_roughness and raise_or_warn is set to ‘raise’
ValueError – If the roughness map contains more than n_max_unique unique roughness values and raise_or_warn is set to ‘raise’