[ncl-talk] Error number dimensions ttest funcion

Noelia otero noeli1680 at gmail.com
Wed Nov 19 13:11:10 MST 2014


Hi,

I am having problems with the ttest function, the error is:

fatal:ttest: If s1 is not a scalar, then it must have the same number of
dimensions as ave1, var1, ave2, and var2

I don't understand very much this error, I would like to ask you what I am
missing here.

This is a piece of the code:
        ua_ncep = u_ncep->uwnd(1:42,1,:,:) ;select 925 level
        ;Averages
        ave_ua_ncep=dim_avg(ua_ncep(lat|:,lon|:,time|:))
        ;Variances
        Var_ua_ncep = dim_variance (ua_ncep(lat|:,lon|:,time|:))         ;
calculate variances
        ;Defining sizes
        sX   = dimsizes (ave_ua_ncep)
        ;Model
        ua_model = uFiles[i]->ua(1:42,1,:,:)  ;plevel 1=925 plevel 9=200
        ;Time averages
        ave_ua_model=dim_avg(ua_model(lat|:,lon|:,time|:))
        ;Variances
        Var_ua_model = dim_variance (ua_model(lat|:,lon|:,time|:))    ;
calculate   var.
        sY=dimsizes(ave_ua_model)
        iflag=False
        ;Significance levels:
   prob = ttest(ave_ua_ncep,Var_ua_ncep^2,sX,
ave_ua_model,Var_ua_model^2,sY, iflag, False) ;using STD

I also wanted to ask you, in this case, would it be necessary to use
wgt_areaave
<https://www.ncl.ucar.edu/Document/Functions/Built-in/wgt_areaave.shtml>?

Many thanks in advance,


Cheers,


Noelia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141119/1c94f9b0/attachment.html 


More information about the ncl-talk mailing list