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

Working with icosahedral data in python #9

Closed
keksundso opened this issue Oct 18, 2024 · 2 comments
Closed

Working with icosahedral data in python #9

keksundso opened this issue Oct 18, 2024 · 2 comments
Assignees

Comments

@keksundso
Copy link

Hello,

it is not 100% fitting as a issue to this repo, still I hope you might be able to help.

I was wondering if it is possible to work directly with icosahedral-ICON-grib2 files in python, instead of first converting it to lat-lon-Data. I am currently using pygrib in python, but it can not handle "unstructured data".

So my questions are:

  • How could i find the icosahedral coordinates which correspond to a given lat-long pair.
  • Is there a python library which can work with icosahedral-ICON-grib2 files.

Thank you in advance

@bjoern-reetz bjoern-reetz self-assigned this Jan 15, 2025
@bjoern-reetz
Copy link
Member

Hello, and sorry that no one reacted to your issue. We currently do not have the resources to support this project adequately.

While I cannot offer advice regarding pygrib, I can give you some tips on how to process DWD NWP data in native icosahedral grid: As documented in chapter 3.1 of our ICON database reference, you can download so-called "grid files" at http://icon-downloads.mpimet.mpg.de/dwd_grids.xml. They are just netCDF files and contain information to reconstruct the geographic coordinates of points in the icon grid. But I would rather suggest a different approach.

As a convenience for you, we export the Lat/Lon coordinates of every point in the icosahedral grid as a seperate field: CLAT/CLON. To extract the data for a given lat/lon coordinate, find the index that has the smallest distance with respect to the CLAT/CLON fields and use that index to retrieve the data from other fields, e.g. TOT_PREC.

This of course assumes your GRIB libraries can handle unstructured data. When using Python, this can be done using python-eccodes. Remember that you need to use the DWD ecCodes definitions to use our custom GRIB short names.

@keksundso
Copy link
Author

Thanks a lot for your suggestion. I just implemented your approach using CLAT/CLON. It works perfectly and significantly reduces the required computations.

I greatly appreciate your help and the data the DWD provides.

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

2 participants