dfsu.Dfsu2DH
dfsu.Dfsu2DH(self, filename)
Methods
extract_track |
Extract track data from a dfsu file |
get_overset_grid |
get a 2d grid that covers the domain by specifying spacing or shape |
read |
Read data from a dfsu file |
get_overset_grid
dfsu.Dfsu2DH.get_overset_grid(dx=None, dy=None, nx=None, ny=None, buffer=0.0)
get a 2d grid that covers the domain by specifying spacing or shape
Parameters
dx |
float |
grid resolution in x-direction (or in x- and y-direction) |
None |
dy |
float |
grid resolution in y-direction |
None |
nx |
int |
number of points in x-direction, by default None (the value will be inferred) |
None |
ny |
int |
number of points in y-direction, by default None (the value will be inferred) |
None |
buffer |
float |
positive to make the area larger, default=0 can be set to a small negative value to avoid NaN values all around the domain. |
0.0 |
read
dfsu.Dfsu2DH.read(items=None, time=None, elements=None, area=None, x=None, y=None, keepdims=False, dtype=np.float32, error_bad_data=True, fill_bad_data_value=np.nan)
Read data from a dfsu file
Parameters
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) points(s), by default None |
None |
y |
float | None |
Read only data for elements containing the (x,y) points(s), 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
mikeio.dataset.Dataset |
A Dataset with data dimensions [t,elements] |