What is the best way to open GRIB files in Matlab R2021a
古いコメントを表示
Hello,
I need to use weather data from NOAA in my simulations. I am currently using the NetCDF data and they are very large (>6 G) for 1 hour worth of data. Thus making it computationally expensive to read the data, expecially when one need to run the simulation with 1 week worth of weather data.
The best option is to use the weather data with the GRIB format.
I have searched the internet with little success on how to read GRIB files in MATLAB. The viable option is https://github.com/nctoolbox/nctoolbox/wiki . However, nctoolbox does not support newer versions of MATLAB: https://github.com/nctoolbox/nctoolbox/issues/128.
Please, what is the best way to analyze GRIB data files in newer versions for MATLAB. i.e. R2021a.
Thank you for your help.
採用された回答
その他の回答 (2 件)
Peter
2022 年 6 月 22 日
2 投票
I run nctoolbox just fine on the latest versions of MATLAB (R2020 onwards). In some cases, you might need to disable the version of protobuf3.jar shipped with matlab and therefore have matlab use the native version of this java library with the OS. To do this, I found merely renaming $MATLABROOT/java/jarext/protobuf3.jar to something like protobuf3.jar.save works with no secondary consequences that I found.
However, I think starting with R2021b, this may not even be necessary anymore and nctoolbox works straight out of the box, at least for me. I think this is because MATLAB stopped shipping a copy of protobuf3.jar with its distribution.
1 件のコメント
Ashwin Gadgil
2022 年 8 月 5 日
Peter, Thank you. Your rsuggestion worked. And the whole bunch of other java errors I was getting have disappeared.
However it still shows up this message "2022-08-05 10:01:30,513 [main] WARN ucar.nc2.grib.grib2.Grib2Index - Grib2Index bad size = -1 for test.grb2 index = test.grb2.gbx9"
Is this something to be concerned about?
Sivani Pentapati
2021 年 9 月 30 日
0 投票
Please refer to the below File Exchange link for GRIB file reader
4 件のコメント
Brian Dzwonkowski
2022 年 7 月 1 日
I found the instructions with the reader to be difficult to understand. Having not been successful in figure out how to get this package to install properly... Seems like that should be an easily way to get .grb2 files into matlab?
Isabelle Gouirand
2022 年 11 月 22 日
hi i have the same issue. i download the toolbox and cannot find a way to open the data.
i am not sure to understand what it is about. If the data are downloaded already (without the API) from ECWMF copernicus. how do we open them?
i have no isse with .nc file.
Is there an existing function to open .grid file?
Kurt
2024 年 3 月 25 日
Matlab-CDI is older than dirt (it was last updated in 2014), and is unlikely to work with newer versions of Matlab. In addition, the installation is complicated, involving the compilation of MEX files and installation of NetCDF libraries. I don't know if it even works with the newer GRIB2 format.
Kurt
2024 年 3 月 25 日
Good news: as of 2023b, Matlab supports GRIB2 files:
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!