Questions tagged [pygrib]

Python module for reading and writing GRIB (editions 1 and 2) files. GRIB is the World Meterological Organization standard for distributing gridded data.

51 questions
0
votes
1 answer

How to make a GRIB2 file of a local parameter using wgrib2?

I'm making a GRIB2 file of a locally defined parameter (say, WNISI) using wgrib2. I followed the instruction below https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/user_grib2tables.html and make a local table…
0
votes
1 answer

type hinting, class inheritance and metaclass with a cython lib

I am using a cython lib called pygrib that doesn't have any associated type hinting. I would like to extend its features by wrapping, for example the pygrib.open method in some classes with relative type hints. pygrib.open returns an Iterator with…
Jason Leaver
  • 286
  • 2
  • 11
0
votes
1 answer

Install pygrib fails with grib_api.h No such file error

I'm installing pygrib library for Python 3.10.2 on Windows 10 and I get an error: pip3 install pygrib tall pygrib src/pygrib\_pygrib.c(697): fatal error C1083: Impossible d'ouvrir le fichier include: 'grib_api.h': No such file or directory …
Theo75
  • 477
  • 4
  • 14
0
votes
1 answer

Getting GRIB2 Lat/Lon Information from GDAL

I am attempting to plot fields from a GRIB2 file of GFS model data (example file: https://nomads.ncep.noaa.gov/pub/data/nccf/com/gfs/prod/gfs.20220202/12/atmos/gfs.t12z.pgrb2.0p25.f006 ). Normally I would just use PyGRIB and I'd have this problem…
0
votes
1 answer

Using XArray.isel to access data in GRIB2 file from a specific location?

I'm trying to access the data in a GRIB2 file at a specific longitude and latitude. I have been following along with this tutorial (https://www.youtube.com/watch?v=yLoudFv3hAY) approximately 2:52 but my GRIB file is formatted differently to the…
Isabella
  • 5
  • 4
0
votes
0 answers

Why can't I open my girb2 file using Pygrib?

I'm trying to open a grib2 file using pygrib but the error shows like this. Any help would be appreciated as I'm a new Python user In [2]: debugfile('E:/NASA2/untitled0.py', wdir='E:/NASA2') File "e:\nasa2\untitled0.py", line 12 grbs =…
0
votes
1 answer

ValueError: Could not convert tuple of form (dims, data[, attrs, encoding]): #ISSUE #GRIP2 #Weather-Data #cfgrib #xarrary #Python #

ValueError: Could not convert tuple of form (dims, data[, attrs, encoding]): I have a problem building this dataset and I couldn't know how to solve it, I try many solutions and it gives me the same error import cfgrib import glob import xarray as…
0
votes
0 answers

Python writte GRIB file

I want to sum two grib files. I am able to create the new variable (newfield), but I don't succeed to write it in a grb file. When I do "cdo sinfo newfile.grb", I get the message: " Unsupported file type" here is my code: grib_dif =…
user5276228
  • 187
  • 1
  • 3
  • 14
0
votes
0 answers

ImportError: libhdf5.so.101: cannot open shared object file: No such file or directory,

The problem occurred: ImportError: libhdf5.so.101: cannot open shared object file: No such file or directory,when I install pygrib on linux(centOS6) by Anaconda Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:53:06) [GCC 4.4.7…
LeeLon
  • 1
  • 1
0
votes
0 answers

How to iterate over directory of grib2 files with pygrib?

So I'm working on a research project where I have about 6500 HRRR .grib2 files in a directory and all I need to do is simply open each grib2 file and print the the messages into a .txt for later parsing of values. Dont worry, I have cut down the…
0
votes
1 answer

Finding Kwargs & Other Information About Python Packages

Hello StackOverflow Community, I am a beginner Python programmer who is transitioning over from MATLAB. One of my biggest struggles so far has been trying to understand how to find out more information about new Python packages that I install. Let…
mariandob
  • 15
  • 4
0
votes
1 answer

Issues taking in dictionary items with .values key "AttributeError: 'list' object has no attribute 'values' "

gribfile='gfs20191010.0p25' #file containing 384 hours of forecast data for variable Geopotential Height grbs=pygrib.open(gribfile) grb1=grbs.select(name='Geopotential Height')[0:24] day1 = grb1.values When I run the above code I get the following…
PLEH
  • 21
  • 5
0
votes
1 answer

Grid How To Convert Lambert Conformal To Latitude/Longitude

I have a grib data about WRF. The grid definition template number is 30 ( Lambert Conformal ) But now, I need to convert this lambert conformal to 0 ( Latitude/Longitude ) Is there possible?
Frank Liao
  • 855
  • 1
  • 8
  • 25
0
votes
0 answers

Why do I printing different values from an array to a grib file?

I am summing values of a list of grib files after a normalization. After this I overwrite the values on an existing grib file. data_sum = np.zeros((451, 900)) for grib_file in list_000: data = normalization(grib_file) data_sum = data_sum +…
Glori P.
  • 466
  • 1
  • 4
  • 14
0
votes
1 answer

I am having weather data in grib2 format and i want to convert it into json format Is it possible to conversion using node.js?

I am having weather data in grib2 format and i want to convert it into json format or csv. I know the languages PHP , node.js. Is it possible to conversion using these technologies?