从R中的netcdf文件中提取复杂变量

时间:2019-04-19 20:44:18

标签: r netcdf4

我正在尝试为netcdf文件的每个单元格提取温度保持在给定水平(“临时”对象中为35至49之间)时的最大时间长度。文件链接为herehere有变量名的完整说明。

我只设法导入文件并检索了一些变量,但是当涉及到基于单元格和温度水平的提取时,我完全迷失了。

打开NetCDF文件

require(ncdf4)
ncfname <- "us_output.nc"
ncin <- nc_open(ncfname)
print(ncin)
str(ncin)
names(ncin$var)

获取变量

 lon <- ncvar_get(ncin,"lon")
 lat <- ncvar_get(ncin,"lat")
 temp <- ncvar_get(ncin,"temperatures")
 time <- ncvar_get(ncin,"max_number_of_hours_above_a_temperature")

非常感谢! 阿格斯

0 个答案:

没有答案