DHI / mikecore-python

MIKE Core in Python
5 stars 0 forks source link

Shoreline profile - bad spatial axis unit #18

Open ecomodeller opened 2 years ago

ecomodeller commented 2 years ago

Spatial axis unit is wrong in shoreline profile dfs2.

Which makes it impossible to read the data in mikecore, even though the file can be opened in Mike Zero.

ValueError: 100217 is not a valid eumUnit
ecomodeller commented 2 years ago

This is the original issue: https://github.com/DHI/mikeio/issues/266

JesperGr commented 2 years ago

100217 is a EUM item type number, and not a unit. Seems like somewhere the item type number is used as a unit number.

JesperGr commented 2 years ago

I just had a look at the file, and it is invalid. The fix in DfsFile is fine, though I would probably not check in an invalid file to the repository?

Where does this file come from, do you know?

JesperGr commented 2 years ago

Also, the same construction using 'eumUnit(eumUnitInt.value)' is there for all spatial axis, and the fix should be extended to all of them.

JesperGr commented 2 years ago

Found the origin of the file: Mesh Editor in MIKE Zero. I will report a bug for that one as well, so that will be fixed for next release. Though, this fix is still required to support existing files.

The fix works similar to MZ tools: If unit is not found, it defaults to meters.

ecomodeller commented 2 years ago

I just had a look at the file, and it is invalid. The fix in DfsFile is fine, though I would probably not check in an invalid file to the repository?

Where does this file come from, do you know?

The file is from a shoreline morphology model according to the client.