<div dir="ltr"><div><div>Hi all,<br><br></div>I would like to plot t-test figure, between the average of future and the average of the present periods. Both period consist of 2 continuous days as follow:<br><br></div><div>Future: 01 to 02 January 2100 <br></div><div>Present: 01 to 02 Janaury 2010<br><br></div>Could anyone help me on this? Your help is highly appreciated. <br><div><div><div><br><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;script;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br></div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br><br>begin<br>   a1 = addfile(&quot;./JAN2100/01-05/wrfout_d02_2100-01-01_00:00:00&quot;,&quot;r&quot;)<br>   a2 = addfile(&quot;./JAN2100/01-05/wrfout_d02_2100-01-02_00:00:00&quot;,&quot;r&quot;)<br><br>   b1 = addfile(&quot;./JAN2010/01-05/wrfout_d02_2010-01-01_00:00:00&quot;,&quot;r&quot;)<br>   b2 = addfile(&quot;./JAN2010/01-05/wrfout_d02_2010-01-02_00:00:00&quot;,&quot;r&quot;)<br><br>  wks = gsn_open_wks(&quot;x11&quot;,&quot;T-test1-90%&quot;)<br>        gsn_define_colormap(wks,&quot;BlAqGrYeOrReVi200&quot;)            ; Create a plot workstation<br><br>  opts = True                                      ; Set some Basic Plot options<br>  opts@MainTitle = &quot;GEOGRID FIELDS&quot;<br>  opts@InitTime = False                            ; Do not plot time or footers<br>  opts@Footer = False<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Get the Variables;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br><br>tempa1 = a1-&gt;T2<br>tempa2 = a2-&gt;T2<br><br>tempb1 = b1-&gt;T2<br>tempb2 = b2-&gt;T2<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;Calculate average and variance for Future;;;;;;;;;;;;;;;;;;;;<br><br>aveX1 = dim_avg_n_Wrap(tempa1,0)  ; average over the 0th dim<br>varX1 = dim_variance_n_Wrap(tempa1,0) ; compute variance<br><br>aveX2 = dim_avg_n_Wrap(tempa2,0)  ; average over the 0th dim<br>varX2 = dim_variance_n_Wrap(tempa2,0) ; compute variance<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;Calculate average and variance for Present;;;;;;;;;;;;;;;;;;;;<br><br>aveY1 = dim_avg_n_Wrap(tempb1,0)  ; average over the 0th dim<br>varY1 = dim_variance_n_Wrap(tempb1,0) ; compute variance<br><br>aveY2 = dim_avg_n_Wrap(tempb2,0)  ; average over the 0th dim<br>varY2 = dim_variance_n_Wrap(tempb2,0) ; compute variance<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;Do T-Test for 1st day and 2nd day;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br><br>alphat1 = 100.*(1. - ttest(aveX1,varX1,24, aveY1,varY1,24, True, False))<br>aveX1 = where(alphat1.lt.90.,aveX1@_FillValue, aveX1)<br><br>alphat2 = 100.*(1. - ttest(aveX2,varX2,24, aveY2,varY2,24, True, False))<br>aveX2 = where(alphat2.lt.90.,aveX2@_FillValue, aveX2)<br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;Do T-Test for the average of 1st and 2nd days;;;;;;;;;;;;;;;;;;<br><br>result = (alphat1 + alphat2)/2<br>;result = (aveX1 + aveX2)/2<br><br></div></div></div></div>