# Ttest plot problems

From: brownmc AT uci.edu
Date: Wed Sep 14 2005 - 15:34:15 MDT

Hi all,
I am having trouble making a ttest plot to show where my precipitation
data is statitically significant. With the script below I recieve error
messages that say: (0) check_for_y_lat_coord: Warning: Data either
does not contain a valid latitude coordinate array or doesn't contain one
at all. A valid latitude coordinate array should have a 'units' attribute
equal
to one of the following values:'degrees_north' 'degrees-north'
'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N'
'degreeN' 'degreesN'

It does this for longitude also. Any advice on how to make this work or
comments on a better script would be greatly appreciated.Thanks

Mike Brown

Script:
begin
a =
b =
u = a->pr(:,:,:)
v = b->pr(:,:,:)
siglvl = 0.05
aveX = avg(u)
aveY = avg(v)
varX = variance (u)
varY = variance (v)
sX = dimsizes (u)
sY = dimsizes (v)
iflag = False
dimXY = dimsizes(u)
ntim = dimXY(0)
mlon = dimXY(1)
nlat = dimXY(2)
xtmp = u;(lat|:,lon|:,time|:) ; reorder but do it only once
[temporary]
ytmp = v;(lat|:,lon|:,time|:)
xAve = dim_avg (xtmp) ; calculate means at each grid point
yAve = dim_avg (ytmp)
xVar = dim_variance (xtmp) ; calculate variances
yVar = dim_variance (ytmp)
sigr = 0.05 ; critical sig lvl for r
xEqv = equiv_sample_size (xtmp, sigr,0)
yEqv = equiv_sample_size (ytmp, sigr,0)
wgty = 1.
xN = wgt_areaave (xEqv, wgty, 1., 0) ; wgty could be gaussian weights
yN = wgt_areaave (yEqv, wgty, 1., 0)
iflag= False ; population variance similar
prob = ttest(xAve,xVar,xN, yAve,yVar,yN, iflag, False)
wks = gsn_open_wks ("ps", "conOncon" )
res2 = True ; res2 probability plots
res2@gsnDraw = False ; Do not draw plot
res2@gsnFrame = False ; Do not advance frome
res2@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res2@cnMinLevelValF = 0.00 ; set min contour level
res2@cnMaxLevelValF = 1.05 ; set max contour level
res2@cnLevelSpacingF = 0.05 ; set contour spacing
res2@cnInfoLabelOn = True ; turn off info label
res2@cnLinesOn = False ; do not draw contour lines
res2@cnLineLabelsOn = True ; do not draw contour labels
res2@cnFillScaleF = 0.6 ; add extra density
plot = gsn_csm_contour_map(wks,prob(:,:),res2)
draw(plot)
frame(wks)
end

_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

This archive was generated by hypermail 2b29 : Thu Sep 15 2005 - 09:56:44 MDT