Closed jeremybarbet closed 3 years ago
Hi, about your first question yes the values are produced by the underlying grib processing tool. You can visualize the content of your grib file using eg https://www.giss.nasa.gov/tools/panoply/ and check the values. We are on the way to integrate a new tool that is not based on Java, see weacast/weacast#17, you might give it a try and see if the output is similar.
About your second question, although the interpolation algorithm is well defined per se, the different conventions about the values ordering and the latitude/longitude range could make it a bit tricky to implement. As a consequence, we have built a pretty generic class to handle different cases in weacast (grid of different sizes, longitude crossing, etc.). This is for instance used to resample the weather data on-demand. Feel free to use it or start something from it.
Thank you, this is very helpful!
I was looking for a good tool to visualise GRIB2 file and Panoply is much much better than the rest I tried, thanks! Also, according to it, it looks like the values are corresponding to the one obtain with the java library. However, I might give a try to the ecCodes implementation, I've been noticing huge usage of memory with the java.
About the interpolation, from my understanding, ICON-EU is a triangular datasets, so I would need to find a triangular interpolation method to obtain the lon/lat grid result. Is my understanding correct?
Thank you for your help and answer,
Yes ICON uses an icosahedral grid for modeling but you can convert ICON files to the more standard rectangular grid using https://github.com/DeutscherWetterdienst/regrid first, then perform the standard bilinear interpolation. By the way this tool also relies on ecCodes so the interpolation algorithm probably comes from it.
Triangular interpolation follows the same mathematical principles as standard bilinear interpolation over quads but it is less used except in video games where meshes are triangles ;-) You might find relevant resources about it if you'd like to interpolate raw icon data.
Thank you for your help. I ended up using ecCodes and its grib_get_data
which returns a file of latitude/longitude/value. Just add to create a buildpack for heroku to install ecCodes
Hey!
Thank you for the great library, it helped me a lot! This is not an issue per se, but more questions on how to handle the outputted data generated.
I'm converting GRIB2 files obtained from the DWD for the ICON-EU forecast model for the cloud coverage (total cover, high, middle and low clouds).
First question, after running the grib2json, I get the headers from the GRIB2 file. It gives me the following:
nx: 1097, ny: 657
. When I compare it with the official DWD regrid tool, it gives the following values. I believe these data are obtained upstream by the java tool but you might know why there is a difference in those values? Maybe the data from the grib2 file are correct and the one from DWD are wrong or any other reason?Second question is about parsing the 2D grid data generated by the package. How do I interpolate the values to obtain an array of array of lat/lon/value e.g.
data: [[64.4,-21.7,12.5], [...]]
. I've been using the following code a bit modified for my purpose (with a grid of point generated with turf and then map with the data returned by the previous code, but it looks like it doesn't interpolate correctly the coordinates. I believe it's related to the fact that the icon-eu grib2 file returns a grid with a BBOX of[-23.5, 54.63, 32.5, 70.5]
while this script use 90 and 0 as references. Do you know which values I have to change to apply the reference of the grib file?In general, do you have good read about grib2 and libraries to interpolate its values? There is a lot of python/java libraries, but I would prefer a javascript solution.
Thanks in advance, hope it won't be too much bother with my questions,