- 积分
- 104
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-8-1
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2017-8-2 10:00:35
|
显示全部楼层
实在不好意思,我是做船舶的,需要查看一下某地地方的海浪情况,在这方面确实不是太懂。
之前也搜索了本站的相关帖子,跟着做也没有做出来,所以又发了个帖子。
我在NOAA上下了一个grib2文件,文件D盘,D:\grib2\HTSGW_00.t00z.grib2,我想用Matlab读取里面的数据,因为直接打开是乱码。(也想用本站里面推荐的其他软件打开,但是都不好下载,所以就用matlab了)
nctoolbox是在网上下载的,大概15M左右,解压放到了D盘grib2文件夹下。
然后启用matlab
输入setup_nctoolbox
nc = ncgeodataset('D:\grib2\HTSGW_00.t00z.grib2')
就出现以下问题:
>> setup_nctoolbox
NCTOOLBOX added to Matlab path
>> nc = ncgeodataset('D:\grib2\HTSGW_00.t00z.grib2')
2017-08-02 09:59:14,897 [main] WARN ucar.nc2.grib.grib2.Grib2Index - Grib2Index bad size = -1 for D:/grib2/HTSGW_00.t00z.grib2 index = D:\grib2\HTSGW_00.t00z.grib2.gbx9
2017-08-02 09:59:14,897 [main] WARN ucar.nc2.grib.grib2.Grib2Index - Grib2Index bad size = -1 for D:/grib2/HTSGW_00.t00z.grib2 index = D:\grib2\HTSGW_00.t00z.grib2.gbx9
Warning: Escape sequence 'g' is not valid. See 'help sprintf' for valid escape sequences.
> In ncdataset>ncdataset.ncdataset at 95
In cfdataset>cfdataset.cfdataset at 59
In ncgeodataset>ncgeodataset.ncgeodataset at 74
Error using ncdataset (line 97)
Failed to open D:
Error in cfdataset (line 59)
obj = obj@ncdataset(url);
Error in ncgeodataset (line 74)
obj = obj@cfdataset(url);
Caused by:
Error using ncdataset (line 81)
Java exception occurred:
java.lang.RuntimeException: java.lang.NoSuchFieldError: alwaysUseFieldBuilders
at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1535)
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:887)
at ucar.nc2.NetcdfFile.open(NetcdfFile.java:496)
at ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:693)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:424)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:407)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:392)
at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:379)
Caused by: java.lang.NoSuchFieldError: alwaysUseFieldBuilders
at
ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index.access$5400(Grib2IndexProto.java:2635)
at
ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.maybeForceBuilderInitialization(Grib2IndexProto.java:2914)
at
ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.<init>(Grib2IndexProto.java:2906)
at
ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.create(Grib2IndexProto.java:2920)
at
ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index$Builder.access$5200(Grib2IndexProto.java:2891)
at
ucar.nc2.grib.grib2.Grib2IndexProto$Grib2Index.newBuilder(Grib2IndexProto.java:2878)
at ucar.nc2.grib.grib2.Grib2Index.makeIndex(Grib2Index.java:231)
at ucar.nc2.grib.GribIndex.makeGribCollectionFromSingleFile(GribIndex.java:112)
at ucar.nc2.grib.grib2.Grib2Iosp.open(Grib2Iosp.java:310)
at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1499)
... 7 more
确实在这方面接触很少,所以遇到问题也不知道该怎么解决。
希望你帮我看看问题出在哪里。代码我就按照你写的那个写了第一句就出现问题了。
再次谢谢你。
|
|