Hi, is there a matlab function to read .grib2 files (these are files similar to netcdf but Matlab nclibraries cant seem to be able to read them) thank you
16 ビュー (過去 30 日間)
古いコメントを表示
Hi, I need to read .grib2 files fast. I m currently using a java toolbox (njvarget) to read them but it takes a lot of time as the files are many. Is there a way to read them faster (changing function or reformatting them?)? thank you
0 件のコメント
採用された回答
Jacob Halbrooks
2024 年 9 月 25 日
As of R2023b, you can read data from a GRIB file (.grb, .grib, .grib2) using the Mapping Toolbox readgeoraster function. You can also get information about a GRIB file by using the georasterinfo function. These functions were enhanced in R2024b to support GRIB files that use CCSDS compression.
2 件のコメント
Thomas Karl
2025 年 1 月 18 日 13:07
編集済み: Walter Roberson
2025 年 1 月 18 日 18:32
I am able to import grib2 files for weather data from a couple of providers such as DWD and also for older grib2 files from MeteoFrance, however newer MeteoFrance grib2 products ( https://meteo.data.gouv.fr/datasets/65bd1247a6238f16e864fa80 ) can neither be read by readgeoraster nor by the opensource nctoolbox
Not sure if somebody has looked at this and whether grib2 now comes in different subformats
Below an example (I have tried at least 10 different grib2 files from Meteofrance - it does not seem to be a problem for one specific file)
meteofrance='C:\0thomas\arome_local\aws\arome__0025__SP1__13H18H__2025-01-18T09_00_00Z.grib2'
names=meteofrance;
info = georasterinfo(names);
metadata = info.Metadata
numBands = info.NumBands % how many data fields?
->>>
Error using georasterinfo
Unable to read
'arome__0025__SP1__13H18H__2025-01-18T09_00_00Z.grib2'.
Format might not be supported, file might be
corrupt, or a supporting file might have been
specified.
Jacob Halbrooks
2025 年 1 月 22 日 13:24
This might be due to the GRIB file being compressed, in which case an enhancement in R2024b may enable you to read the file into MATLAB. In particular, see the "Raster Import: Read data from compressed GRIB files" release note in Mapping Toolbox R2024b here.
その他の回答 (1 件)
Marius
2017 年 10 月 25 日
Hi Thalia,
If you just want to read grb2 files. You may want to check out nctoolbox (https://github.com/nctoolbox/nctoolbox/).
You find some documentation here (https://github.com/nctoolbox/nctoolbox/wiki).
It is not explicitly fast. Although at least I did not make the experince that pygrib or the netCDF-Java API are significantly faster.
A word of warning: It does not work out of a Proxy network. Best of luck.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!