从NetCDF的Thredds Catalouge更改数据源



嗨,我在这里使用此代码如何读取netcdf文件并使用python写入CSV,我希望能够从此处删除" cane_period_swell_swell_waves_waves_waves_waves_ordered_secorence_of_of_data"收回以下错误。我正在使用树冠

有什么想法?谢谢Alec

IndexErrorTraceback (most recent call last)
/home/GRIB-extract-SWPER.py in <module>()
     73 #vname = 'surf_el'
     74 var = nc.variables[vname]
---> 75 hs = var[istart:istop,iy,ix]
     76 tim = dtime[istart:istop]
     77 
netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.__getitem__ (netCDF4/_netCDF4.c:39739)()
netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable._get (netCDF4/_netCDF4.c:49789)()
IndexError: 

通过更改

修复
var = nc.variables[vname]
hs = var[istart:istop,iy,ix]
tim = dtime[istart:istop]

to

var = nc.variables[vname]
tp = var[istart:istop,iy,ix]
tim = dtime[istart:istop]

相关内容

  • 没有找到相关文章

最新更新