Python module for reading and writing GRIB (editions 1 and 2) files. GRIB is the World Meterological Organization standard for distributing gridded data.
Questions tagged [pygrib]
51 questions
11
votes
5 answers
Installing pygrib Package
Apologies in advance for what is probably a bad/poorly phrased question, but I merely dabble in programming and am very unfamiliar with under the hood aspects of package installation, etc.
Basically, I am trying to install the pygrib package…

Matt Stalley
- 111
- 1
- 1
- 3
4
votes
2 answers
Convert grib2 files to csv
I am working on a classification problem with grib2 files. I have been trying Xarray, pynio, pygrib to read these data but couldn't solve it yet. Can anybody explain what is the structure of grib2 files? How they are created? Is there any quick way…

psuresh
- 535
- 2
- 13
- 25
4
votes
1 answer
How to Deal with Lat/Lon Arrays with Multiple Dimensions?
I'm working with Pygrib trying to get surface temperatures for particular lat/lon coordinates using the NBM grib data (available here if it helps).
I've been stuck trying to get an index value to use with representative data for a particular…

Zach Rieck
- 419
- 1
- 4
- 23
3
votes
2 answers
How can a GRIB file be opened with pygrib without first downloading the file?
The documentation for pygrib shows a function called fromstring which creates a gribmessage instance from a python bytes object representing a binary grib message. I might be misunderstanding the purpose of this function, but it leads me to believe…

FlippingBinary
- 1,357
- 10
- 21
3
votes
2 answers
How to retrieve from lat, lon value using pygrib
I'm starting in python programming and I would like to make a small script which displays the data of "Local temperature diagnosed at 2m height above the relief", "Zonal component of the west-east horizontal wind diagnosed at 10 m height" and the…

sebastian
- 31
- 1
- 3
3
votes
2 answers
How to fix : collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I tried to install a pygrib package. in python 2.
I install all required package. (https://jswhit.github.io/pygrib/docs/pygrib-module.html)
I command pip installs pygrib. but it has an error.
I can't find an error in the error script. there are…

POEY
- 73
- 1
- 4
3
votes
2 answers
Unable to import pygrib on python3 (Mac)
I've installed pygrib by using conda install -c conda-forge pygrib and no issues were raised. However, when importing it in order to use it I get this message:
ImportError:…

Andrea
- 31
- 4
2
votes
1 answer
how to use pygrib expand_reduce functionality?
I am using pygrib to open GFS data, I want the data to be in unstructured format (not the default option). in short, How can I set expand_reduce to False?
grbs = pygrib.open(filename)
print(grbs[1].expand_reduce) # this prints True (default)
In the…

Lorenzo Donadio
- 66
- 6
2
votes
1 answer
Writing interpolated grib2 data with pygrib leads to unusable grib file
I'm trying to use pygrib to read data from a grib2 file, interpolate it using python, and write it to another file. I've tried both pygrib and eccodes and both produce the same problem. The output file size increased by a factor of 3, but when I try…

Mark Loeffelbein
- 21
- 1
2
votes
1 answer
Installing "pygrib" package on Windows: problem with "Python.h" file
I'm trying to install the pygrib package using the "Thonny IDE" tool to manage packages but I got this Error:
Collecting pygrib
Downloading
https://files.pythonhosted.org/packages/a1/b3/04bd9b0e9f19ca7195e33975da7004602b…

Marco Tela
- 21
- 6
2
votes
2 answers
How WRF Lambert Conformal Conic Convert To Latitude/Longitude Plot Offset
I try to convert Lambert conformal coordinates to lat/lon (WGS84) and I have used wgrib2, but the result is biased.
Command:
wgrib2 "mypath" -match "10m...." -new_grid_winds grid -new_grid_interpolation neighbor -new_grid latlon 108:129:0.25…

Frank Liao
- 855
- 1
- 8
- 25
2
votes
1 answer
Install pygrip and conda forge
I am trying to install pygrib to extract some data from grib1 files. I found this: Installing pygrib Package answer that recommended using conda-forge. Which I didn't know existed. Anyway, I made a new environment and used the conda install -c…

Mason Caiby
- 1,846
- 6
- 17
1
vote
1 answer
Recent Pygrib fail to retrieve ecmwf grib2 data within latitude and longitude
Previously I had no problem to retrieve rainfall data from real-time forecast ecmwf using this command;
1 import pygrib
2 import numpy as np
3
4 source='./10-Download-ECMWF/'
5 grbs = pygrib.open(source+'10-data.grib2')
6 grb2 =…

Azam
- 165
- 14
1
vote
0 answers
Most efficient way to insert large amount of data (230M entries) in pyspark table
What is the most efficient way to insert large amounts of data that is generated in a python script?
I am retrieving .grib files about weather parameters from several sources. These grib files consist of grid-based data (1201x2400x80), which results…

DetailWeb
- 11
- 3
1
vote
0 answers
ECCODES build on Windows 11 fails on Generate step
I'm trying to build ECCODES C package (https://confluence.ecmwf.int/display/ECC/ecCodes+installation) on Windows 11 for further usage with python pygrib library also on Windows 11.
What I did:
create dir structure: C:\tmp\eccodes\build…

acep
- 11
- 2