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
boundsReturns the bounding box of the model grid.
crsReturns coordinate reference system embedded in the model grid.
Model static gridded data as xarray.Dataset.
data_catalogReturn the data catalog of the model this component is associated with.
modelReturn the model object this component is associated with.
regionProvide access to the underlying GeoDataFrame data of the model region.
resReturns the resolution of the model grid.
rootReturn the root of the model this component is associated with.
transformReturns 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_databased onreclass_table_data.add_data_from_rasterdataset(raster_data[, ...])HYDROMT CORE METHOD: Add data variable(s) from
raster_datato 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.