我是初学者,nco
我希望能对我的工作流程提供一些建议,并为我遇到的问题提供一些帮助。
我有这些数据,其中包含两个不同时间步长的 3D 盐度值:
dimensions:
t = 780 ;
z = 54 ;
y = 450 ;
x = 3600 ;
variables:
double time(t) ;
time:units = "days since 1-1-1 00:00:0.0" ;
float level(z) ;
level:units = "[m]" ;
float lat(y) ;
float lon(x) ;
float salt(x, y, z) ;
salt:units = "psu * 1000 + 35" ;
salt:missingvalue = "-1.0E34" ;
salt:longname = "salinity" ;
我想连接两个 netcdf 文件。
为此,我首先使用ncecat *.nc -O merged.nc
:
dimensions:
record = UNLIMITED ; // (2 currently)
t = 780 ;
z = 54 ;
y = 450 ;
x = 3600 ;
variables:
double time(record, t) ;
time:units = "days since 1-1-1 00:00:0.0" ;
float level(record, z) ;
level:units = "[m]" ;
float lat(record, y) ;
float lon(record, x) ;
float salt(record, x, y, z) ;
salt:units = "psu * 1000 + 35" ;
salt:missingvalue = "-1.0E34" ;
salt:longname = "salinity" ;
现在变量time
和维度t
是虚假的。所以,我删除它们ncks -O -x -v time merged.nc merged.nc
:
record = UNLIMITED ; // (2 currently)
y = 450 ;
z = 54 ;
x = 3600 ;
variables:
float lat(record, y) ;
float level(record, z) ;
level:units = "[m]" ;
float lon(record, x) ;
float salt(record, x, y, z) ;
salt:units = "psu * 1000 + 35" ;
salt:missingvalue = "-1.0E34" ;
salt:longname = "salinity" ;
现在,我想record
用:重命名维度ncrename -d record,time merged.nc
。该命令运行时没有错误或警告。但是当我这样做时,ncdump -h merged.nc
我得到了这个错误:
ncdump:merged.nc:NetCDF:HDF错误
这是什么意思?我哪里做错了?
编辑
遵循查理·赞德( Charlie Zender )发布的答案
ncecat -O -u time *.nc merged.nc
ncks -O -x -v time merged.nc merged.nc
导致:
dimensions:
time = UNLIMITED ; // (2 currently)
y = 450 ;
z = 54 ;
x = 3600 ;
t = 780 ;
variables:
float lat(time, y) ;
float level(time, z) ;
level:units = "[m]" ;
float lon(time, x) ;
float salt(time, x, y, z) ;
salt:units = "psu * 1000 + 35" ;
salt:missingvalue = "-1.0E34" ;
salt:longname = "salinity" ;
double time(time, t) ;
time:units = "days since 1-1-1 00:00:0.0" ;
// global attributes:
:history = "Tue Jun 5 09:08:25 2018: ncks -O -x -v time merged.nc merged.nc\nTue Jun 5 09:08:19 2018: ncecat -O -u time OFES_salt_mmean_607.nc OFES_salt_mmean_608.nc merged.nc" ;
:NCO = "netCDF Operators version 4.7.4 (http://nco.sf.net)" ;
:nco_openmp_thread_number = 1 ;