Trying to figure out why this NCO ncks stride command doesn't work:
ncks -O -D4 -d time,1 -d lev,0 -d lat,0,100,3 -d lon,0,100,3 -v u_velocity,v_velocity \
http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global20140303/rtofs_glo_2ds_forecast_daily_prog foo.nc
Does it work with netCDF4-Python, which also uses the NetCDF-C library?
In [1]:
import netCDF4
In [2]:
url='http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global20140303/rtofs_glo_2ds_forecast_daily_prog'
In [3]:
nc = netCDF4.Dataset(url)
In [4]:
ncv = nc.variables
Try just reading a few values of longitude
In [5]:
ncv['lon'][:10]
Out[5]:
Now try reading the u_velocity variable with stride
In [6]:
u = ncv['u_velocity'][0,0,0:100:3,0:100:3]
v = ncv['v_velocity'][0,0,0:100:3,0:100:3]
print shape(u)
print shape(v)
Seems to work fine. Why doesn't NCO work?
In [6]: