hydromt_fiat.components.HazardComponent#

class hydromt_fiat.components.HazardComponent(model: Model, *, filename: str = 'hazard.nc', region_component: str | None = None, region_filename: str = 'region.geojson')[source]#

Custom hazard component.

Inherits from the HydroMT-core GridComponent model-component.

Parameters:
  • model (Model) – HydroMT model instance.

  • filename (str, optional) – The path to use for reading and writing of component data by default. By default “hazard.nc”.

  • region_component (str, optional) – The name of the region component to use as reference for this component’s region. If None, the region will be set to the grid extent. Note that the create method only works if the region_component is None. For add_data_from_* methods, the other region_component should be a reference to another grid component for correct reprojection, by default None.

  • region_filename (str) – The path to use for reading and writing of the region data by default. By default “region.geojson”.

Attributes

bounds

Returns the bounding box of the model grid.

crs

Returns coordinate reference system embedded in the model grid.

data

Model static gridded data as xarray.Dataset.

data_catalog

Return the data catalog of the model this component is associated with.

model

Return the model object this component is associated with.

region

Provide access to the underlying GeoDataFrame data of the model region.

res

Returns the resolution of the model grid.

root

Return the root of the model this component is associated with.

transform

Returns spatial transform of the model grid.

Methods

add_data_from_constant(constant, name[, ...])

HYDROMT CORE METHOD: Adds data to grid component based on a constant value.

add_data_from_geodataframe(vector_data[, ...])

HYDROMT CORE METHOD: Add data variable(s) to grid component by rasterizing the data from vector_data.

add_data_from_raster_reclass(raster_data, ...)

HYDROMT CORE METHOD: Add data variable(s) to grid component by reclassifying the data in raster_data based on reclass_table_data.

add_data_from_rasterdataset(raster_data[, ...])

HYDROMT CORE METHOD: Add data variable(s) from raster_data to grid component.

clip(geom[, buffer, inplace])

Clip the hazard data based on geometry.

create_from_region(region, *[, res, crs, ...])

HYDROMT CORE METHOD: Create a 2D regular grid or reads an existing grid.

read([filename])

Read the hazard data.

set(data[, name])

Add data to grid.

setup(hazard_fnames[, hazard_type, ...])

Set up hazard maps.

test_equal(other)

Test if two components are equal.

write([filename, gdal_compliant])

Write the hazard data.

write_region(*[, filename, to_wgs84])

Write the model region to file.