copy_VarAtts(var, data) ; 将var的属性复制data
copy_VarCoords(var, data) ; 将var的坐标复制
res@pmTickMarkDisplayMode =“Always”坐标标签上添加“度”符号
NoCreate为不创建刻度,Never创建但不显示刻度,Always总是显示,Conditional在不覆盖已有图像的坐标前提下会显示
opt = True
opt@gsnShadeFillType = "pattern"
opt@gsnShadeHigh = 17;大于范围打点
opt@gsnShadeLow = 17 ;小于范围打点
plot = gsn_contour_shade(plot1,-0.4,0.4,opt);大于0.4 小于-0.4 范围内打点
res@gsnYRefLine=(/-0.5,0,0.5/);画辅助线
res@gsnYRefLineDashPatterns =(/14,0,14/);定义辅助线实线、虚线
res@gsnYRefLineThicknesses =(/2,3,2/);
res@cnLevelSelectionMode ="ExplicitLevels";自定义
res@cnLevels=(/-0.8,-0.6,-0.4,-0.2,-0.1,0,0.1,0.2,0.4,0.6,0.8/)
NCL中计算相关系数的函数有好几个,常用的为escorc系列和regCoef系列。
escorc(x,y)是计算两个数组最右侧一列的相关系数。如果想指定计算的列数,比如想计算x(lat,lon)和y(lat,lon,year)在lat这一列上的相关系数,就要用到escorc_n: escorc_n(x,y,0)。
相关系数的检验方法包括t检验、f检验和显著性检验,分别为ttest,ftest,rtest。
regCoef系列的命令比escorc强大很多,因为它除了返回相关系数rc,还捎带手把两个序列的标准差(rc@rstd)和t检验结果(rc@tval)都给算了。
time =f1->time
time=cd_calendar(time,-1) ;时间格式
sst3 = sst1(12::12,0,:,:);以第12个数开始,间隔12输出
fstation = "stationdata.txt";txt有3列,不能有中文
data = readAsciiTable(fstation,3,"float",0);opt=1 ignore the first row
Lat = data(:,1)
Lat@long_name = "Latitude"
Lat@units = "degrees_north"
Lon = data(:,2)
Lon@long_name = "Longitude"
Lon@units = "degrees_east"