我有一个从这里获取的netCDF文件,名为precip.mon.total.v6.nc。我正在使用R中的ncdf
包来打开和分析该文件。
new <- open.ncdf("precip.mon.total.v6.nc")
> new
[1] "file precip.mon.total.v6.nc has 4 dimensions:"
[1] "lat Size: 360"
[1] "lon Size: 720"
[1] "nbnds Size: 2"
[1] "time Size: 1320"
[1] "------------------------"
[1] "file precip.mon.total.v6.nc has 1 variables:"
[1] "float precip[lon,lat,time] Longname:GPCC Monthly total of precipitation Missval:-9.96920996838687e+36"
但是当我提取变量时,出现了错误。
> get.var.ncdf(new, "precip")
Error: cannot allocate vector of size 2.5 Gb
In addition: Warning messages:
1: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
2: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
3: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
4: In double(totvarsize) :
Reached total allocation of 2047Mb: see help(memory.size)
我有以下问题: (a) 如何处理内存问题? (b) 我如何将这个netCDF文件的分辨率从0.5*0.5更改为0.25*0.25数据?我已经在MATLAB中尝试了类似的问题。它可以比R更好地处理netCDF文件的内存问题。但是,由于我不擅长MATLAB,所以改变分辨率仍然是一个问题。如果您能提供任何帮助,我将非常感激。