TransWikia.com

Extract values from Grib-files at several specific locations

Geographic Information Systems Asked on December 13, 2021

I have got a GRIB file from ECMWF for a small area in the Antarctic. It contains hourly data for one month of multiple variables (eg. wind, seaicecover, sst etc.). I want to extract this data to .txt files (every file for a different variable) at several specific locations…meaning that i have around 1000 sampling locations (stored in a text file with rows for Longitude, Latitude and ID) , for which i want to get the environmental data of the GRIB. Is there a way to get this done without doing manually? In the end a file (eg. windspeed) should have all the windspeed-values for given locations at the different times. I have already tried to use cdo and wgrib2 for example but neither of them provided me with a fitting solution or i didn’t found the right tools. I am using Windows 10 (64 bit) and i’ve got Python 3.8 and Ubuntu 20.04 LTS installed. If you would need more specific information please let me know. I cannot include any code here because i have absolutely no idea how to approach this problem.
But nevertheless here is an example of the Format of the sampling locations:

Longitude  Latitude fid 
1 -50.87164 -61.57444  R1      
2 -60.65056 -61.30030  R2      
3 -50.46169 -61.01206  R3     

Do you have any idea which tool i could use for this?

One Answer

You can extract data from GRIB files using the standalone program CDO.

To extract from a single point, I've previously used this command in DOS / CMD:

cdo.exe -output -select,param=%PARAMETERS% -remapnn,lon=%LON%/lat=%LAT% inputGribFile.grb > outputfile.txt

Here, you need to specify which parameters from the grb-file that you need, which you can also use CDO to help you identify.

Disclaimer: it has been quite a while since I used CDO, but it appears to be reasonably well supported and up-to-date.

Another possible tool to use seems to be ecCodes.

Answered by Mikkel Lydholm Rasmussen on December 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP