从全局温度的netcdf文件绘制范围时出错

时间:2019-11-27 13:06:13

标签: r raster netcdf

我已经设法从https://www.nodc.noaa.gov/cgi-bin/OC5/woa18/woa18.pl

下载并绘制了年度海洋温度数据
temp_WOCE <- nc_open("woa18_decav_t00_01.nc")
lon <- ncvar_get(temp_WOCE, varid = "lon")
lat <- ncvar_get(temp_WOCE, varid = "lat")
temp <- ncvar_get(temp_WOCE, "t_an")
depth <- ncvar_get(temp_WOCE, "depth")

共有102个深度剖面(范围为0-5500m)。我希望能够

  1. 通过经度和深度的平均纬度绘制温度范围。 Similar to Figure 1 from this paper

enter image description here

  1. 通过纬度带(例如-60至90,-40至-60,-20至-40等)按深度绘制温度范围

我可以绘制温度,但是它给了我多个关于温度的全局图像(不是我所需要的)

plot(temp)

但是我需要按纬度绘制温度。为什么这会给我一个错误

plot(temp~lat) 
Error in (function (formula, data = NULL, subset = NULL, na.action = na.fail,  : object is not a matrix

plot(temp~depth)
Error in eval(predvars, data, env) : object 'depth' not found

0 个答案:

没有答案