[ncl-talk] Incorrect significance plot

Ipshita Majhi ipmajhi at alaska.edu
Tue Feb 2 11:35:58 MST 2016


Dear NCL,

I calculated correlation and am trying to plot the significance plot. The
significance plot , is not plotting correctly, it is giving no significance
where there is high correlation and vice versa. It will be great if you
could point out where I am going wrong.
Best Regards
Ipshita

;=============================================
; Reading data
;=============================================

a=addfile("~/Documents/SST/Monthly/sst.mnmean.v4.nc","r")
JJAS
=asciiread("~/Documents/SST/Monthly/jjas_1871_2012.txt",(/142,1/),"float")

;============================================
;Extracting JJAS for 1967 to 2012
;============================================

JJAS_1967_2012=JJAS(96:141,0)

e=transpose(transpose(JJAS_1967_2012))

;=============================================
;The dataset goes from 1854-2015

sst=a->sst

 copy_VarAtts(a,sst)
 copy_VarCoords_1(a,sst)
;============================================

;Extracting sea surface temperature

sst=a->sst

;Extracting 1967-2012 for SST
sst_1967_2012=sst(1356:1907,:,:)

copy_VarAtts(sst,sst_1967_2012)
copy_VarCoords_1(a,sst_1967_2012)

;============================================
;Extracting 1871 to 2012 SST

Dec_sst = new((/46,89,180/),float)
Dec_sst at _FillValue = -9.9621e+36


;==========================================
;Extracting SST for each month
;========================================

do nyr=0,551,12

Dec_sst(nyr/12,:,:) =sst_1967_2012(nyr+11,:,:)
end do

copy_VarAtts(sst_1967_2012,Dec_sst)
copy_VarCoords_1(sst_1967_2012,Dec_sst)

;=======================================
;Reordering
;=======================================

Dec_reorder=Dec_sst(lat|:,lon|:,time|:)

Dec_reorder at _FillValue = -9.9621e+36

copy_VarAtts(Dec_sst,Dec_reorder)
copy_VarCoords_1(Dec_sst,Dec_reorder)

;=====================================

;======================================
;Calculating Correlation
;======================================

corr_dec=escorc(Dec_reorder,e)
copy_VarCoords_1(Dec_reorder,corr_dec)

;===========================================

;Calculating significance
prob_dec   = rtest(corr_dec(:,:,0),46,0)
copy_VarCoords_1(Dec_reorder,prob_dec)
prob_dec at _FillValue = -9.9621e+36

;==============================================

; Now plotting the Significance
  wks  = gsn_open_wks("pdf","Significance_test")
  gsn_define_colormap(wks,"testcmap")              ; choose colormap

  res                      = True                ; make plot mods
  res at gsnDraw = True
  res at gsnFrame = True
  res at cnFillOn             = True                ; turn on color
  res at gsnSpreadColors      = True                ; use full colormap
  res at lbLabelAutoStride    = True         ; automatic lb label stride

  res at cnLinesOn            = False               ; turn off contour lines
  res at cnLevelSelectionMode = "ManualLevels" ; manually set cnlev
  res at cnMinLevelValF       = -1            ; min level
  res at cnMaxLevelValF       =  1                 ; max level
  res at cnLevelSpacingF      = 0.1                 ; contour level spacing



  res at tiMainString         = "Dec SST with JJAS rainfall Regular 1967-2012"
  plot= gsn_csm_contour_map_ce(wks,prob_dec,res)

 ;===========================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160202/3a231633/attachment.html 


More information about the ncl-talk mailing list