Index: /trunk/tools/nc_var_tools.py
===================================================================
--- /trunk/tools/nc_var_tools.py	(revision 283)
+++ /trunk/tools/nc_var_tools.py	(revision 284)
@@ -10564,13 +10564,13 @@
                   or gtrajvals[it,1]-box2 < 0 or gtrajvals[it,1]+box2 + 1 > dimx + 1:
 # box values
-                    slicev.append(slice(0,dimz)
+                    slicev.append(slice(0,dimz))
                     slicev.append(slice(yrangeslice[it][0],yrangeslice[it][1]))
                     slicev.append(slice(xrangeslice[it][0],xrangeslice[it][1]))
 
-                    slicevnoT.append(slice(0,dimz)
+                    slicevnoT.append(slice(0,dimz))
                     slicevnoT.append(slice(yrangeslice[it][0],yrangeslice[it][1]))
                     slicevnoT.append(slice(xrangeslice[it][0],xrangeslice[it][1]))
 
-                    slice2D.append(slice(0,dimz)
+                    slice2D.append(slice(0,dimz))
                     slice2D.append(slice(0,yrangeslice[it][1]-yrangeslice[it][0]))
                     slice2D.append(slice(0,xrangeslice[it][1]-xrangeslice[it][0]))
@@ -10594,13 +10594,13 @@
 
                 else:
-                    slicev.append(slice(0,dimz)
+                    slicev.append(slice(0,dimz))
                     slicev.append(slice(gtrajvals[it,2]-box2, gtrajvals[it,2]+box2+1))
                     slicev.append(slice(gtrajvals[it,1]-box2, gtrajvals[it,1]+box2+1))
-                    slicevnoT.append(slice(0,dimz)
+                    slicevnoT.append(slice(0,dimz))
                     slicevnoT.append(slice(gtrajvals[it,2]-box2, gtrajvals[it,2]+    \
                       box2+1))
                     slicevnoT.append(slice(gtrajvals[it,1]-box2, gtrajvals[it,1]+    \
                       box2+1))
-                    slice2D.append(slice(0,dimz)
+                    slice2D.append(slice(0,dimz))
                     slice2D.append(slice(gtrajvals[it,2]-box2, gtrajvals[it,2]+box2 +\
                       1))
@@ -10616,11 +10616,12 @@
 
 # box stats values
-                    statvarvals[it,:,0] = varvalst[box2,box2]
-                    statvarvals[it,:,1] = np.min(varvalst)
-                    statvarvals[it,:,2] = np.max(varvalst)
-                    statvarvals[it,:,3] = np.mean(varvalst)
-                    statvarvals[it,:,4] = np.mean(varvalst*varvalst)
-                    statvarvals[it,:,5] = np.sqrt(statvarvals[it,:,4] -              \
-                      statvarvals[it,:,3]*statvarvals[it,:,3])
+                    statvarvals[it,:,0] = varvalst[:,box2,box2]
+                    for iz in range(dimz):
+                        statvarvals[it,iz,1] = np.min(varvalst[iz,:,:])
+                        statvarvals[it,iz,2] = np.max(varvalst[iz,:,:])
+                        statvarvals[it,iz,3] = np.mean(varvalst[iz,:,:])
+                        statvarvals[it,iz,4] = np.mean(varvalst*varvalst[iz,:,:])
+                        statvarvals[it,iz,5] = np.sqrt(statvarvals[it,iz,4] -        \
+                          statvarvals[it,iz,3]*statvarvals[it,iz,3])
 
 # Circle values
@@ -10628,13 +10629,13 @@
                 if gtrajvals[it,2]-Nrad < 0 or gtrajvals[it,2]+Nrad + 1 > dimy + 1   \
                   or gtrajvals[it,1]-Nrad < 0 or gtrajvals[it,1]+Nrad + 1 > dimx + 1:
-                    cslicev.append(slice(0,dimz)
+                    cslicev.append(slice(0,dimz))
                     cslicev.append(slice(cyrangeslice[it][0],cyrangeslice[it][1]))
                     cslicev.append(slice(cxrangeslice[it][0],cxrangeslice[it][1]))
 
-                    cslicevnoT.append(slice(0,dimz)
+                    cslicevnoT.append(slice(0,dimz))
                     cslicevnoT.append(slice(cyrangeslice[it][0],cyrangeslice[it][1]))
                     cslicevnoT.append(slice(cxrangeslice[it][0],cxrangeslice[it][1]))
 
-                    cslice2D.append(slice(0,dimz)
+                    cslice2D.append(slice(0,dimz))
                     cslice2D.append(slice(0,cyrangeslice[it][1]-cyrangeslice[it][0]))
                     cslice2D.append(slice(0,cxrangeslice[it][1]-cxrangeslice[it][0]))
@@ -10650,12 +10651,13 @@
 # circle stats values
                     maskedvals = ma.masked_values (rvarvalst, fillValue)
-                    rstatvarvals[it,:,0] = rvarvalst[Nrad,Nrad]
-                    rstatvarvals[it,:,1] = maskedvals.min()
-                    rstatvarvals[it,:,2] = maskedvals.max()
-                    rstatvarvals[it,:,3] = maskedvals.mean()
                     maskedvals2 = maskedvals*maskedvals
-                    rstatvarvals[it,:,4] = maskedvals2.mean()
-                    rstatvarvals[it,:,5] = np.sqrt(rstatvarvals[it,:,4] -            \
-                      rstatvarvals[it,:,3]*rstatvarvals[it,:,3])
+                    rtatvarvals[it,:,0] = varvalst[:,box2,box2]
+                    for iz in range(dimz):
+                        rtatvarvals[it,iz,1] = np.min(varvalst[iz,:,:])
+                        rtatvarvals[it,iz,2] = np.max(varvalst[iz,:,:])
+                        rtatvarvals[it,iz,3] = np.mean(varvalst[iz,:,:])
+                        rtatvarvals[it,iz,4] = maskedvals2[iz,:,:].mean()
+                        rtatvarvals[it,iz,5] = np.sqrt(rstatvarvals[it,iz,4] -       \
+                          rstatvarvals[it,iz,3]*rstatvarvals[it,iz,3])
 
                 else:
