Reading GRiB2 files with Matlab [closed]

女生的网名这么多〃 提交于 2019-12-29 07:19:21

问题


Are there any toolboxes, which allow reading GRIB2 data into Matlab?

An example (waves modeled by NOAA) could be GRIB2 available from ftp://polar.ncep.noaa.gov/pub/history/waves


回答1:


In NCTOOLBOX for Matlab, you can open a GRIB2 file just like a local NetCDF file or a remote OPeNDAP dataset:

% download data
! wget ftp://polar.ncep.noaa.gov/pub/history/waves/multi_1.at_4m.dp.200607.grb2

% create ncgeodataset object
nc=ncgeodataset('multi_1.at_4m.dp.200607.grb2');

% list variables
nc.variables

% create geovariable object
dirvar=nc.geovariable('Primary_wave_direction_degree_true_surface');

% get data at 1st time step
dir=dirvar.data(1,:,:);

% get grid at 1st time step
g=dirvar.grid_interop(1,:,:);

% plot
pcolorjw(g.lon,g.lat,dir);
title(datestr(g.time))



来源:https://stackoverflow.com/questions/16158222/reading-grib2-files-with-matlab

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!