[ncl-talk] error with ftest

Lyndz olagueralyndonmark429 at gmail.com
Sun Apr 29 02:23:23 MDT 2018


Dear NCL-experts,

I am trying to perform an F-test. Here are the files:

*Link to File 1: *
https://drive.google.com/file/d/1BCKb7UdM50ckVqIvhnSbO9tkyMK0DmiF/view?usp=sharing

*Link to File 2:*
https://drive.google.com/file/d/1YtYd4hTIUC3tupaAm4oc69xhilkP9qcj/view?usp=sharing

Here's my script:

a  = addfile("P45P50_bpass_mean_anom_1979-1993.nc","r")
fa = a->xBPF

b  = addfile("P45P50_bpass_mean_anom_1994-2008.nc","r")
fb = b->xBPF

xtmp = fa(lat|:,lon|:,time|:)
ttmp = fb(lat|:,lon|:,time|:)

xVar = dim_variance (xtmp)
yVar = dim_variance (ytmp)

sigr = 0.05
xEqv = equiv_sample_size (xtmp, sigr,0)
yEqv = equiv_sample_size (ytmp, sigr,0)

nlat = 73
gwt  = latGauWgt(nlat, "lat", "gaussian weights", "")  ; 72 points

xN   = wgt_areaave (xEqv, gwt, 1., 0)
yN   = wgt_areaave (yEqv, gwt, 1., 0)

sigf = 0.10
prob = ftest(xVar,xN, yVar,yN, False)


Here's the *printVarSummary* of fa:

Variable: fa
Type: float
Total Size: 630720 bytes
            157680 values
Number of Dimensions: 3
Dimensions and sizes: [time | 15] x [lat | 73] x [lon | 144]
Coordinates:
            time: [1574700..1697436]
            lat: [90..-90]
            lon: [ 0..357.5]
Number Of Attributes: 5
  long_name : Lanczos Bpassfilt
  units : W m-2
  _FillValue : 32766
  missing_value : 32766
  wgt_runave_op_ncl : wgt_runave_n


After the *gwt* I encounter the following errors:

fatal:wgt_areaave: wgty must be a scalar or a 1-dimensional vector the same
size as the second-to-the-last dimension of x
fatal:["Execute.c":8638]:Execute: Error occurred at or near line 19


Any suggestion on how to do this correctly in NCL?

I'll appreciate any help.

Sincerely,

Lyndz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180429/b268d56b/attachment.html>


More information about the ncl-talk mailing list