首先输入cdo griddes查看文件分辨率
cdo griddes 1.nc
#
# gridID 1
#
gridtype = lonlat
gridsize = 200901
datatype = float
xsize = 501
ysize = 401
xname = longitude
xlongname = “longitude”
xunits = “degrees_east”
yname = latitude
ylongname = “latitude”
yunits = “degrees_north”
xfirst = 70
xinc = 0.1
yfirst = 40
yinc = -0.1
文件本来为0.1✖0.1的分辨率,现在我们把他插值为0.5✖0.5的分辨率,需要准备一个TXT文件,放在你要插值的文件同一个目录下,复制以下文字。
gridtype = lonlat
gridsize = 8000
datatype = float
xsize = 100
ysize = 80
xname = longitude
xlongname = “longitude”
xunits = “degrees_east”
yname = latitude
ylongname = “latitude”
yunits = “degrees_north”
xfirst = 70
xinc = 0.5
yfirst = 40
yinc = -0.5
gridsize:插值后的栅格数量,0.1*0.1分辨率下为200901个栅格,Xsize和Ysize分别为501和401,差值为0.5*0.5的分辨率后X和Y行分别扩大5倍,所以插值后的Xsize=100,Ysize为80.
所以插值后的gridsize为8000.
Xfist和Yfirst要对应插值前的NC文件
保存txt文件在这个目录下,假如命名为1.txt,打开unbuntu,进入此目录输入:
cdo remapbil,1.txt 插值前的文件.nc 插值后的文件.nc
然后输入cdo griddes 插值后的文件.nc,发现插值完毕:
#
# gridID 1
#
gridtype = lonlat
gridsize = 8000
datatype = float
xsize = 100
ysize = 80
xname = longitude
xlongname = “longitude”
xunits = “degrees_east”
yname = latitude
ylongname = “latitude”
yunits = “degrees_north”
xfirst = 70
xinc = 0.5
yfirst = 40
yinc = -0.5