r - 如何在 R 中处理 netCDF 数据,以便从月度数据中找到年平均温度?
问题描述
我正在尝试处理一些气候数据。我有一个 .nc 文件,其中包含从 01-850 到 12-1049 的每个月的纬度、经度、时间和表面温度的数据。我需要将这些月度数据转换为年度数据,并找到每个纬度、经度的年平均温度。
ncin <- nc_open("tas_Amon_MIROC-ES2L_past1000_r1i1p1f2_gn_085001-104912.nc")
lon <- ncvar_get(ncin,"lon")
lon <- ifelse(lon > 180, -(360 - lon), lon)
lat <- ncvar_get(ncin, "lat")
time <- format(as.Date(time, origin = ("850-1-1"), tz = "UTC"),"%Y-%m" )
tas.array <- ncvar_get(ncin,"tas")
tas.array <- tas.array - 273.15
解决方案
推荐阅读
- javascript - 如何在html文件中使用函数调用
- javascript - 如何计算不同日期的 24 小时格式的两个时间之间的差异?
- c - 如何找到正确的括号顺序?
- css - 在 iFrame 中的内容上应用 CSS
- c# - ICommandHandler 未针对 SaveCommandArgs 执行(Visual Studio for Mac 扩展)
- localhost - 如何列出在不同端口上运行的所有进程/服务
- scala - Breeze - DenseVector 的比较给了我一个 BitVector - 这是故意的吗?
- php - Ubuntu 18.04:laravel/framework v6.9.0 需要 ext-mbstring * -> 系统中缺少请求的 PHP 扩展 mbstring
- angular - Reactive Form Validators.required 自定义控件
- kotlin - Kotlin 嵌套 Recyclerview