[ncl-talk] draw_significance_values

Kunal Bali kunal.bali9 at gmail.com
Wed May 30 03:01:14 MDT 2018


Dear NCL users,

I am trying to draw the significance values at 95% on the correlation map
but not able to succeed yet.

First I calculate and plot the correlation using

 ts1 = var_a(lat|:,lon|:,time|:)
  ts2 = var_b(lat|:,lon|:,time|:)
  printVarSummary(ts1)
  printVarSummary(ts2)

;************************************************
; calculate cross correlations
;************************************************
; maxlag = 0                               ; set lag
; note, the max lag should not be more than N/4

; ccr = esccr(ts1,ts2(lat|:,lon|:,time|:), maxlag) ; calc cross correlations
*  ccr = escorc(ts1,ts2) *
  printVarSummary(ccr)
  printMinMax(ccr,0)

; copy meta data and coordinate variables using contributed functions
  copy_VarAtts(ts2, ccr)
  copy_VarCoords_1(ts1,ccr)


  *plot* = gsn_csm_contour_map(wks,ccr,res)


*Then, I tried to calculate significance and draw over plot using*


;**********************************************
;Calculating significance
;**********************************************


* prob_Dec=rtest(ccr,11,0) sig_Dec =100*(1-prob_Dec)*

printVarSummary(sig_Dec)

rescn2 = res
rescn2 at cnMinLevelValF = 95
rescn2 at cnMaxLevelValF = 100
rescn2 at cnLevelSpacingF = 5.
rescn2 at cnFillMode = "RasterFill"
plotB=gsn_csm_contour(wks,sig_Dec,rescn2) ; contours are at 95,100

opt = True
opt at gsnShadeFillType = "pattern" ; pattern fill
opt at gsnShadeHigh = 2 ; use pattern #2
*plotB*=gsn_contour_shade(plotB,-999.,95.,opt)

 overlay(*plot,plotB*)
 draw(plot)
 frame(wks)

end

After running the script, the summary and warning displayed as

Variable: ts1
Type: float
Total Size: 141504 bytes
            35376 values
Number of Dimensions: 3
Dimensions and sizes:    [lat | 67] x [lon | 48] x [time | 11]
Coordinates:
            lat: [   5..  38]
            lon: [68.125..97.5]
            time: [3134040..8392920]
Number Of Attributes: 8
  vmin :    -1e+15
  vmax :    1e+15
  fmissing_value :    1e+15
  missing_value :    1e+15
  _FillValue :    1e+15
  units :    kg m-2 s-1


Variable: ts2
Type: float
Total Size: 141504 bytes
            35376 values
Number of Dimensions: 3
Dimensions and sizes:    [lat | 67] x [lon | 48] x [time | 11]
Coordinates:
            lat: [ 5..38]
            lon: [68.125..97.5]
            time: [928806..1016454]
Number Of Attributes: 5
  missing_value :    -32767
  _FillValue :    -32767
  units :    K


Variable: ccr
Type: float
Total Size: 12864 bytes
            3216 values
Number of Dimensions: 2
Dimensions and sizes:    [67] x [48]
Coordinates:
Number Of Attributes: 1
  _FillValue :    1e+15
(0)    min=-0.855062   max=0.561651

Variable: sig_Dec
Type: float
Total Size: 12864 bytes
            3216 values
Number of Dimensions: 2
Dimensions and sizes:    [67] x [48]
Coordinates:
warning:mpMinLonF is not a valid resource in sign_Dec_contour at this time
warning:mpMaxLonF is not a valid resource in sign_Dec_contour at this time
warning:mpMinLatF is not a valid resource in sign_Dec_contour at this time
warning:mpMaxLatF is not a valid resource in sign_Dec_contour at this time
warning:mpShapeMode is not a valid resource in sign_Dec_contour at this time
warning:mpGridLineThicknessF is not a valid resource in sign_Dec_contour at
this time
warning:mpGridSpacingF is not a valid resource in sign_Dec_contour at this
time




In case full script, I have attached it.

please provide some thoughts on that if you have time.

Thank You
---
Kunal Bali



‌
[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality1&>
Sent
with Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality1&>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180530/00053b85/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccr1.ncl
Type: application/octet-stream
Size: 5427 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180530/00053b85/attachment.obj>


More information about the ncl-talk mailing list