imod.mf6.SingleLayerHorizontalFlowBarrierResistance.from_imod5_data#
- classmethod SingleLayerHorizontalFlowBarrierResistance.from_imod5_data(key: str, imod5_data: dict[str, dict[str, DataArray | UgridDataArray]]) Self[source]#
Import HFB data from imod5 data dictionary. Data from “2D GEN” files, so with a line shape, can be loaded with this method. Closed rings in the GEN file, which are read as polygons, are converted to
LinearRinggeometries. Polygons with interior rings become oneLinearRingfor each ring, as each of them is a barrier.- Parameters:
key (str) – Key in the imod5_data dictionary where the HFB data is stored.
imod5_data (Dict[str, GridDataDict]) – Dictionary with data from imod5, where the HFB data is stored under the provided key.
- Returns:
HFB package with data from the imod5 data dictionary.
- Return type:
Examples
Load HFB data from an imod5 data dictionary. The imod5 data dictionary can be obtained by reading a .prj file with the
imod.prj.open_projectfile_data()function. The projectfile should point to 2D GEN files.>>> imod5_data, _ = imod.prj.open_projectfile_data("path/to/prj/file.prj") >>> hfb = SingleLayerHorizontalFlowBarrierResistance.from_imod5_data("hfb-1", imod5_data)