imod.mf6.Solution.to_file#

Solution.to_file(modeldirectory: Path, pkgname: str, mdal_compliant: bool = False, crs: Any | None = None, engine: Literal['netcdf4', 'zarr', 'zarr.zip'] = 'netcdf4', **kwargs) Path#

Write package to file.

Parameters:
  • modeldirectory (pathlib.Path) – Directory where to write the package file.

  • pkgname (str) – Name of the package, used to create the file name.

  • mdal_compliant (bool, optional) – Whether to write the package in MDAL-compliant format. Only used if engine="netcdf4". Default is False.

  • crs (optional) – Coordinate reference system to use when writing the package. Only used if engine="netcdf4" Default is None.

  • engine (str, optional) – File engine used to write packages. Options are 'netcdf4', 'zarr', and 'zarr.zip'. NetCDF4 is readable by many other softwares, for example QGIS. Zarr is optimized for big data, cloud storage and parallel access. The 'zarr.zip' option is an experimental option which creates a zipped zarr store in a single file, which is easier to copy and automatically compresses data as well. Default is 'netcdf4'.

  • **kwargs (keyword arguments) – Additional keyword arguments forwarded to the package serializer’s to_file method.

Returns:

Path to the written package file.

Return type:

pathlib.Path