Skip to content
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

problem with x and y when reading dfs2 files from MikeShe with MIKE IO #540

Closed
tad9876 opened this issue Jan 23, 2023 · 8 comments
Closed

Comments

@tad9876
Copy link

tad9876 commented Jan 23, 2023

Describe the bug
When reading an dfs2 file dataset.geometry.origin is not the same as dataset.geometry.xy[0]. Actually dataset.geometry.xy[0] is exactly double of the origin.

dataset.geometry.xy
datase.geometry._xx
dataset.geometry._yy
is wrong

while;
dataset.geometry.dx
dataset.geometry.dy
dataset.geometry.nx
dataset.geometry.ny
datase.geometry._x0
dataset.geometry._y0
all seems right

Screenshots
image

System information:

  • Python 3.10
  • MIKE IO 1.2.2
@ecomodeller
Copy link
Member

Why is the projection: NON-UTM?

@ecomodeller
Copy link
Member

Can you include the geographical information as shown in MIKE Zero?

This is a file from the MIKE SHE installation examples:
image
image

@ecomodeller
Copy link
Member

While this is the output from MIKE SHE...
image
image

@jsmariegaard
Copy link
Member

It is intensional that the x-coordinate vector starts in x0 + origin[0]. In most cases, x0 will be zero.

@tad9876
Copy link
Author

tad9876 commented Jan 24, 2023

The problem is that the 2D x and y are wrong when reading with MikeIO (mikeio.read())
I attach a .dfs2 and a .dfs3 file. They are output files from the same MikeShe model run.
I also attach a small python script, which show that x_2D and x_3D are not the same (as they should be). x_3D is correct, x_2D is wrong. The same is the case for y.
I want to use the interp(x,y) function on the .dfs2 file, so it is really important that x and y is correct.

Tuse_aa_50m_cal_3DSZ.dfs3.txt
Tuse_aa_50m_cal_2DSZ.dfs2.txt
test_mikeIO.py.txt

@Snowthe
Copy link

Snowthe commented Jan 25, 2023

[I'm a colleague of tad9876 also familiar with the issue]

So that means that we are defining the coordinate systems wrong in our setups? The mentioned issue occurs with result files from MIKE SHE; not with dfs2 files that we create ourselves from scrartch via mikeio or similar.

In the MIKE SHE setup (Model Domain and Grid), we usually just use "Local coordinates" as a map projection type (even though it most often is ETRS89 UTM32N we do not specify this there), and define a catchment origin X0 and Y0 (together with the rest, i.e. NX, NY, cell size).
Now what puzzles me:

  1. This produces output files with this value for X0 abnd Y0 both in the geographical Information and in the spatial axis origin (as shown 3 posts above)
  2. However, this works together (correctly) with input files that we create from scratch or templates, which also use "Local coordinates" as projections, but only have the origin offset in the geographical information (while the origin of the spatial axis is 0, 0)

I was not able to understand what is going on here from the manual - are you able to help?
Thanks a lot

@Snowthe
Copy link

Snowthe commented Feb 9, 2023

Thanks, Jesper.
(I take that we did not misunderstand how to define our coordinate systems, but that there is some inconsistency in the definition of dfs files)
Looking forward to getting this solved.

@jsmariegaard
Copy link
Member

closed by #544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants