【发布时间】:2018-01-15 15:38:13
【问题描述】:
我有一个 NetCDF 文件,这里是 ncdump -h 的截断输出:
dimensions:
lat = 720 ;
lon = 1440 ;
cft = 64 ;
natpft = 14 ;
double PCT_CFT(cft, lat, lon) ;
PCT_CFT:long_name = "percent cft" ;
PCT_CFT:units = "unitless" ;
PCT_CFT:_FillValue = -9999. ;
PCT_CFT:coordinates = "LON LAT" ;
double PCT_NAT_PFT(natpft, lat, lon) ;
PCT_NAT_PFT:long_name = "percent pft" ;
PCT_NAT_PFT:units = "unitless" ;
PCT_NAT_PFT:_FillValue = -9999. ;
PCT_NAT_PFT:coordinates = "LON LAT" ;
我需要的是从变量PCT_CFT 沿维度cft 的第3、4、61 和62 层提取和求和值,然后将几乎所有剩余层(即5-60, 63, 64) 并将这两个结果添加到变量PCT_NAT_PFT 中,分别作为沿维度natpft 的第16 层和第15 层。
如果可能,我想使用 NCO(或 CDO)来实现这一点,我想避免使用 Python 或 R 等其他工具...我只知道如何在整个维度上对变量求和,而不是跨选定层求和仅 - 因此我可能可以解决这个问题,但我想知道是否有更好、更清洁的方法。
【问题讨论】:
-
您能否添加指向示例文件的链接,以便我们测试我们的潜在解决方案?
标签: extract netcdf nco cdo-climate