open
open(filename, **kwargs)Open a dfs/mesh file (and read the header).
The typical workflow for small dfs files is to read all data with mikeio.read instead of using this function. For big files, however, it can be convenient to open the file first with dfs=mikeio.open(…) to inspect it’s content (items, time and shape) and then decide what to read using dfs.read(…)
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| filename | str | Path | Full path and file name to the dfs file. A leading ~ is expanded to the user’s home directory. |
required |
| **kwargs | Any | Additional keyword arguments, e.g. type=“spectral” | {} |
See also
mikeio.read - read data from a dfs file
Examples
>>> dfs = mikeio.open("wl.dfs1")
>>> dfs = mikeio.open("HD2D.dfsu")
>>> ds = dfs.read(items="Salinity", time="2016-01")>>> dfs = mikeio.open("pt_spectra.dfs2", type="spectral")