r - 如何将旋转的 NetCDF 转换回正常的纬度/经度网格?

标签 r rotation coordinates netcdf cdo-climate

我有一个带有旋转坐标的 NetCDF 文件。我需要将其转换为正常的纬度/经度坐标(经度为-180到180,纬度为-90到90)。

library(ncdf4)
nc_open('dat.nf')

对于尺寸,它显示:

[1] "     5 variables (excluding dimension variables):"
[1] "        double time_bnds[bnds,time]   "
[1] "        double lon[rlon,rlat]   "
[1] "            long_name: longitude"
[1] "            units: degrees_east"
[1] "        double lat[rlon,rlat]   "
[1] "            long_name: latitude"
[1] "            units: degrees_north"
[1] "        char rotated_pole[]   "
[1] "            grid_mapping_name: rotated_latitude_longitude"
[1] "            grid_north_pole_longitude: 83"
[1] "            grid_north_pole_latitude: 42.5"
[1] "        float tasmax[rlon,rlat,time]   "
[1] "            long_name: Daily Maximum Near-Surface Air Temperature"
[1] "            standard_name: air_temperature"
[1] "            units: K"
[1] "            cell_methods: time:maximum within days time:mean over days"
[1] "            coordinates: lon lat"
[1] "            grid_mapping: rotated_pole"
[1] "            _FillValue: 1.00000002004088e+20"

[1] "     4 dimensions:"
[1] "        rlon  Size:310"
[1] "            long_name: longitude in rotated pole grid"
[1] "            units: degrees"
[1] "            axis: X"
[1] "            standard_name: grid_longitude"
[1] "        rlat  Size:260"
[1] "            long_name: latitude in rotated pole grid"
[1] "            units: degrees"
[1] "            axis: Y"
[1] "            standard_name: grid_latitude"
[1] "        bnds  Size:2"

有人可以告诉我如何将旋转坐标转换回正常的纬度/经度吗?谢谢。

最佳答案

NCO 的 ncks 可能可以使用 MSA 通过两个命令来完成此操作

ncks -O -H --msa -d Lon,0.,180. -d Lon,-180.,-1.0 in.nc out.nc ncap2 -O -s 'where(Lon < 0) Lon=Lon+360' out.nc out.nc

关于r - 如何将旋转的 NetCDF 转换回正常的纬度/经度网格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31549880/

相关文章:

R,数据表 : find all combinations of a list excluding each element paired with itself

CSS 旋转在 IE 中不起作用

c++ - GLM - 四元数和旋转

python - 如何从图像上具有不同值的不同像素的坐标数据框创建热图

r - ggplot 中的等值线图,带有孔的多边形

r - 有没有办法转换 data.table 以便唯一的行元素成为列名称,然后显示元素计数?

r - 在ggplot中一起显示相似的条

javascript - 在 html5 Canvas 中用鼠标旋转图像

python - 找到xy坐标的边界点

r - 给定一个 (x,y) 对,如何选择最接近的 (x,y)_i 对 - R