Index: /trunk/tools/nc_var_tools.py
===================================================================
--- /trunk/tools/nc_var_tools.py	(revision 284)
+++ /trunk/tools/nc_var_tools.py	(revision 285)
@@ -10584,13 +10584,13 @@
 # box stats values
                     maskedvals = ma.masked_values (varvalst, fillValue)
-                    statvarvals[it,:,0] = varvalst[box2,box2]
-                    statvarvals[it,:,1] = maskedvals.min()
-                    statvarvals[it,:,2] = maskedvals.max()
-                    statvarvals[it,:,3] = maskedvals.mean()
                     maskedvals2 = maskedvals*maskedvals
-                    statvarvals[it,:,4] = maskedvals2.mean()
-                    statvarvals[it,:,5] = np.sqrt(statvarvals[it,:,4] -              \
-                      statvarvals[it,:,3]*statvarvals[it,:,3])
-
+                    for iz in range(dimz):
+                        statvarvals[it,iz,0] = varvalst[iz,box2,box2]
+                        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] = maskedvals2[iz,:,:].mean()
+                        statvarvals[it,iz,5] = np.sqrt(statvarvals[it,iz,4] -        \
+                          statvarvals[it,iz,3]*statvarvals[it,iz,3])
                 else:
                     slicev.append(slice(0,dimz))
@@ -10616,10 +10616,11 @@
 
 # box stats values
-                    statvarvals[it,:,0] = varvalst[:,box2,box2]
                     for iz in range(dimz):
+                        statvarvals[it,:,0] = varvalst[:,box2,box2]
                         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,4] = np.mean(varvalst[iz,:,:]*             \
+                          varvalst[iz,:,:])
                         statvarvals[it,iz,5] = np.sqrt(statvarvals[it,iz,4] -        \
                           statvarvals[it,iz,3]*statvarvals[it,iz,3])
@@ -10652,6 +10653,6 @@
                     maskedvals = ma.masked_values (rvarvalst, fillValue)
                     maskedvals2 = maskedvals*maskedvals
-                    rtatvarvals[it,:,0] = varvalst[:,box2,box2]
                     for iz in range(dimz):
+                        rtatvarvals[it,:,0] = varvalst[:,box2,box2]
                         rtatvarvals[it,iz,1] = np.min(varvalst[iz,:,:])
                         rtatvarvals[it,iz,2] = np.max(varvalst[iz,:,:])
@@ -10685,12 +10686,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])
+                    for iz in range(dimz):
+                        rstatvarvals[it,iz,0] = rvarvalst[iz,Nrad,Nrad]
+                        rstatvarvals[it,iz,1] = maskedvals.min()
+                        rstatvarvals[it,iz,2] = maskedvals.max()
+                        rstatvarvals[it,iz,3] = maskedvals.mean()
+                        rstatvarvals[it,iz,4] = maskedvals2[iz,:,:].mean()
+                        rstatvarvals[it,iz,5] = np.sqrt(rstatvarvals[it,iz,4] -      \
+                          rstatvarvals[it,iz,3]*rstatvarvals[it,:,3])
 
 #            print 'statistics:',rstatvarvals[it,:] 
