Efficient GRIB1 data reader

efficient grib data reader

Vous suivez désormais cette soumission

A MATLAB reader for GRIB1 data has been developed based on wgrib1.c (ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/wgrib.c), which has been wrapped in a MATLAB mexFunction. Using the reader, you can read GRIB1 data directly in MATLAB. I have tested it with the NLDAS-2 forcing data. It is much faster than all “MATLAB GRIB’ toolboxes/scripts I found from internet. The reader only for GRIB1 data. If you want, you can cook one for GRIB2 similarly.
You are welcome to use/test it. If there is any problem on the MATLAB side, I will be happy to help. The following is a simple instruction:
Compile the code: mex readGRIB1.c within matlab, you get “readGRIB1.mexa64” if you work on a 64-bit linux system.
Make a symbolic link of readGRIB1.mexa64 or copy it to your working directory

You may call readGRIB1 in you matlab code/command line window like the following line:

[data, nx, ny]=readGRIB1('2014102309.nldasforce-b.grb',2);

in which, “2” is the record number of the GRIB variable. What you need to do is just to figure out the record number of your variable in GRIB file.
Have fun!

Citation pour cette source

Shugong Wang (2026). Efficient GRIB1 data reader (https://fr.mathworks.com/matlabcentral/fileexchange/53705-efficient-grib1-data-reader), MATLAB Central File Exchange. Extrait(e) le .

Catégories

En savoir plus sur Data Import and Analysis dans Help Center et MATLAB Answers

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.0.0.0

email update

A memory leak has been fixed.