请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 4194|回复: 8

ncl显著性打点如何不打点只显示超过显著性检验区域的区域

[复制链接]

新浪微博达人勋

发表于 2022-10-31 09:50:43 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
例如Only the fields exceeding the 95% confidence level based on a Student’s t test are shown.希望大佬能给一个思路或者例子



77.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2022-10-31 13:24:56 | 显示全部楼层
where函数,设置你的变量大于0.95显示,否则为fillvalue,例如pre_test=where(prob.gt.0.95,pre,pre@_FillValue)
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-11-1 21:11:06 | 显示全部楼层
guoguohh 发表于 2022-10-31 13:24
where函数,设置你的变量大于0.95显示,否则为fillvalue,例如pre_test=where(prob.gt.0.95,pre,pre@_FillV ...

谢谢大佬,我去试试
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-11-6 19:46:28 | 显示全部楼层
楼主有没有代码呀,我也讨厌打点,还是区域好看
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-11-9 21:13:10 | 显示全部楼层
对方的凤飞飞 发表于 2022-11-6 19:46
楼主有没有代码呀,我也讨厌打点,还是区域好看

就比如你算出了prob,用where函数,判定prob大于0.95则是原数据,小于则为缺测,然后绘图的时候用prob代替air就行了
prob = where(prob.ge.siglvl,air@_FillValue,air)
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-11-10 16:32:18 | 显示全部楼层
https://renqlsysu.github.io/2018/08/08/ncl_special_plot/
这个网址也有说明
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-11-15 18:48:52 | 显示全部楼层
  1. begin

  2.         start_year = 1979
  3.           end_year = 2019

  4.         f1      = addfile ("precip.mon.mean.nc", "r")
  5.         time    = cd_calendar( f1->time, 0 )
  6.         year    = time(:,0)
  7.         pre     = f1->precip

  8.         idx     = ind( year.ge.start_year.and.year.le.end_year)
  9.         pre_runave  = runave_n_Wrap ( pre(idx,:,:), 3, 0, 1 )

  10.         nino34_raw  = asciiread ( "Nino3.4Index_1948-2020", (/73, 13/), "float" )
  11.         nino34      = nino34_raw ( 31:71, 1:: ) ;71
  12.         nino34      = nino34 - conform( nino34, dim_avg_n_Wrap ( nino34, 0 ), 1 )
  13.         nino34_1d   = ndtooned( nino34 )
  14.         nino34_1d   = runave ( nino34_1d, 3, 0 )

  15.         cormap      = esccr ( nino34_1d, pre_runave(lat|:, lon|:, time|:), 6 )
  16.         printVarSummary(cormap)
  17.         cormap@long_name    = "Correlation Map"
  18.         copy_VarCoords( pre(0,:,:), cormap(:,:,0) )

  19.         printVarSummary(cormap)

  20.         prob   = 1. - rtest( cormap, 12*41, 0 )
  21.        
  22.                
  23.         copy_VarCoords( pre(0,:,:), prob(:,:,0) )

  24.         wks = gsn_open_wks ( "pdf", "Fig_NCLseries2" )
  25.         gsn_define_colormap( wks, "BlueWhiteOrangeRed" )

  26.         plot1 = new(3, graphic)
  27.         plot2 = new(3, graphic)

  28.         res = True
  29.         res@gsnAddCyclic = True
  30.         res@gsnFrame = False
  31.         res@gsnDraw  = False

  32.         res@cnLinesOn      = False
  33.         res@cnLineLabelsOn = False
  34.         res@cnInfoLabelOn  = False
  35.         res@cnFillOn       = True
  36.         res@mpCenterLonF   = 180.
  37.         res@gsnLeftStringFuncCode = ":"
  38.         res@gsnRightString = "1979-2019"
  39.         res@vpHeightF      = 0.4
  40.         res@vpWidthF       = 0.75
  41.         res@cnLevelSelectionMode = "ExplicitLevels"
  42.         res@cnLevels       = fspan(-0.6, 0.6, 25) ;(/980, 984, 988, /) ;fspan(1,10,10)
  43.         res@lbLabelBarOn   = False

  44.         res@mpMaxLatF = 50
  45.         res@mpMinLatF = -50


  46.         res@gsnLeftString  = "(a) GPCP lag cor with Nino 3.4 SST [lag=0]"
  47.         plot1(0) = gsn_csm_contour_map_ce ( wks, cormap(:,:,0), res)
  48.         res@gsnLeftString  = "(b) GPCP lag cor with Nino 3.4 SST [lag=3]"
  49.         plot1(1) = gsn_csm_contour_map_ce ( wks, cormap(:,:,3), res)
  50.         res@gsnLeftString  = "(c) GPCP lag cor with Nino 3.4 SST [lag=6]"
  51.         plot1(2) = gsn_csm_contour_map_ce ( wks, cormap(:,:,6), res)

  52.         lres  = True
  53.         lres@gsnAddCyclic = True
  54.         lres@gsnLeftString = ""
  55.         lres@gsnRightString = ""
  56.         lres@gsnDraw = False
  57.         lres@gsnFrame = False
  58.         lres@cnInfoLabelOn = False
  59.         lres@cnLinesOn = False
  60.         lres@cnLineLabelsOn = False
  61.         lres@cnFillOn = True
  62.         lres@cnFillColors = (/"black"/)
  63.         lres@cnMonoFillPattern    = False        ; Use multiple fill patterns
  64.         lres@cnFillPatterns        = (/-1,17/)
  65.         lres@cnFillDotSizeF  = 0.002
  66.         lres@cnLevelSelectionMode = "ExplicitLevels"
  67.         lres@cnLevels = (/0.95/)
  68.         lres@lbLabelBarOn         = False
  69.             
  70.             plot2(0) = gsn_csm_contour ( wks, prob(:,:,0), lres)
  71.             plot2(1) = gsn_csm_contour ( wks, prob(:,:,1), lres)
  72.             plot2(2) = gsn_csm_contour ( wks, prob(:,:,2), lres)

  73.         overlay( plot1(0), plot2(0) )
  74.         overlay( plot1(1), plot2(1) )
  75.         overlay( plot1(2), plot2(2) )

  76.         resP = True
  77.         resP@gsnPanelLabelBar = True
  78.         resP@pmLabelBarWidthF = 0.85
  79.         resP@pmLabelBarHeightF= 0.04
  80.         resP@lbLabelFontHeightF = 0.015
  81.         ;resP@pmLabelBarOrthogonalPosF = 0.12
  82.         gsn_panel ( wks, plot1, (/3,1/), resP )

  83.           end
复制代码
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-11-15 18:58:14 | 显示全部楼层
你好,我有点不是很清楚你的意思,我自己上传了一个打点的代码,需要怎么微调呀
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2022-11-16 11:33:52 | 显示全部楼层
对方的凤飞飞 发表于 2022-11-15 18:58
你好,我有点不是很清楚你的意思,我自己上传了一个打点的代码,需要怎么微调呀

就是不overlay了,直接一个图层,把你的cormap里不过检验的区域换成缺测值(我是小白,目前是这么个想法不知道对不对)
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表