Skip to content

Bugs in Hm0 calculation for spectrum dfsu in some cases #525

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

Open
jsmariegaard opened this issue Jan 10, 2023 · 8 comments
Open

Bugs in Hm0 calculation for spectrum dfsu in some cases #525

jsmariegaard opened this issue Jan 10, 2023 · 8 comments
Labels
bug Something isn't working out of scope Related to MIKE but not in the scope of MIKE IO

Comments

@jsmariegaard
Copy link
Member

Two problems have been identified for spectral dfsu files in the Hm0 calculation:

  • deletevalues in spectrum will give nan Hm0 - it should be safe to treat them as 0
  • if the file uses radians instead of degrees (unit: meter pow 2 sec per rad), the directional integration is wrong and Hm0 results will be sqrt(180/pi) too large.
@ecomodeller
Copy link
Member

No action have been taken on this issue, is this a hint that

def calc_Hm0_from_spectrum(
and related functionality is actually out of scope for MIKE IO?

@ecomodeller ecomodeller added bug Something isn't working out of scope Related to MIKE but not in the scope of MIKE IO labels Jan 20, 2025
@ecomodeller
Copy link
Member

Stale

@ecomodeller ecomodeller closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2025
@jsmariegaard
Copy link
Member Author

I think it is good to clean up - but I don't know if is a good idea to close issues because they are old and does not get attention. If they have not been fixed, it is still valuable information as least as a "known issue". Then for this issue it is still a question whether this is out of scope, but like we have other simple statistics in both generic and DataArray/Dataset I would say it's in-scope.

@ecomodeller
Copy link
Member

If you provide a minimal reproducible example that can illustrate the two bugs, I'll fix it.

@jsmariegaard
Copy link
Member Author

@stkistner or @daniel-caichac-DHI - could you please help me here?

@daniel-caichac-DHI
Copy link
Collaborator

What we did in wax was

@jsmariegaard
Copy link
Member Author

Sounds good but can you help me with 1-2 tiny files that illustrates the problem and could be used for tests?

@daniel-caichac-DHI
Copy link
Collaborator

daniel-caichac-DHI commented Apr 4, 2025

Energy_Action.zip

I have this, it is a model output so it starts from nothing, with mike viewer you can see 0's but you can probably just delete the data and save and see what happens.
I mean, maybe mike viewer does not show the NaN's but at least this is a direct model output.
It is wave action so you might encounter Another bug.

As for radians, I know that Bjarne has data in such format

@ecomodeller ecomodeller reopened this Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working out of scope Related to MIKE but not in the scope of MIKE IO
Projects
None yet
Development

No branches or pull requests

3 participants