精华内容
下载资源
问答
  • ncl 笔记
    2021-08-23 22:41:12

    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输出

    更多相关内容
  • ncl 对数据平均值、标准差的处理,以及对数据进行EOF分析的程序
  • NCL基础讲解-兰溪之水

    2020-11-18 16:30:08
    资料可视化是大气科学和海洋科学必须学习的方法,这里是气象家园社区整理的资料,这里的所有搬去哪属于气象家园社区,只是在这里分享给大家。
  • ncl泰勒图(均方根误差、标准差、相关系数)

    最近学习了一下泰勒图的做法,对2001年泰勒的文章进行了简单学习,说一点自己的理解:

    泰勒图一般是用来评估多个模式对观测数据的模拟能力,包括标准差、中心型均方根误差、相关系数这三部分,这三部分可以构建一个三角关系。相关系数是用来量化模式之间的相似性,但是它有缺点,无法量化变化幅度。比如,当两个空间场变化极其相似,但是变化程度有量级差异,如果不看均方根误差而只看相关系数,那么很容易出现问题。标准差可以看出来模式相对于观测的离散程度。

    在ncl的脚本中,官网提供了现成的代码给我们绘制泰勒图,只需要提供模式和观测之间的相关系数,以及模式与观测之间的标准差的比率,就可以画出。因为代码中用到的是标准差比率,根据文章中提到的三角关系,我们图中最终得到的是标准化后的样本标准差和标准化后的中心型均方根误差,这样得到的图更加清晰明了。

    如果要对模式进行优选,就可以根据自己的需求,设定标准化后的标准差的范围(标准化后的中心型均方根误差类似),还可以对相关系数进行显著性检验等等。

    下面是官网提供的泰勒图代码:

    
    function taylor_diagram (wks:graphic ,RATIO[*][*]:numeric, CC[*][*]:numeric \
                                         ,rOpts:logical)
    ;--------------------------------------------------------------------
    ; This version of taylor_diagram supports "paneling"
    ; It requires NCL version 4.2.0.a034 because it uses "gsn_create_legend"
    ;--------------------------------------------------------------------
    
    ;
    ; Generate a Taylor Diagram:
    ; Generate Multiple Aspects of Model Performance in a Single Diagram
    ; Taylor, K. E., J. Geophys. Res., 106, D7, 7183-7192, 2001
    ;
    ; An example:
    ; http://www.grida.no/climate/ipcc_tar/wg1/fig8-4.htm
    ;
    ; This expects one or more datasets. The left dimension 
    ; is the number of datasets. The rightmost is the number of pts.
    ;
    ; Markers are at: 
    ; http://www.ncl.ucar.edu/Document/Graphics/Resources/gs.shtml
    ;
    ; By default, the function can handle up to 10 variable comparisons..
    ; To expand ...  modify the 'Colors' and 'Markers' attributes.
    ; The user can change / add some default settings.
    ;
    ; The defaults that the user can modify:
    ;
    ; rOpts                 = True 
    ;                                  ; 'made-up' resources
    ; rOpts@Colors          =  (/ "blue" , "red", "green", "cyan", "black" \
    ;                           , "turquoise", "brown", "yellow"/)
    ; rOpts@Markers         =  (/ 2, 3, 6, 14, 9, 12, 7, 4/) ; Marker Indices
    ; rOpts@markerTxOffset  = 0.0175   ; offset for text above marker
    ; rOpts@stnRad          = (/ 1. /) ;  (/ 0.50, 0.75, 1.5 /) 
    ; rOpts@centerDiffRMS   = False    ;  True mean draw additional radii from REF 
    ; rOpts@caseLabelsFontHeightF = 0.05
    ; rOpts@varLabelsFontHeightF  = 0.013
    ; rOpts@varLabelsYloc         = 0.65
    ; rOpts@legendWidth           = 0.015
    ; rOpts@legendHeight          = 0.030*nCase
    ; rOpts@taylorDraw            = True
    ; rOpts@taylorFrame           = True
    ;
    ;                                  ; standard NCL resources
    ; rOpts@tiMainString    = "Taylor" ; not using title makes plot bigger
    ; rOpts@gsMarkerSizeF   = 0.0085   ; marker size   
    ; rOpts@gsMarkerThicknessF = 1.0
    ; rOpts@txFontHeightF   = 0.0125   ; text size 
    ; rOpts@tiMainFontHeightF = 0.0225 ; tiMainString size
    ;
    ; It returns to the user a graphic object containing the 
    ; Taylor background and plotted x/y pts.
    ; This graphic object contains a simple Taylor background appropriate
    ; for standardized data and the markers for the datasets.
    ; ==================================================================
    ; This version allows paneling:
    ;      The 'cumbersome' "dum" variables were added by 
    ;      Adam Phillips to allow paneling via "gsn_add_?".
    ; ==================================================================
    begin
      dimR                  = dimsizes(RATIO)
      nCase                 = dimR(0)    ; # of cases [models] 
      nVar                  = dimR(1)    ; # of variables
    
                                         ; x/y coordinates for plotting
      X    = new ( (/nCase,nVar/) , typeof(RATIO) )
      Y    = new ( (/nCase,nVar/) , typeof(RATIO) )
    
      do nc=0,nCase-1
         angle      = acos( CC(nc,:) )   ; array operation                                    
         X(nc,:)    = RATIO(nc,:)*cos( angle )     
         Y(nc,:)    = RATIO(nc,:)*sin( angle )    
      end do
    
      xyMin                 = 0.  
      xyOne                 = 1.00
      xyMax                 = 1.65
      xyMax_Panel           = xyMax+ 0.10            ; paneling purposes
     
      if (rOpts .and. isatt(rOpts,"txFontHeightF"))  then 
          FontHeightF       = rOpts@txFontHeightF    ; user wants to specify size
      else
          FontHeightF       = 0.0175
      end if
     
    ; ----------------------------------------------------------------
    ; Part 1:
    ; base plot: Based upon request of Mark Stevens
    ; basic x-y and draw the 1.0 observed and the outer curve at 1.65
    ; ----------------------------------------------------------------
      
      rxy                   = True       
      rxy@gsnDraw           = False
      rxy@gsnFrame          = False
      rxy@vpHeightF         = 0.65
      rxy@vpWidthF          = 0.65
      rxy@tmYLBorderOn      = False
      rxy@tmXBBorderOn      = False
    
      rxy@tiYAxisString     = "Standardized Deviations (Normalized)"
      rxy@tiYAxisFontHeightF= FontHeightF                        ; default=0.025 
      
      rxy@tmXBMode          = "Explicit" 
      rxy@tmXBValues        = (/0.0,0.25,0.50,0.75,1.00,1.25,1.5/)    ; major tm
                                                                      ; default  "OBS" or "REF"
     ;rxy@tmXBLabels        = (/"0.00","0.25","0.50","0.75","REF" ,"1.25","1.50"/)
      rxy@tmXBLabels        = (/"    ","0.25","0.50","0.75","REF" ,"1.25","1.50"/)
      if (rOpts .and. isatt(rOpts,"OneX") )  then                     ; eg: rOpts@OneX="1.00" 
         ;rxy@tmXBLabels        = (/"0.00","0.25","0.50","0.75",rOpts@OneX,"1.25","1.50"/)
          rxy@tmXBLabels        = (/"    ","0.25","0.50","0.75",rOpts@OneX,"1.25","1.50"/)
      end if
    
      rxy@tmXBMajorLengthF  = 0.015      ; default=0.02 for a vpHeightF=0.6
      rxy@tmXBLabelFontHeightF = FontHeightF
      rxy@tmXBMinorOn       = False
      rxy@trXMaxF           = xyMax_Panel
    
      rxy@tmYLMode          = "Manual"
      rxy@tmYLMinorOn       = False
      rxy@tmYLMajorLengthF  = rxy@tmXBMajorLengthF
      rxy@tmYLLabelFontHeightF = FontHeightF
      rxy@tmYLMode          = "Explicit" 
      rxy@tmYLValues        = (/0.0, .25,0.50, 0.75, 1.00, 1.25, 1.5/) ; major tm
      rxy@tmYLLabels        = (/"0.00","0.25","0.50","0.75","1.00","1.25","1.50"/)
     ;rxy@tmYLLabels        = (/"    ","0.25","0.50","0.75","1.00","1.25","1.50"/)
      rxy@trYMaxF           = xyMax_Panel
    
      rxy@tmYRBorderOn      = False
      rxy@tmYROn            = False      ; Turn off right tick marks.
    
      rxy@tmXTBorderOn      = False
      rxy@tmXTOn            = False      ; Turn off right tick marks.
    
      rxy@xyDashPatterns    = (/ 0 /)    ; line characteristics (dash,solid)
      rxy@xyLineThicknesses = (/ 2./)    ; choose line thickness
    
      rxy@gsnFrame          = False      ; Don't advance the frame.
    
                                                ; create outer 'correlation axis'
      npts    = 200                        ; arbitrary
      xx      = fspan(xyMin,xyMax,npts) 
      yy      = sqrt(xyMax^2 - xx^2    )   ; outer correlation line (xyMax)
    
      sLabels = (/"0.0","0.1","0.2","0.3","0.4","0.5","0.6" \ ; correlation labels
                 ,"0.7","0.8","0.9","0.95","0.99","1.0"     /); also, major tm
      cLabels = stringtofloat(sLabels)
      rad     = 4.*atan(1.0)/180.
      angC    = acos(cLabels)/rad                     ; angles: correlation labels
                                                                           
      if (rOpts .and. isatt(rOpts,"tiMainString")) then
          rxy@tiMainString      = rOpts@tiMainString
         ;rxy@tiMainOffsetYF    = 0.015               ; default  0.0
          if (isatt(rOpts,"tiMainFontHeightF")) then
               rxy@tiMainFontHeightF = rOpts@tiMainFontHeightF
          else
               rxy@tiMainFontHeightF = 0.0225         ; default  0.025              
          end if
      end if
    ;;if (rOpts .and. isatt(rOpts,"gsnCenterString")) then
    ;;    rxy@gsnCenterString  = rOpts@gsnCenterString      ; only gsn_csm_xy
    ;;end if
    
      taylor  = gsn_xy(wks,xx,yy,rxy)                 ; Create and draw XY plot.
    
      rsrRes  = True
      rsrRes@gsLineThicknessF  = rxy@xyLineThicknesses(0)  ; line thickness
      rsrRes@gsLineDashPattern = 0                    ; solid line pattern
                                                      ; draw x and y to xyMax
      dum0 = gsn_add_polyline(wks,taylor,(/0.,  0. /),(/0.,xyMax/), rsrRes)
      dum1 = gsn_add_polyline(wks,taylor,(/0.,xyMax/),(/0.,  0. /), rsrRes)
    
      xx   = fspan(xyMin, xyOne ,npts)                ; draw 1.0 standard radius
      yy   = sqrt(xyOne - xx^2)   
      rsrRes@gsLineDashPattern = 1                    ; dashed line pattern
      rsrRes@gsLineThicknessF  = rxy@xyLineThicknesses(0)  ; line thickness
      dum2 = gsn_add_polyline(wks,taylor,xx,yy, rsrRes)
      delete(xx)
      delete(yy)
                                                      
      if (rOpts .and. isatt(rOpts,"stnRad") ) then
          rsrRes@gsLineThicknessF  = 1   ; rxy@xyLineThicknesses(0)  
          nStnRad = dimsizes(rOpts@stnRad)
    
          dum3  = new(nStnRad,graphic)
          do n=0,nStnRad-1
             rr = rOpts@stnRad(n)
             xx = fspan(xyMin, rr ,npts) 
             yy = sqrt(rr^2   - xx^2)   
             dum3(n) = gsn_add_polyline(wks,taylor,xx,yy, rsrRes)
          end do
          taylor@$unique_string("dum")$ = dum3
    
          delete(xx)
          delete(yy)
      end if
    
      getvalues taylor                                ; get style info from taylor
        "tmYLLabelFont"        : tmYLLabelFont        ; use for correlation axis
        "tmYLLabelFontHeightF" : tmYLLabelFontHeightF
      end getvalues
    
    ; ----------------------------------------------------------------
    ; Part 2:
    ; Correlation labels
    ; ----------------------------------------------------------------
      radC    = xyMax                                  ; for correlation labels
      xC      = radC*cos(angC*rad)
      yC      = radC*sin(angC*rad)
    ; added to get some separation
      xC      = xC + 0.020*cos(rad*angC)
      yC      = yC + 0.060*sin(rad*angC)
    
      txRes               = True                      ; text mods desired
      txRes@txFontHeightF = FontHeightF               ; match YL 
      txRes@tmYLLabelFont = tmYLLabelFont             ; match YL
      txRes@txAngleF      = -45.
      if (.not.isatt(rOpts,"drawCorLabel") .or. rOpts@drawCorLabel) then 
          dum4 = gsn_add_text(wks,taylor,"Correlation",1.30,1.30,txRes)
         taylor@$unique_string("dum")$ = dum4
      end if
      txRes@txAngleF      = 0.0 
      txRes@txFontHeightF = FontHeightF*0.50          ; bit smaller
    
    ;;dum0 = gsn_add_text(wks,taylor,"OBSERVED",1.00,0.075,txRes)
    
      plRes               = True
      plRes@gsLineThicknessF = 2.
      
      txRes@txJust        = "CenterLeft"              ; Default="CenterCenter".
      txRes@txFontHeightF = FontHeightF               ; match YL 
     ;txRes@txBackgroundFillColor = "white"
    
      tmEnd = 0.975
      radTM = xyMax*tmEnd                             ; radius end: major TM 
      xTM   = new( 2 , "float")
      yTM   = new( 2 , "float")
    
      dum5 = new(dimsizes(sLabels),graphic)
      dum6 = dum5
    
      do i=0,dimsizes(sLabels)-1                      ; Loop to draw strings
        txRes@txAngleF = angC(i)
        dum5(i) = gsn_add_text(wks, taylor, sLabels(i),xC(i),yC(i),txRes) ; cor label
        xTM(0)   = xyMax*cos(angC(i)*rad)             ; major tickmarks at
        yTM(0)   = xyMax*sin(angC(i)*rad)             ; correlation labels
        xTM(1)   = radTM*cos(angC(i)*rad)             
        yTM(1)   = radTM*sin(angC(i)*rad)
        dum6(i) = gsn_add_polyline(wks,taylor,xTM,yTM,plRes)
      end do
                                                      ; minor tm locations
      mTM     = (/0.05,0.15,0.25,0.35,0.45,0.55,0.65 \ 
                 ,0.75,0.85,0.91,0.92,0.93,0.94,0.96,0.97,0.98  /)
      angmTM  = acos(mTM)/rad                         ; angles: correlation labels
      radmTM  = xyMax*(1.-(1.-tmEnd)*0.5)             ; radius end: minor TM 
    
      dum7 = new(dimsizes(mTM),graphic)
    
      do i=0,dimsizes(mTM)-1                          ; manually add tm
        xTM(0)   = xyMax*cos(angmTM(i)*rad)           ; minor tickmarks
        yTM(0)   = xyMax*sin(angmTM(i)*rad)
        xTM(1)   = radmTM*cos(angmTM(i)*rad)          
        yTM(1)   = radmTM*sin(angmTM(i)*rad)
        dum7(i)  = gsn_add_polyline(wks,taylor,xTM,yTM,plRes)
      end do
                                                      ; added for Wanli
      if (rOpts .and. isatt(rOpts,"ccRays") ) then
          angRL = acos(rOpts@ccRays)/rad             ; angles: radial lines
    
          rlRes = True
          rlRes@gsLineDashPattern= 2  ; line pattern
          rlRes@gsLineThicknessF = 1  ; choose line thickness
          if (isatt(rOpts,"ccRays_color")) then
              rlRes@gsLineColor    =  "LightGray"
          end if
    
          dum8 = new(dimsizes(angRL),graphic)
          do i=0,dimsizes(angRL)-1
             xRL     = xyMax*cos(angRL(i)*rad)
             yRL     = xyMax*sin(angRL(i)*rad)
             dum8(i) = gsn_add_polyline(wks,taylor,(/0, xRL /),(/0,  yRL  /),rlRes)
          end do
          taylor@$unique_string("dum")$ = dum8
      end if
      
    ; ----------------------------------------------------------------
    ; Part 3:
    ; Concentric about 1.0 on XB axis
    ; ----------------------------------------------------------------
      if (rOpts .and. isatt(rOpts,"centerDiffRMS") \
                .and. rOpts@centerDiffRMS) then
          respl                    = True                ; polyline mods desired
          respl@xyLineThicknessF   = 1.0                 ; line thickness
          respl@xyLineDashPattern  = 2                   ; short dash lines
          respl@gsLineColor        = "Black"             ; line color     
          if (isatt(rOpts,"centerDiffRMS_color")) then
              respl@gsLineColor    =  "LightGray"
          end if
          
          dx   = 0.25
          ncon = 4                                       ; 0.75, 0.50, 0.25, 0.0
          npts = 100                                     ; arbitrary
          ang  = fspan(180,360,npts)*rad
    
          dum9 = new(ncon,graphic)
    
          do n=1,ncon 
             rr  = n*dx            ; radius from 1.0 [OBS] abscissa
             xx  = 1. + rr*cos(ang)
             yy  = fabs( rr*sin(ang) )
             if (n.le.2) then
                 dum9(n-1) = gsn_add_polyline(wks,taylor,xx,yy,respl)
             end if
             if (n.eq.3) then
                 n3 = floattointeger( 0.77*npts ) 
                 dum9(n-1) = gsn_add_polyline(wks,taylor,xx(0:n3),yy(0:n3),respl)
             end if
             if (n.eq.4) then
                 n4 = floattointeger( 0.61*npts ) 
                 dum9(n-1) = gsn_add_polyline(wks,taylor,xx(0:n4),yy(0:n4),respl)
             end if
          end do
          delete(ang)
          delete(xx)
          delete(yy)
          taylor@$unique_string("dum")$ = dum9
    
      end if
    ; ---------------------------------------------------------------
    ; Part 4:
    ; generic resources that will be applied to all users data points
    ; of course, these can be changed 
    ; http://www.ncl.ucar.edu/Document/Graphics/Resources/gs.shtml
    ; ---------------------------------------------------------------
      if (rOpts .and. isatt(rOpts,"Markers")) then
          Markers = rOpts@Markers
      else
          Markers = (/ 4, 6, 8,  0, 9, 12, 7, 2, 11, 16/) ; Marker Indices
      end if
    
      if (rOpts .and. isatt(rOpts,"Colors")) then
          Colors  = rOpts@Colors
      else
          Colors  = (/ "red", "blue", "green", "cyan", "orange" \
                     , "turquoise", "brown", "yellow", "purple", "black"/)
      end if
    
      if (rOpts .and. isatt(rOpts,"gsMarkerThicknessF")) then
          gsMarkerThicknessF = rOpts@gsMarkerThicknessF
      else
          gsMarkerThicknessF = 1.0
      end if
    
      if (rOpts .and. isatt(rOpts,"gsMarkerSizeF")) then
          gsMarkerSizeF      = rOpts@gsMarkerSizeF
      else
          gsMarkerSizeF      = 0.0085                  ; Default: 0.007
      end if
    
      gsRes = True
      gsRes@gsMarkerThicknessF = gsMarkerThicknessF      ; default=1.0
      gsRes@gsMarkerSizeF      = gsMarkerSizeF           ; Default: 0.007 
    
      ptRes = True                        ; text options for points
      ptRes@txJust             = "BottomCenter"; Default="CenterCenter".
      ptRes@txFontThicknessF   = 1.2      ; default=1.00
      ptRes@txFontHeightF      = 0.0125   ; default=0.05
      if (rOpts .and. isatt(rOpts,"txFontHeightF")) then
          ptRes@txFontHeightF  = rOpts@txFontHeightF  
      end if
    
      markerTxYOffset          = 0.0175   ; default
      if (rOpts .and. isatt(rOpts,"markerTxYOffset")) then
          markerTxYOffset = rOpts@markerTxYOffset             ; user defined offset
      end if
    
      dum10 = new((nCase*nVar),graphic)
      dum11 = dum10
    
      do n=0,nCase-1
         gsRes@gsMarkerIndex   = Markers(n)             ; marker style (+)
         gsRes@gsMarkerColor   = Colors(n)              ; marker color
         ptRes@txFontColor     = gsRes@gsMarkerColor
        do i=0,nVar-1
           dum10(n*nVar+i) = gsn_add_polymarker(wks,taylor,X(n,i),Y(n,i),gsRes) 
           dum11(n*nVar+i) = gsn_add_text(wks,taylor,(i+1),X(n,i),Y(n,i)+markerTxYOffset,ptRes)
        end do
      end do
    
    ; ---------------------------------------------------------------
    ; Part 5: ; add case legend and variable labels
    ; ---------------------------------------------------------------
    
      if (rOpts .and. isatt(rOpts,"caseLabels")) then 
    
          if (isatt(rOpts,"caseLabelsFontHeightF")) then
              caseLabelsFontHeightF = rOpts@caseLabelsFontHeightF
          else
              caseLabelsFontHeightF = 0.05  
          end if
    
          lgres                    = True
          lgres@lgMarkerColors     = Colors        ; colors of markers
          lgres@lgMarkerIndexes    = Markers       ; Markers 
          lgres@lgMarkerSizeF      = gsMarkerSizeF ; Marker size
          lgres@lgItemType         = "Markers"     ; draw markers only
          lgres@lgLabelFontHeightF = caseLabelsFontHeightF  ; font height of legend case labels
    
          if (isatt(rOpts,"legendWidth")) then
              lgres@vpWidthF       = rOpts@legendWidth
          else
              lgres@vpWidthF       = 0.15           ; width of legend (NDC)
          end if
    
          if (isatt(rOpts,"legendHeight")) then
              lgres@vpHeightF      = rOpts@legendHeight
          else   
              lgres@vpHeightF      = 0.030*nCase   ; height of legend (NDC)
          end if
    
          lgres@lgPerimOn          = False         ; turn off perimeter
          nModel                   = dimsizes( rOpts@caseLabels )
          lbid = gsn_create_legend(wks,nModel,rOpts@caseLabels,lgres)
         
          amres = True
          amres@amParallelPosF     =  0.35           
          amres@amOrthogonalPosF   = -0.35             
          annoid1 = gsn_add_annotation(taylor,lbid,amres)   ; add legend to plot
      end if
    
      if (rOpts .and. isatt(rOpts,"varLabels")) then 
          nVar    = dimsizes(rOpts@varLabels)
    
          if (isatt(rOpts,"varLabelsFontHeightF")) then
              varLabelsFontHeightF = rOpts@varLabelsFontHeightF
          else
              varLabelsFontHeightF = 0.013
          end if
    
          txres = True
          txres@txFontHeightF = varLabelsFontHeightF
          txres@txJust = "CenterLeft"              ; justify to the center left
    
         ;delta_y = 0.02       
         delta_y = 0.06   
          if (rOpts .and. isatt(rOpts,"varLabelsYloc")) then
              ys  = rOpts@varLabelsYloc            ; user specified
          else
              ys  = max( (/nVar*delta_y , 0.30/) )
          end if
    
          
          do i = 1,nVar     
             if (i.eq.1) then
                 dum12 = new(nVar,graphic)
         end if
    
             dum12(i-1) = gsn_add_text(wks,taylor,i+" - "+rOpts@varLabels(i-1), .125,ys,txres)
             ys = ys- delta_y
          end do
    
          taylor@$unique_string("dum")$ = dum12
      end if
    
      taylor@$unique_string("dum")$ = dum0   ; x-axis
      taylor@$unique_string("dum")$ = dum1   ; y-axis
      taylor@$unique_string("dum")$ = dum2   ; 1.0 std curve
      taylor@$unique_string("dum")$ = dum5   ; labels [COR]
      taylor@$unique_string("dum")$ = dum6   ; major tm [COR]
      taylor@$unique_string("dum")$ = dum7   ; minor tm
      taylor@$unique_string("dum")$ = dum10  ; markers
      taylor@$unique_string("dum")$ = dum11  ; text
      
      if (.not.isatt(rOpts,"taylorDraw") .or. \
         (isatt(rOpts,"taylorDraw") .and. rOpts@taylorDraw)) then 
        draw(taylor)
      end if
      if (.not.isatt(rOpts,"taylorFrame") .or. \
         (isatt(rOpts,"taylorFrame") .and. rOpts@taylorFrame)) then 
        frame(wks)
      end if
      return(taylor)
    end
    

    展开全文
  • NCL基本使用及实例演示是专门用于读取气象数据和作图开发专业软件
  • 本代码参考了施宁老师《NCL数据处理与绘图实习教程》一书,按实际情况有所增删。主要效果为合成ENSO年厄尔尼诺和拉尼娜海温异常,并进行t检验,将置信度为0.05的区域打点。(由于没有专门的NCL高亮代码块,特别注意...

    本代码参考了施宁老师《NCL数据处理与绘图实习教程》一书,按实际情况有所增删。主要效果为合成ENSO年厄尔尼诺和拉尼娜海温异常,并进行t检验,将置信度为0.05的区域打点。(由于没有专门的NCL高亮代码块,特别注意分号后面全部为注释部分)。

    另外,代码书写过程中断断续续,导致每个步骤独立性很强。重复进行的步骤可以缩减,例如在绘图部分可以直接res2=True/res2=res1,而后更改图名即可。错处欢迎指正~~

    year=ispan(1940,2018,1)
    it_s=194012;;海温数据
    it_e=201811
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;read data;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;HadIsst——1870-2019
    f_sst=addfile("/data/home//Data/SST/sst.mon.mean.nc","r")
    time =f_sst->time;;读取日期数据
    YYYYMM=cd_calendar(time,-1);;转换为公历日期
    rec_s=ind(it_s.eq.YYYYMM);;开始日期的记录号
    rec_e=ind(it_e.eq.YYYYMM);;终止日期的记录号
    sst=f_sst->sst
    
    sst_34=sst(rec_s:rec_e,:,:);;截取开始——终止的时段资料
    sst_DJF=month_to_season(sst_34, "JFM");求JFM的季节平均
    ; printVarSummary(sst_34)
    copy_VarMeta(sst_34(0,:,:),sst_DJF(0,:,:));copy_VarMeta(var_from, var_to)将前者的属性给后者
    sst_DJF!0="year";;;第一维的变量名字是year
    sst_DJF&year=year;;
    ;printVarSummary(sst_DJF)
    sst_ano=dim_rmvmean_n_Wrap(sst_DJF,0)
    copy_VarCoords(sst_DJF, sst_ano)
    ensoi=wgt_areaave(sst_DJF(:,{-5:5},{190:240}),1.0,1.0,0)
    ;;0表示仅用非缺省数值计算
    ;;标准化函数
    ensoi=dim_standardize(ensoi, 1)
    ; ;;1表示标准化时除以[N],1表示除以[N-1]
    ;printVarSummary(ensoi)
    ;;;;;;;;;;;;;;;;;;;;;;composite;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    irec_positive=ind(ensoi.gt.0.8)
    irec_negative=ind(ensoi.lt.-0.8)
    ;irec_negative=ind(ensoi.gt.-0.8);;
    nnumb=dimsizes(irec_positive)
    nnuma=dimsizes(irec_negative)
    nino_comp=dim_avg_n_Wrap(sst_ano(irec_positive,:,:),0)
    nina_comp=dim_avg_n_Wrap(sst_ano(irec_negative,:,:),0)
    copy_VarCoords(sst_ano(0,:,:), nino_comp)
    copy_VarCoords(sst_ano(0,:,:), nina_comp)
    ;printVarSummary(sst_comp)
    ;;;;;;;;;;;;;;;;;;;(t-test);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;sst
    nino_std=dim_variance_n_Wrap(sst_ano(irec_positive,:,:), 0)
    nina_std=dim_variance_n_Wrap(sst_ano(irec_negative,:,:), 0)
    nino_std=sqrt(nino_std/nnumb);;标准差
    nino_std=where(nino_std.eq.0,nino_std@_FillValue,nino_std);
    nina_std=sqrt(nina_std/nnuma);;标准差
    nina_std=where(nina_std.eq.0,nina_std@_FillValue,nina_std)
    
    t_nino=nino_comp/nino_std;;;
    confi_nino=nino_comp
    confi_nino=student_t(t_nino, nnumb-1)
    t_nina=nina_comp/nina_std
    confi_nina=nina_comp
    confi_nina=student_t(t_nina, nnuma-1)
    ;print(sst_comp)
    copy_VarCoords(nino_comp, confi_nino)
    copy_VarCoords(nina_comp, confi_nina)
    ;printVarSummary(confi_sst)
    ;;;第一种方法分EP和CP
    enso3i=wgt_areaave(sst_DJF(:,{-5:5},{210:270}),1.0,1.0,0)
    enso3i_s=dim_standardize(enso3i, 1)
    enso4i=wgt_areaave(sst_DJF(:,{-5:5},{160:210}),1.0,1.0,0)
    enso4i_s=dim_standardize(enso4i, 1)
    irec_EP=ind((enso3i_s.gt.1).and.(enso3i.gt.enso4i))
    irec_CP=ind((enso4i_s.gt.1).and.(enso4i.gt.enso3i))
    nnume=dimsizes(irec_EP)
    nnumc=dimsizes(irec_CP)
    EP_comp=dim_avg_n_Wrap(sst_ano(irec_EP,:,:),0)
    CP_comp=dim_avg_n_Wrap(sst_ano(irec_CP,:,:),0)
    copy_VarCoords(sst_ano(0,:,:), EP_comp)
    copy_VarCoords(sst_ano(0,:,:), CP_comp)
    
    EP_std=dim_variance_n_Wrap(sst_ano(irec_EP,:,:), 0)
    CP_std=dim_variance_n_Wrap(sst_ano(irec_CP,:,:), 0)
    EP_std=sqrt(EP_std/nnume);;标准差
    EP_std=where(EP_std.eq.0,EP_std@_FillValue,EP_std);;;
    CP_std=sqrt(CP_std/nnumc);;标准差
    CP_std=where(CP_std.eq.0,CP_std@_FillValue,CP_std)
    
    t_EP=EP_comp/EP_std;;;
    confi_EP=EP_comp
    confi_EP=student_t(t_EP, nnume-1)
    t_CP=CP_comp/CP_std
    confi_CP=CP_comp
    confi_CP=student_t(t_CP, nnumc-1)
    copy_VarCoords(EP_comp, confi_EP)
    copy_VarCoords(CP_comp, confi_CP)
    
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    wks=gsn_open_wks("PDF", "/data/home/yuancx/wangjy/nino_compo_test/try6")
    gsn_define_colormap(wks, "MPL_coolwarm")
    plot=new(4,"graphic")
    base=new(4,"graphic")
    
    res                            =True
    res@gsnAddCyclic               =True
    res@gsnDraw                    =False
    res@gsnFrame                   =False
    res@gsnLeftString              =""
    res@gsnRightString             =""
    res@mpCenterLonF               =180;中心经度为180°
    res@mpGeophysicalLineThicknessF=0.2;地图边界
    res@mpFillOn                   =False;地图不填色
    res@mpGridAndLimbOn            =True;绘制经纬度线
    res@mpGridLatSpacingF          =15;纬度线的间隔
    res@mpGridLonSpacingF          =15;经度线的间隔
    res@mpGridLineDashPattern      =2
    res@mpGridLineThicknessF       =0.05;经纬线的粗细
    res@cnFillOn                   =True;填充图
    res@lbLabelBarOn               =True;色标打开
    res@lbOrientation              ="Horizontal"
    res@cnLinesOn                  =False;不要等值线怪丑的
    res@cnLineLabelsOn             =False;等值线上不要标签
    res@cnLevelSelectionMode       ="ExplicitLevels"
    res@cnLevels                   =(/-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1.0,1.2,1.4/)
    res@cnLineThicknessF           =2
    res@cnInfoLabelOn              =False
    res@gsnCenterString            ="El-nino"
    res@gsnCenterStringFontHeightF =0.02
    plot(0)=gsn_csm_contour_map(wks, nino_comp, res)
    
    res3                            =True
    res3@gsnAddCyclic               =True
    res3@gsnDraw                    =False
    res3@gsnFrame                    =False
    res3@gsnLeftString              =""
    res3@gsnRightString             =""
    res3@mpCenterLonF               =180;中心经度为180°,全球图要从20度经度开始,后面注意!
    res3@mpGeophysicalLineThicknessF=0.2;地图边界
    res3@mpFillOn                   =False;地图不填色
    res3@mpGridAndLimbOn            =True;绘制经纬度线
    res3@mpGridLatSpacingF          =15;纬度线的间隔
    res3@mpGridLonSpacingF          =15;经度线的间隔
    res3@mpGridLineDashPattern      =2
    res3@mpGridLineThicknessF       =0.05
    res3@cnFillOn                   =True;填充图
    res3@lbLabelBarOn               =True;色标打开
    res3@lbOrientation              ="Horizontal"
    res3@cnLinesOn                  =False;不要等值线怪丑的
    res3@cnLineLabelsOn             =False;等值线上不要标签
    res3@cnLevelSelectionMode       ="ExplicitLevels"
    res3@cnLevels                   =(/-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1.0,1.2,1.4/)
    res3@cnLineThicknessF           =2
    res3@cnInfoLabelOn              =False
    res3@gsnCenterString            ="La-nina"
    res3@gsnCenterStringFontColor   =0.02
    plot(1)=gsn_csm_contour_map(wks, nina_comp, res3)
    
    res1                            =True
    res1@gsnAddCyclic               =True
    res1@gsnDraw                    =False
    res1@gsnFrame                   =False
    res1@gsnLeftString              =""
    res1@gsnRightString             =""
    res1@mpCenterLonF               =180;中心经度为180°
    res1@mpGeophysicalLineThicknessF=0.2;地图边界
    res1@mpFillOn                   =False;地图不填色
    res1@mpGridAndLimbOn            =True;绘制经纬度线
    res1@mpGridLatSpacingF          =15;纬度线的间隔
    res1@mpGridLonSpacingF          =15;经度线的间隔
    res1@mpGridLineDashPattern      =2
    res1@mpGridLineThicknessF       =0.05;经纬线的粗细
    res1@cnFillOn                   =True;填充图
    res1@lbLabelBarOn               =True;色标打开
    res1@lbOrientation              ="Horizontal"
    res1@cnLinesOn                  =False;不要等值线怪丑的
    res1@cnLineLabelsOn             =False;等值线上不要标签、
    res1@cnLevelSelectionMode       ="ExplicitLevels"
    res1@cnLevels                   =(/-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1.0,1.2,1.4/)
    res1@cnLineThicknessF           =2
    res1@cnInfoLabelOn              =False
    res1@gsnCenterString            ="EP(nino3>1std&nino3>nino4)"
    res1@gsnCenterStringFontHeightF =0.02
    plot(2)=gsn_csm_contour_map(wks, EP_comp, res1)
    
    res2                            =True
    res2@gsnAddCyclic               =True
    res2@gsnDraw                    =False
    res2@gsnFrame                   =False
    res2@gsnLeftString              =""
    res2@gsnRightString             =""
    res2@mpCenterLonF               =180;中心经度为180°
    res2@mpGeophysicalLineThicknessF=0.2;地图边界
    res2@mpFillOn                   =False;地图不填色
    res2@mpGridAndLimbOn            =True;绘制经纬度线
    res2@mpGridLatSpacingF          =15;纬度线的间隔
    res2@mpGridLonSpacingF          =15;经度线的间隔
    res2@mpGridLineDashPattern      =2
    res2@mpGridLineThicknessF       =0.05;经纬线的粗细
    res2@cnFillOn                   =True;填充图
    res2@lbLabelBarOn               =True;色标打开
    res2@lbOrientation              ="Horizontal"
    res2@cnLinesOn                  =False;不要等值线怪丑的
    res2@cnLineLabelsOn             =False;等值线上不要标签、
    res2@cnLevelSelectionMode       ="ExplicitLevels"
    res2@cnLevels                   =(/-1.4,-1.2,-1.0,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1.0,1.2,1.4/)
    res2@cnLineThicknessF           =2
    res2@cnInfoLabelOn              =False
    res2@gsnCenterString            ="CP(nino4>1std&nino4>nino3)"
    res2@gsnCenterStringFontHeightF =0.02
    plot(3)=gsn_csm_contour_map(wks, CP_comp, res2)
    
    ;;;打点部分施工中——请出示健康码;;;;;;;
    opt                      =True
    opt@gsnShadeFillType     ="pattern"
    opt@gsnShadeLow          =17;打点
    opt@gsnAddCyclic         =True
    opt@cnFillDotSizeF       =0.001;改变点大小的默认值
    
    sres                     =True
    sres@gsnDraw             =False
    sres@gsnFrame            =False
    sres@cnLinesOn           =False
    sres@gsnLeftString       =""
    sres@gsnRightString      =""
    sres@cnLevelSelectionMode="ExplicitLevels"
    sres@cnLevels            =(/0.05,0.01/)
    sres@cnFillPalette       ="GMT_gray"
    sres@cnFillColors        =(/5,7,-1/)
    sres@cnLineLabelsOn      =False
    sres@cnInfoLabelOn       =False
    sres@lbLabelBarOn        =False
    base(0)=gsn_csm_contour(wks,confi_nino, sres)
    base(0)=gsn_contour_shade(base(0),0.05,1,opt)
    overlay(plot(0),base(0))
    base(1)=gsn_csm_contour(wks,confi_nina, sres)
    base(1)=gsn_contour_shade(base(1),0.05,1,opt)
    overlay(plot(1),base(1))
    base(2)=gsn_csm_contour(wks,confi_EP, sres)
    base(2)=gsn_contour_shade(base(2),0.05,1,opt)
    overlay(plot(2),base(2))
    base(3)=gsn_csm_contour(wks,confi_CP, sres)
    base(3)=gsn_contour_shade(base(3),0.05,1,opt)
    overlay(plot(3),base(3))
    
    
    resP                                 =True
    resP@txstring                        ="ENSO composite"
    resP@txFontHeightF                   =0.03
    resP@gsnPanelFigureStrings           =(/"(a)","(b)","(c)","(d)","(e)","(f)","(g)","(h)"/)
    resP@gsnPanelFigureStringsFontHeightF=0.008
    resP@amJust                          ="TopLeft"
    resP@gsnPanelRowSpec                 =True
    gsn_panel(wks,plot,(/2,2,2,2/),resP)
    

    如图所示,合成效果不算完美,尚在改进
    合成效果如上图所示,结果尚不完美,有待改进(~ ̄▽ ̄)~

    展开全文
  • NCL折线图

    千次阅读 2020-01-07 17:55:20
    一、NCL标题及坐标轴设置 1、首先定义好文件目录,比如程序存放目录和文件输出目录 2、开始编写程序:写法和我之前用的语言大同小异 begin npts = 500 y = 500.+.9* ispan(0,npts-1,1)*sin(0.031415926535898*...

    一、NCL标题及坐标轴设置

    1、首先定义好文件目录,比如程序存放目录和文件输出目录

    2、开始编写程序:写法和我之前用的语言大同小异

    begin
      npts = 500
      y = 500.+.9* ispan(0,npts-1,1)*sin(0.031415926535898*ispan(0,npts-1,1))
      y1=ispan(0,npts-1,1)                     ;这个画出来的图就是y=x
    
      wks = gsn_open_wks("png","/cygdrive/d/learn/ncl-test/output/ex_title")  
    
      res = True     
      res@tiMainString="ex_titl"   ;添加图片主题
      res@tiMainFontHeightF=0.05                     ;主题字体大小
      res@tiMainFontColor="red"                      ;主题字体颜色
      res@gsnCenterString="center title"
      res@gsnLeftString="left title"
      res@gsnRightString="right title"
    
      res@tiXAxisString="X axis"
      res@tiYAxisString="Y axis"
      res@tiXAxisFontColor="black"
      
      
      plot = gsn_csm_y(wks,y,res)
    end

    3、执行脚本: 

    ncl /cygdrive/d/learn/ncl-test/script-upload/ex_title.ncl

     

    4、在d/learn/ncl-test/output文件下会出现title1_ex.png,如图:

     

     

    二、多根折线及图例

    
    begin
     npts = 500
     x    = fspan(-100,100,npts)  ;创建一个从-100到100的500个数值的等差数列
     y    = new((/4,500/),"float")
     y(0,:) =sin(0.0628*x)
     y(1,:) =cos(0.0628*x) 
     y(2,:) =cos(0.0628*x)*sin(0.0628*x)
     y(3,:) =cos(0.0628*x)+sin(0.0628*x)
    
     wks=gsn_open_wks("png", "/cygdrive/d/learn/ncl-test/output/xyLengend")
    
    
     res = True
    
     res@trXMinF = min(x)
     res@trXMaxF = max(x)
     res@trYMinF = min(y) - 0.2
     res@trYMaxF = max(y) + 0.6
    
     res@xyLineThicknesses = (/1,2,3,4/)
     res@xyLineColors    = (/"black","HotPink","OrangeRed","Green"/)  ;line color
     res@xyDashPatterns    =(/0,2,4,6/)                                 ;differ lines
    
     res@pmLegendDisplayMode    = "Always"                              ;add lengend
     res@xyExplicitLegendLabels = (/"tem","rhu","wind","AQI"/)          ;lengend title by english
     res@pmLegendWidthF         = 0.2                                   ;lengend width
     res@pmLegendHeightF        = 0.1                                   ;lengend height
    
     res@pmLegendOrthogonalPosF  = -1.05                                ;
     res@pmLegendParallelPosF    = 0.82
     
     plot = gsn_csm_xy(wks,x,y,res)
    
    end

     执行:

    ncl /cygdrive/d/learn/ncl-test/script-upload/ex_xy_lengend.ncl

    输出:

    展开全文
  • 一、问题描述“Matlab求标注差函数std与Python Numpy中求标注差函数std对统一数据求标准差的结果不一样”Matlab示例:>> a = [1,3,7,10,20]; >> std(a) ans = 7.4632Python Numpy示例...
  • 请教各位:我有一段程序通过matlab计算出的结果和用Excel中VB计算的结果完全不一样,跪求指导。。。。。(已经确定是程序中这段的问题,实在找不出2者的区别)两种语言中中Ndata=n,inpt(i)= sh.Cells(i + 1, 4)matlab...
  • ) We propose a model-agnostic contrastive learning framework named NCL, which incorporates both structural and semantic neighbors for improving the neural graph collaborative filtering. (我们提出了一...
  • 本文介绍了 HDR 相关的特点及基本知识,然后具体介 绍了 HDR 相关的转换函数及兼容性等关键技术,并对现有的主流 HDR 编解码进行了详细介绍和对比,最后总结了 HDR 最新的标准化进展情况。关键词: 高动态范围; ...
  • 位温 potential temperature位温把干空气块绝热膨胀或压缩到标准气压(1000hPa)时的温度。在干绝热过程中具有守恒性,即一个气块的位温不随气块所处的高度或压强的改变而改变,而温度是非保守性的物理量,会随着气块...
  • 按照气象统计课程的内容,我给出了一些常用到的统计方法的对应函数:import numpy as np平均值在计算气候态,区域平均时均要使用到求均值函数,对应NCL中的dim_average函数,在python中通常使用np.mean()函数numpy....
  • 我看了之后, 觉得自己得太远了。 2017年初我看到了 Maslow 的一些建议,也把它放在这里。 2017年秋天我看到了 Alan Alda 的书 , Would I Have this look on My Face?>, 里面花不少篇幅讲了交流,Engagement,...
  • 2020-08-06

    2020-08-06 14:39:55
    NCL数据处理与绘图实习教程 在处理第四章的时候最开始报了这样一个错误: fatal:syntax error: line 24 in file E:/meteorology/NCL_Exr/script-upload/plot-comp-enso1.ncl before or near > sst = f_sst -> ...
  • Activations:应用偏差和非线性函数之后,这一层的输出等于它的激活值 ala^{l}al, ala^{l}al是一个三维体,即 nhln^{l}_hnhl​ x nwln^{l}_wnwl​ x ncln^{l}_{c}ncl​,当你执行批量梯度下降或小批量梯度下降时,...
  • t检验的代码

    2020-10-30 13:09:06
    μ=μ0=30,α=0.05") ages = [25,36,15,40,28,31,32,30,29,28,27,33,35] t = (np.mean(ages)-30)/(np.std(ages,ddof=1)/np.sqrt(len(ages)))#这里的30 为总体的平均值 ddof=1 是计算的标准差。np.sqrt(len(ages))这...
  • 老规矩 -- 举个栗子,具体的计算过程如下: 在大多数场景下,目前较通用的 PSI 评判标准阈值如下: 若 PSI 小于 0.1,模型表现很稳定,无需对当前模型进行更新; 若 PSI 介于 0.1-0.2,模型在当前场景的稳定性有...
  • 皮尔逊相关系数R语言例子理解皮尔逊相关的两个角度其一, 按照高中数学水平来理解, 皮尔逊相关...等于变量减掉平均数再除以标准差.(就是高考的标准分类似的处理)标准差则等于变量减掉平均数的平方和,再除以样本数,最...
  • 到此处就卡住了,divq就慢很多,除法相对于加减乘太多了,不合理呀。咋整? 致电intel工程师,得到的反馈是icelack的浮点运算性能不可能比cascade快这么多,cascade频率更高应该更快才对,然后没有了.......好吧...
  • 小弟使用pandas的统计函数mean,求一下df各列的平均,但是结果是空值,请求论坛大神们帮小弟解惑啊,下面是打印的df和mean函数输出的均值结果。 df长这样: VERSION MODEL FCST_LEAD ... EDI_BCU SEDI SEDI_NCL SED...
  • 十分钟学会写shell脚本

    千次阅读 2020-12-19 02:18:16
    "done 在这里2>&1代表不显示错误信息,其实就是把错误重定向到标准输出,然后重定向到/dev/null,/dev/null就是个黑洞,写入的任何东西都会丢失,其实简要说就是把正确或错误的输出扔到垃圾桶。 写到这里大家是不是...
  • 相关系数的检验

    千次阅读 2018-05-10 22:02:00
     z统计量的标准差σ=1/sqrt(N-3) 4  z的下限和上限 z-(z α/2 )*σ, z+(z α/2 )*σ 5  用fisher逆变换(r=(exp(2*z)-1)/(exp(2*z)+1))得到r的下限和上限。     参考资料 ...
  • t 检验

    千次阅读 2017-01-03 11:07:48
    t检验T检验,亦称student t检验(student’s t test),主要用于变量为连续型的组间比较,样本含量较小(例如n),总体标准差σ未知且服从正态分布.T检验是用于小样本(样本容量小于30)的两个平均值差异程度的检验...
  • 1.2.3 POSIX 标准.....................................................4 1.3 Linux 与 U N I X 的异同.................................................. 5 1 . 4 操作系统类型选择和内核版本的选择..............
  • 数据的归一化处理

    千次阅读 2018-05-16 20:46:52
    数据的标准化(normalization)是将数据按比例缩放,使之落入一个小的特定区间。在某些比较和评价的指标处理中经常会用到,去除数据的单位限制,将其转化为无量纲的纯数值,便于不同单位或量级的指标能够进行比较和...
  • python中NumPy的矢量运算

    千次阅读 2019-10-03 11:05:19
    接下来了解下矢量运算的能力, ...我们先使用NumPy的random.normalvariate()生成一个平均收盘股价为10元(即期望为10),振幅为1元(即标准差为1),样本数量为1000的正态分布随机数组,如下所示: stock_data = np...
  • 1、感知器收敛的前提是两个类别必须是线性可分的,激励函数为阶跃函数。 2、Adeline 算法 3、(批量)梯度下降 随机梯度下降 小批次梯度下降 知识点1:Python zip()函数 原文demo ...def fit(self,X,y): ...
  • 一般情况下,在蒙特卡罗随机模拟方法(所谓的蒙特卡罗)中,分类效果比较好的是“可变法”,分类效果比较的是“MCQUITTY法”和“最短距离法”。对离群点(Outlier,指的是少数几个点距离当前所有的群都比较远)...

空空如也

空空如也

1 2 3 4 5 ... 7
收藏数 124
精华内容 49
热门标签
关键字:

ncl 标准差