DHI / mikeio

Read, write and manipulate dfs0, dfs1, dfs2, dfs3, dfsu and mesh files.
https://dhi.github.io/mikeio
BSD 3-Clause "New" or "Revised" License
136 stars 53 forks source link

Dfs2 - static items (bathymetry) #677

Open stkistner opened 3 months ago

stkistner commented 3 months ago

Problem

When reading certain Dfs2's, e.g. model outputs from the FM egine the file often contains a static item that describes the bathymetry. This item is a perquisite in some of the processing tools or connected models (e.g. directional wave analysis or MIKE MA). When processing these files with mikeio the data is discarded, which naturally leads to problems.

Solution

Add an option to read/write the static bathy item

Alternatives considered

Using mikecore I can get around this. But we like to use mikeio for simplicity. I haven't seen any other issues related to this.

ecomodeller commented 3 months ago

Is bathymetry the only example of where a static item is used (in practice), or are there other examples?

stkistner commented 3 months ago

Is bathymetry the only example of where a static item is used (in practice), or are there other examples?

Bathymetry is the only example that I'm aware of.

ecomodeller commented 3 months ago

I am a bit hesitant if this should be part of MIKE IO, I was under the impression that Dfs2 output from HD models was legacy.

But one option could be to add the Bathymetry to the Grid2D geometry property.


From: stkistner @.> Sent: Thursday, March 21, 2024 2:58:21 PM To: DHI/mikeio @.> Cc: Henrik Andersson @.>; Comment @.> Subject: Re: [DHI/mikeio] Dfs2 - static items (bathymetry) (Issue #677)

Is bathymetry the only example of where a static item is used (in practice), or are there other examples?

Bathymetry is the only example that I'm aware of.

— Reply to this email directly, view it on GitHubhttps://github.com/DHI/mikeio/issues/677#issuecomment-2012375114, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAEV6RZKC6IWWKOXNIDCBX3YZLRP3AVCNFSM6AAAAABFBMT4B2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJSGM3TKMJRGQ. You are receiving this because you commented.Message ID: @.***>

jsmariegaard commented 3 months ago

The FM engine can output dfs2 in a gridded overlay. That is not a legacy output. I don't know, however, whether it contains any static bathymetry 🤔

stkistner commented 3 months ago

I extracted a Dfs2 this morning from a Dfsu, and that did extract the bathy data too.

But I know this is for 1 out of 100 applications. In the meantime I've managed to re-add the bathy using mikecore, but a a mikeio implementation would be nice 😉

ecomodeller commented 3 months ago

Let's add the bathymetry as an optional attribute to the Grid2D data structure.