-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading spectra from Dfs2s: x0 and y0 defaults to zero #574
Comments
AFAIK a Dfs2 file has no metadata which tells you that this file should be interpreted as a vertical slice. So I guess the pragmatic solution is to use the same approach as the spectral data, and supply that information when you open the file, e.g. |
Thanks. I'll try and implemented something pragmatic. |
@stkistner I am curious - could you describe the need a bit more? Is there an engine that needs this information? In that case I think we should consider to re-open :-) |
I think it's best described in the FAQ for MIKE.
It's a niche case, but I have used this type of functionality to create vertical boundaries from HYCOM or CMEMS. Another example was when trying to convert a Dfs2 that was incorrectly read in as a non-spectral Dfs2 to a spectral Dfs2. But without the x0 or y0 data available anywhere it's not possible. The solution was to throw an Exception telling the user to use the |
@jsmariegaard on another related note: When read with mikeio, this is added to the direction-axis of the spectral data: |
Description
x0 and y0 defaults to zero when reading Dfs2 files.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
In 9 out of 10 cases the x0 and y0 origins aren't necessary in Dfs2 files, but it is used in some cases e.g. vertical boundaries:
https://faq.dhigroup.com/default.asp?module=MIKE+3&ID=532
I see this traces back to the
read_x0y0=False
parameter inmikeio.dfs._dfs2._read_dfs2_header
, which is only set to True when reading spectral datasets. Is there any logical way around this?System information
The text was updated successfully, but these errors were encountered: