#!/usr/bin/env python # coding: utf-8 # # Dfs2 - Slicing # In[1]: import mikeio import matplotlib.pyplot as plt # In[2]: ds = mikeio.read("../tests/testdata/waves.dfs2") ds # In[3]: ds.geometry.find_index(x=1400, y=0) # In[4]: ds[0].plot() plt.axvline(1400,c='k', linestyle='dashed'); # In[5]: ds_col = ds.isel(28, axis=2) ds_col # In[6]: ds_col[0].plot(); # In[7]: ds_col.to_dfs("waves_x1400.dfs1") # In[8]: dsnew = mikeio.read("waves_x1400.dfs1") dsnew # In[9]: import os os.remove("waves_x1400.dfs1")