In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use NCL commonly used statistical functions". In daily operation, I believe many people have doubts about how to use NCL commonly used statistical functions. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use NCL commonly used statistical functions". Next, please follow the editor to study!
As a meteorological professional language, NCL comes with many commonly used meteorological algorithms and commands, such as calculating correlation coefficient, root mean square error and other statistics, correlation coefficient significance test, EOF, and various interpolation. Some common functions are summarized here:
1. There are several functions to calculate the correlation coefficient in the correlation coefficient NCL, and the commonly used ones are escorc series and regCoef series.
Escorc (XBI y) calculates the correlation coefficient of the rightmost column of two arrays. If you want to specify the number of columns to be calculated, for example, if you want to calculate the correlation coefficient of x (lat,lon) and y (lat,lon,year) on the lat column, use escorc_n: escorc_n (xmemyjournal 0).
The test methods of correlation coefficient include t test, f test and significance test, which are ttest,ftest,rtest respectively.
The command of the regCoef series is much more powerful than escorc because it not only returns the correlation coefficient rc, but also counts the standard deviation (rc@rstd) and t-test result (rc@tval) of the two sequences.
2. The root mean square error function is called dim_rmsd. It calculates the root mean square error of the rightmost dimension of two variables on all other dimensions. For cases where you want to calculate a specified dimension, use dim_rmsd_n.
3. EOF decomposition calculates the functions of EOF decomposition as a series of functions beginning with eofunc. Generally, eofunc_Wrap is used to calculate spatial modes and eofunc_ts_Wrap is used to calculate time coefficients.
The following is the NCL subroutine that calculates EOF decomposition and plots for variable x:
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 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.02res@tmXBLabelFontHeightF = 0.018 res@tmXTOn = False res@tmYROn = False
;-- labelbar resources res@lbLabelBarOn = False res@lbLabelFontHeightF = 0.02res@lbOrientation = "Vertical"; vertical labelbar
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 naughty 0 res@gsnLeftString = "EOF" + (nasty 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 naughty 0 rts@gsnLeftString = "EOF" + (nasty 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 at this point, the study of "how to use common statistical functions in NCL" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.