NCL常用統(tǒng)計學(xué)函數(shù)怎么用

這篇文章主要介紹“NCL常用統(tǒng)計學(xué)函數(shù)怎么用”,在日常操作中,相信很多人在NCL常用統(tǒng)計學(xué)函數(shù)怎么用問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”NCL常用統(tǒng)計學(xué)函數(shù)怎么用”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

成都創(chuàng)新互聯(lián)公司專注于平原企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站設(shè)計,成都做商城網(wǎng)站。平原網(wǎng)站建設(shè)公司,為平原等地區(qū)提供建站服務(wù)。全流程定制制作,專業(yè)設(shè)計,全程項目跟蹤,成都創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務(wù)

NCL作為一門氣象專業(yè)語言,自帶了很多氣象屆常用的算法和命令, 比如計算相關(guān)系數(shù)、均方根誤差等統(tǒng)計量,相關(guān)系數(shù)顯著性檢驗,EOF,以及各種插值。這里將一些常用函數(shù)做了歸納:

1、相關(guān)系數(shù)
NCL中計算相關(guān)系數(shù)的函數(shù)有好幾個,常用的為escorc系列和regCoef系列。

escorc(x,y)是計算兩個數(shù)組最右側(cè)一列的相關(guān)系數(shù)。如果想指定計算的列數(shù),比如想計算x(lat,lon)和y(lat,lon,year)在lat這一列上的相關(guān)系數(shù),就要用到escorc_n: escorc_n(x,y,0)。

相關(guān)系數(shù)的檢驗方法包括t檢驗、f檢驗和顯著性檢驗,分別為ttest,ftest,rtest。

regCoef系列的命令比escorc強大很多,因為它除了返回相關(guān)系數(shù)rc,還捎帶手把兩個序列的標(biāo)準(zhǔn)差(rc@rstd)和t檢驗結(jié)果(rc@tval)都給算了。

2、均方根誤差
函數(shù)名為dim_rmsd。它是計算兩個變量在所有其他維度上最右側(cè)維度的均方根誤差。而對于想要計算指定維度的情況,則要用dim_rmsd_n。

3、EOF分解
計算EOF分解的函數(shù)為eofunc開頭的系列函數(shù),一般用eofunc_Wrap計算空間模態(tài),用eofunc_ts_Wrap計算時間系數(shù)。

以下為針對變量x計算EOF分解并繪圖的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 file gsn_define_colormap(wks,"rainbow")   plot = new(neof,graphic)   res              = True                       ; plot mods desired;************************************************; original data;************************************************   res@gsnDraw                    = False        ; don't draw yet   res@gsnFrame                   = False        ; don't advance frame yet   res@gsnAddCyclic             = False;--map plot resources  res@mpFillOn                   = False        ; no grey continents  res@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 on  res@mpMaxLatF  = max(lat)  res@mpMinLonF  = min(lon)  res@mpMaxLonF  = max(lon)
;--contour resources  res@cnFillOn             = True              ; turn on contour fill  res@cnLineLabelsOn       = False              ; turn off contour  res@cnLinesOn            = False        ; add countor or not,True is default  res@gsnLeftString = " "  res@gsnRightString = " "
;--tickmark resources  res@tmXTOn            = False  res@tmYROn            = False  res@tmYLLabelFontHeightF =0.02  res@tmXBLabelFontHeightF =0.018  res@tmXTOn            = False  res@tmYROn            = False
;--labelbar resources  res@lbLabelBarOn         = False  res@lbLabelFontHeightF   = 0.02  res@lbOrientation       = "Vertical"          ; vertical label bar
 symMinMaxPlt(eof, 16, False, res); contributed.ncl; panel plot only resources  resP                     = True         ; modify the panel plot  resP@gsnMaximize         = True         ; large format  resP@gsnPanelLabelBar    = True         ; add common colorbar  resP@txString  = "EOF"do n=0,neof-1        res@gsnLeftString  = " EOF "+(n+1)        res@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"        plot(n) = gsn_csm_contour_map(wks,eof(n,:,:),res)end do   gsn_panel(wks,plot,(/neof/1,2/),resP)     ; draw all 'neof' as one plot;*******************************************; time series (principal component) plot;*******************************************  eof_ts@long_name = "Amplitude"  rts           = True  rts@gsnDraw   = False       ; don't draw yet  rts@gsnFrame  = False       ; don't advance frame yet
; decide exactly where on the page to draw it.  rts@vpHeightF = 0.40        ; Changes the aspect ratio  rts@vpWidthF  = 0.85  rts@vpXF      = 0.10        ; change start locations  rts@vpYF      = 0.75        ; the plot  rts@gsnYRefLine           = 0.              ; reference line  rts@gsnAboveYRefLineColor = "red"           ; above ref line fill red  rts@gsnBelowYRefLineColor = "blue"          ; below ref line fill blue; panel plot only resources  rtsP                     = True             ; modify the panel plot  rtsP@gsnMaximize         = True             ; large format  rtsP@txString  = "EOF"  do n=0,neof-1        rts@gsnLeftString  = " EOF "+(n+1)        rts@gsnRightString = sprintf("%5.1f", eof@pcvar(n)) +"%"        plot(n) = gsn_csm_xy (wks,year,eof_ts(n,:),rts)  end do  gsn_panel(wks,plot,(/neof/1,2/),rtsP)        ; draw all 'neof' as one plotend

到此,關(guān)于“NCL常用統(tǒng)計學(xué)函數(shù)怎么用”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

分享標(biāo)題:NCL常用統(tǒng)計學(xué)函數(shù)怎么用
本文鏈接:http://muchs.cn/article6/gdcpig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)企業(yè)網(wǎng)站制作、手機網(wǎng)站建設(shè)定制網(wǎng)站、動態(tài)網(wǎng)站虛擬主機

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)