NCO cropping a netcdf file using dimension values

2019-04-13 22:59发布

CDO can crop a netcdf file in terms of latitude and longitude as long as they are defined in a standard way, and I know that NCO can cut out a subset of a netcdf file along any dimension if you know the range of indices that you want, as stated in the answers to this related question:

Is there a way to crop a NETCDF file?

However, I was wondering if the ncks hyperslabber can work directly on the values of the dimension, rather than the index values?

1条回答
Root(大扎)
2楼-- · 2019-04-13 23:47

Yes, using a decimal indicates the range of actual values (eg, latitudes) to extract over, while using integers indicates the range of indices corresponding to the values.

For instance, to extract across latitudes 30.0 - 40.0 degrees N:

ncks -d lat,30.,40. file.nc -O cropped_file.nc 
查看更多
登录 后发表回答