我创建了一个多变量ncdf,并希望为每个变量添加额外的数据。 lat和long维度将保持不变,但我想通过向每个变量追加新数据来扩展时间维度。新数据集具有相同数量的变量dim1和dim2,但其dim3从第一个数据集的dim3结束时开始。 现有的ncdf(有42个变量): 这是启动代码:
library(ncdf4)
dim1 = ncdim_def("lat")
dim2 = ncdim_def( "long")
dim3 = ncdim_def( "time", "days since 2004-01-01", as.integer(time))
Var<-c("a","b","c","d",.....) # variables of existing "merged.nc" file
unit<-c("aa","ab","ac","ad",...)
mat<-(n by m data matrix)
mync = nc_open('merged.nc', write=TRUE)
for (k in 2:length(var)){
ncvar_put(mync,var[k],mat[,k])
}
nc_close(mync)
答案 0 :(得分:1)
您可以尝试NCO的ncrcat
ncrcat in1.nc in2.nc out.nc
答案 1 :(得分:1)
您可以使用
及时合并MYAPPLICATION.DisplayNames = function () {
var stringsOnly = MYAPPLICATION.Names.filter(function(item) {
return typeof item === 'string';
});
document.getElementById("content").innerHTML = stringsOnly.join('<br>');
}