NCL常用统计学函数怎么用
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,这篇文章主要介绍"NCL常用统计学函数怎么用",在日常操作中,相信很多人在NCL常用统计学函数怎么用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"NCL常用统计学函数怎
千家信息网最后更新 2026年11月02日NCL常用统计学函数怎么用NCL作为一门气象专业语言,自带了很多气象届常用的算法和命令, 比如计算相关系数、均方根误差等统计量,相关系数显著性检验,EOF,以及各种插值。这里将一些常用函数做了归纳:
1、相关系数 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)都给算了。
2、均方根误差 函数名为dim_rmsd。它是计算两个变量在所有其他维度上最右侧维度的均方根误差。而对于想要计算指定维度的情况,则要用dim_rmsd_n。
3、EOF分解 计算EOF分解的函数为eofunc开头的系列函数,一般用eofunc_Wrap计算空间模态,用eofunc_ts_Wrap计算时间系数。
以下为针对变量x计算EOF分解并绘图的NCL子程序:
这篇文章主要介绍"NCL常用统计学函数怎么用",在日常操作中,相信很多人在NCL常用统计学函数怎么用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"NCL常用统计学函数怎么用"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
undef("draw_eof_plot")procedure draw_eof_plot(dir_plot,file_plot,type_plot,x,year,neof)begin;--EOF analysisoptEof = Trueeof = eofunc_Wrap( x, neof, optEof)eof_ts = eofunc_ts_Wrap( x, eof, False)lat = x&latlon = x&lon;--Begin plotting section.wks = gsn_open_wks(type_plot,dir_plot+file_plot) ; Opens a ps filegsn_define_colormap(wks,"rainbow")plot = new(neof,graphic)res = True ; plot mods desired;************************************************; original data;************************************************res@gsnDraw = False ; don't draw yetres@gsnFrame = False ; don't advance frame yetres@gsnAddCyclic = False;--map plot resourcesres@mpFillOn = False ; no grey continentsres@mpCenterLonF = 180.res@mpDataBaseVersion = "MediumRes" ; or "Ncarg4_1"res@mpDataSetName="Earth..4"res@mpOutlineSpecifiers=(/"China:states","Taiwan"/)res@mpOutlineBoundarySets = "AllBoundaries"res@mpMinLatF = min(lat) ; range to zoom in onres@mpMaxLatF = max(lat)res@mpMinLonF = min(lon)res@mpMaxLonF = max(lon);--contour resourcesres@cnFillOn = True ; turn on contour fillres@cnLineLabelsOn = False ; turn off contourres@cnLinesOn = False ; add countor or not,True is defaultres@gsnLeftString = " "res@gsnRightString = " ";--tickmark resourcesres@tmXTOn = Falseres@tmYROn = Falseres@tmYLLabelFontHeightF =0.02res@tmXBLabelFontHeightF =0.018res@tmXTOn = Falseres@tmYROn = False;--labelbar resourcesres@lbLabelBarOn = Falseres@lbLabelFontHeightF = 0.02res@lbOrientation = "Vertical" ; vertical label barsymMinMaxPlt(eof, 16, False, res); contributed.ncl; panel plot only resourcesresP = True ; modify the panel plotresP@gsnMaximize = True ; large formatresP@gsnPanelLabelBar = True ; add common colorbarresP@txString = "EOF"do n=0,neof-1res@gsnLeftString = " EOF "+(n+1)res@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"plot(n) = gsn_csm_contour_map(wks,eof(n,:,:),res)end dogsn_panel(wks,plot,(/neof/1,2/),resP) ; draw all 'neof' as one plot;*******************************************; time series (principal component) plot;*******************************************eof_ts@long_name = "Amplitude"rts = Truerts@gsnDraw = False ; don't draw yetrts@gsnFrame = False ; don't advance frame yet; decide exactly where on the page to draw it.rts@vpHeightF = 0.40 ; Changes the aspect ratiorts@vpWidthF = 0.85rts@vpXF = 0.10 ; change start locationsrts@vpYF = 0.75 ; the plotrts@gsnYRefLine = 0. ; reference linerts@gsnAboveYRefLineColor = "red" ; above ref line fill redrts@gsnBelowYRefLineColor = "blue" ; below ref line fill blue; panel plot only resourcesrtsP = True ; modify the panel plotrtsP@gsnMaximize = True ; large formatrtsP@txString = "EOF"do n=0,neof-1rts@gsnLeftString = " EOF "+(n+1)rts@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"plot(n) = gsn_csm_xy (wks,year,eof_ts(n,:),rts)end dogsn_panel(wks,plot,(/neof/1,2/),rtsP) ; draw all 'neof' as one plotend
到此,关于"NCL常用统计学函数怎么用"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
函数
系数
常用
检验
统计
统计学
学习
两个
方根
维度
误差
显著
变量
右侧
命令
方法
更多
气象
帮助
实用
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网高科技
互联网科技工作委员会主任
互联网科技金融
华宇互联网科技
奇酷互联网科技
卓越科技互联网 招聘
互联网实体化科技化
宁波青枫互联网科技有限公司
昊天互联网科技有限公司
迪庆互联网科技招生
互联网科技的全部知识
晋城互联网科技
为客找房互联网科技公司怎么样
每天都有哪些好的互联网科技
本届互联网大会上的黑科技
互联网与数字科技关系
杭州科技互联网公司有哪些
中国主要互联网科技公司
利用互联网等科技手段
科技发展第三阶段互联网时代
互联网科技海报
博彦科技互联网金融
港股互联网科技股
易互联网科技有限公司
互联网科技视频
老年人脱离互联网科技的作文
银川新华互联网科技职业技术培训学校图片
浙江互联网科技研学营
扫呗互联网科技有限公司
广西科技产业互联网是什么