【发布时间】:2015-11-17 22:43:52
【问题描述】:
我从here 获得名为 precip.mon.total.v6.nc 的 netCDF 文件。我在 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 中尝试过类似的问题。对于 netCDF 文件,它可以比 R 更好地解决内存问题。但是改变分辨率仍然是一个问题,因为我不擅长 MATLAB。我将非常感谢这方面的任何帮助。
【问题讨论】:
-
你的 b 部分是一个非常大的开放式问题。您需要查看缩小比例,一个常见的选项是使用延迟率 - 为此,您需要一个您希望缩小到的分辨率的高程网格。
标签: r gis netcdf cdo-climate