Questions tagged [grib]

GRIB is a binary format for storing spatial information, used most often in meteorology. Use this tag for questions about programmatically encoding and/or decoding data to/from GRIB files.

GRIB is binary file format defined by the World Meteorological Organization (WMO). It is a compact format for storing gridded meteorological data such as air temperature or pressure. There are two major versions of the format: GRIB1 and GRIB2.

Selected tools and interfaces

References

202 questions
3
votes
2 answers

Processing GRIB-2 Data in .Net

Is there a library for reading GRIB2 data files in .NET (preferably in F#)? If not, where is a specification that formally defines the GRIB2 data format?
Ben Hamner
  • 4,575
  • 4
  • 30
  • 50
3
votes
2 answers

Plotting GRIB data as a map with more than 360 degrees of longitude using R

I am trying to automatically grab data on wave height forecast and build plots similar this one. Using R, I could download the data and plot it using: library(rgdal) library(fields) ftp.string <-…
ruisea
  • 100
  • 7
3
votes
4 answers

Extracting data from grib file based on latitude and longitude

If i have a grib2 file that contains information for whole world (for some parameters) and I want to extract data from it using wgrib2 based on latitude and longitude given by user (client software to server). I tried following command but I am…
Pawan Tejwani
  • 109
  • 1
  • 1
  • 6
2
votes
1 answer

How to process GRIB files with php

Does anyone know if there's a php library out there that process GRIB files? I'd like to show global weather on my website using the GRIB (or GRIB 2) files that are available at Environment Canada. I use php to develop, which is why I'm looking…
user418775
  • 698
  • 1
  • 12
  • 20
2
votes
5 answers

Reading Grib2 files for lat/long data

Anybody here doing meteorological or earth-sciences work? I am trying to work with GRIB2 format data files. There are libraries available, in particular the Unidata GRIB Java Decoder. And I can see exactly how to extract data in a big linear array,…
Rick Wayne
  • 1,503
  • 2
  • 12
  • 11
2
votes
2 answers

xarray.Dataset conditionally indexing variables

Starting with a hrrr file downloaded from ncep. read into a xarray.Dataset like... ds: xr.Dataset = xr.open_dataset(file, engine="pynio") Dataset Dimensions: (ygrid_0: 1059, xgrid_0: 1799, lv_HYBL0: 50, …
Jason Leaver
  • 286
  • 2
  • 11
2
votes
1 answer

Xarray / Dask - Compute the highest temperature for every coordinate

I have a 17GB GRIB file containing temperature (t2m) data for every hour of year 2020. The dimensions of Dataset are longitude, latitude, and time. My goal is to compute the highest temperature for every coordinate (lon,lat) in data for the whole…
eMad
  • 998
  • 3
  • 13
  • 31
2
votes
1 answer

ecCodes (grib reading library) does not free the memory

I am using ecCodes library in my project, and I have encountered an issue that memory is not freed between reading the files. The minimal example representing the problem is this (and is basically a combination of those two library API usage…
J.Lewandowski
  • 71
  • 1
  • 11
2
votes
2 answers

Xarray (from grib file) to dataset

I have a grib file containing monthly precipitation and temperature from 1989 to 2018 (extracted from ERA5-Land). I need to have those data in a dataset format with 6 column : longitude, latitude, ID of the cell/point in the grib file, date,…
yacx
  • 167
  • 2
  • 13
2
votes
2 answers

Revert time averaged values to instant values with numpy

I am having a 3D field of an averaged quantity. Now I am looking for a pythonic way to revert the averaging to get instantaneous values for each time stamp. Note: The averaging is made from the beginning of the whole period. It is like rolling mean…
dl.meteo
  • 1,658
  • 15
  • 25
2
votes
2 answers

How do I resample a high-resolution GRIB grid to a coarser resolution using xESMF?

I'm trying to resample a set of GRIB2 arrays at 0.25 degree resolution to a coarser 0.5 degree resolution using the xESMF package (xarray's coarsen method does not work here because there is an odd number of coordinates in the latitude). I have…
Phantom139
  • 143
  • 9
2
votes
2 answers

converting Grib to netcdf4

I downloaded data from ECMWF for Era interim in grib format. Is there a way to convert a grib file with multiple bands to netCDF4, keeping the bands in the NETCDF format? I tried using the cdo operations, but the output will be only the first band…
2
votes
1 answer

Read compressed binary file (.grib2.bz2)

I have downloaded one of the files from this list https://opendata.dwd.de/weather/nwp/icon-eu/grib/03/t_2m/ (the actual filenames change every day) which are bz2 compressed. I can read in the decompressed file using e.g. import xarray as xr # cfgrib…
Alex
  • 4,925
  • 2
  • 32
  • 48
2
votes
0 answers

Grib to netcdf with 4 dimensions and multiple variables

I am trying to convert a grib file into netcdf with wgrib2. I am working on Windows 10. My grib file has 4 dimensions and 2 variables: My two variables are Temperature and Total precipitation rate with the following dimensions : time (length 20),…
Chika
  • 1,455
  • 2
  • 16
  • 24
2
votes
2 answers

How to plot contours from a polar stereographic grib2 file in Python

I am trying to plot a CMC grib2 pressure forecast file using matplotlib to plot the pressure contours. The description of the grib2 grid can be found here: https://weather.gc.ca/grib/grib2_reg_10km_e.html. The grib2 file is found in this…
Campbell
  • 396
  • 3
  • 10
1 2
3
13 14