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?
import netCDF4
url='http://nomads.ncep.noaa.gov:9090/dods/rtofs/rtofs_global20140303/rtofs_glo_2ds_forecast_daily_prog'
nc = netCDF4.Dataset(url)
ncv = nc.variables
Try just reading a few values of longitude
ncv['lon'][:10]
array([ 74.16 , 74.24333, 74.32666, 74.40999, 74.49332, 74.57665, 74.65998, 74.74331, 74.82664, 74.90997])
Now try reading the u_velocity variable with stride
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)
(34, 34) (34, 34)
Seems to work fine. Why doesn't NCO work?