是否有任何工具箱,允许将GRIB2数据读入Matlab?
一个例子(由NOAA建模的波浪)可以是来自ftp://polar.ncep.noaa.gov/pub/history/waves的GRIB2.
在NCTOOLBOX for Matlab中,您可以像打开本地NetCDF文件或远程OPeNDAP数据集一样打开GRIB2文件:
% 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))
Run Code Online (Sandbox Code Playgroud)
