Dfs3
Class for reading/writing dfs3 files.
Parameters
| filename |
str | Path |
Path to dfs3 file |
required |
Methods
| append |
Append a Dataset to an existing dfs3 file. |
| read |
Read data from a dfs3 file. |
append
Dfs3.append(ds, validate=True)
Append a Dataset to an existing dfs3 file.
Parameters
| ds |
Dataset |
Dataset to append |
required |
| validate |
bool |
Validate that the dataset to append has the same geometry and items as the original file |
True |
Notes
The original file is modified.
read
Dfs3.read(
items=None,
time=None,
area=None,
layers=None,
keepdims=False,
dtype=np.float32,
)
Read data from a dfs3 file.
Parameters
| items |
str | int | Sequence[str | int] | None |
Read only selected items, by number (0-based), or by name |
None |
| time |
int | str | slice | Sequence[int] | None |
Read only selected time steps, by default None (=all) |
None |
| area |
tuple[float, float, float, float] | None |
Read only data within the specified rectangular area (x0, x1, y0, y1) |
None |
| keepdims |
bool |
When reading a single time step or a single layer only, should the singleton dimension be kept in the returned Dataset? by default: False |
False |
| layers |
str | int | Sequence[int] | None |
Read only data for specific layers, by default None |
None |
| dtype |
Any |
Define the dtype of the returned dataset (default = np.float32) |
np.float32 |