NCO cropping a netcdf file using dimension values rather than indices

自古美人都是妖i 提交于 2020-01-01 19:20:32

问题


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:


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 


来源:https://stackoverflow.com/questions/48447306/nco-cropping-a-netcdf-file-using-dimension-values-rather-than-indices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!