dfsu.Dfsu2DV

dfsu.Dfsu2DV(self, filename)

Attributes

Name Description
deletevalue File delete value
end_time File end time
items List of items
n_items Number of items
n_layers Maximum number of layers
n_sigma_layers Number of sigma layers
n_timesteps Number of time steps
n_z_layers Maximum number of z-layers
start_time File start time
timestep Time step size in seconds

Methods

Name Description
plot_vertical_profile Plot unstructured vertical profile
read Read data from a dfsu file

plot_vertical_profile

dfsu.Dfsu2DV.plot_vertical_profile(values, time_step=None, cmin=None, cmax=None, label='', **kwargs)

Plot unstructured vertical profile

Parameters

Name Type Description Default
values value for each element to plot required
cmin lower bound of values to be shown on plot, default:None None
cmax upper bound of values to be shown on plot, default:None None
title axes title required
label colorbar label ''
cmap colormap, default viridis required
figsize specify size of figure required
ax Adding to existing axis, instead of creating new fig required

Returns

Type Description
<matplotlib.axes>

read

dfsu.Dfsu2DV.read(items=None, time=None, elements=None, area=None, x=None, y=None, z=None, layers=None, keepdims=False, dtype=np.float32, error_bad_data=True, fill_bad_data_value=np.nan)

Read data from a dfsu file

Parameters

Name Type Description Default
items str | int | typing.Sequence[str | int] | None Read only selected items, by number (0-based), or by name None
time int | str | slice | None Read only selected time steps, by default None (=all) None
keepdims bool When reading a single time step only, should the time-dimension be kept in the returned Dataset? by default: False False
area typing.Tuple[float, float, float, float] | None Read only data inside (horizontal) area given as a bounding box (tuple with left, lower, right, upper) or as list of coordinates for a polygon, by default None None
x float | None Read only data for elements containing the (x,y,z) points(s) None
y float | None Read only data for elements containing the (x,y,z) points(s) None
z float | None Read only data for elements containing the (x,y,z) points(s) None
layers int | mikeio.spatial._FM_geometry_layered.Layer | typing.Sequence[int] | None Read only data for specific layers, by default None None
elements typing.Collection[int] | None Read only selected element ids, by default None None
error_bad_data bool raise error if data is corrupt, by default True, True
fill_bad_data_value float fill value for to impute corrupt data, used in conjunction with error_bad_data=False default np.nan np.nan

Returns

Type Description
mikeio.dataset.Dataset A Dataset with data dimensions [t,elements]