imod.mf6.HorizontalFlowBarrierResistance.from_imod5_data#
- classmethod HorizontalFlowBarrierResistance.from_imod5_data(key: str, imod5_data: dict[str, dict[str, DataArray | UgridDataArray]]) Self[source]#
Import HFB data from imod5 data dictionary. Data from “3D GEN” files, so with a polygon geometry, can be loaded with this method. Closed rings in the GEN file without z coordinates, which are read as 2D polygons, are converted to
LinearRinggeometries which span the full vertical column of the model. Polygons with interior rings become oneLinearRingfor each ring, as each of them is a barrier. Z polygons with interior rings are not supported.- 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 3D GEN files.>>> imod5_data, _ = imod.prj.open_projectfile_data("path/to/prj/file.prj") >>> hfb = HorizontalFlowBarrierResistance.from_imod5_data("hfb-1", imod5_data)