Index: trunk/tools/nc_var_tools.py
===================================================================
--- trunk/tools/nc_var_tools.py	(revision 288)
+++ trunk/tools/nc_var_tools.py	(revision 289)
@@ -10591,19 +10591,19 @@
                 cslicevnoThor = []
 
-                slicev.append(gtrajvals[it,0])
-                if gtrajvals[it,2]-box2 < 0 or gtrajvals[it,2]+box2 + 1 > dimy + 1   \
-                  or gtrajvals[it,1]-box2 < 0 or gtrajvals[it,1]+box2 + 1 > dimx + 1:
+                slicev.append(gtrajvals[it0,0])
+                if gtrajvals[it0,2]-box2 < 0 or gtrajvals[it0,2]+box2 + 1 > dimy + 1 \
+                  or gtrajvals[it0,1]-box2 < 0 or gtrajvals[it0,1]+box2 + 1 > dimx +1:
 # box values
                     slicev.append(slice(0,dimz))
-                    slicev.append(slice(yrangeslice[it][0],yrangeslice[it][1]))
-                    slicev.append(slice(xrangeslice[it][0],xrangeslice[it][1]))
+                    slicev.append(slice(yrangeslice[it0][0],yrangeslice[it0][1]))
+                    slicev.append(slice(xrangeslice[it0][0],xrangeslice[it0][1]))
 
                     slicevnoT.append(slice(0,dimz))
-                    slicevnoT.append(slice(yrangeslice[it][0],yrangeslice[it][1]))
-                    slicevnoT.append(slice(xrangeslice[it][0],xrangeslice[it][1]))
+                    slicevnoT.append(slice(yrangeslice[it0][0],yrangeslice[it0][1]))
+                    slicevnoT.append(slice(xrangeslice[it0][0],xrangeslice[it0][1]))
 
                     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]))
+                    slice2D.append(slice(0,yrangeslice[it0][1]-yrangeslice[it0][0]))
+                    slice2D.append(slice(0,xrangeslice[it0][1]-xrangeslice[it0][0]))
 
                     rvarvalst = np.ones((dimz, Nrad*2+1, Nrad*2+1),dtype=np.float)*  \
@@ -10626,16 +10626,18 @@
                 else:
                     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))
+                    slicev.append(slice(gtrajvals[it0,2]-box2,                       \
+                      gtrajvals[it0,2]+box2+1))
+                    slicev.append(slice(gtrajvals[it0,1]-box2,                       \
+                      gtrajvals[it0,1]+box2+1))
                     slicevnoT.append(slice(0,dimz))
-                    slicevnoT.append(slice(gtrajvals[it,2]-box2, gtrajvals[it,2]+    \
+                    slicevnoT.append(slice(gtrajvals[it0,2]-box2, gtrajvals[it0,2]+  \
                       box2+1))
-                    slicevnoT.append(slice(gtrajvals[it,1]-box2, gtrajvals[it,1]+    \
+                    slicevnoT.append(slice(gtrajvals[it0,1]-box2, gtrajvals[it0,1]+  \
                       box2+1))
                     slice2D.append(slice(0,dimz))
-                    slice2D.append(slice(gtrajvals[it,2]-box2, gtrajvals[it,2]+box2 +\
-                      1))
-                    slice2D.append(slice(gtrajvals[it,1]-box2, gtrajvals[it,1]+box2 +\
-                      1))
+                    slice2D.append(slice(gtrajvals[it0,2]-box2, gtrajvals[it0,2] +   \
+                      box2 + 1))
+                    slice2D.append(slice(gtrajvals[it0,1]-box2, gtrajvals[it0,1] +   \
+                      box2 + 1))
 
                     varvalst = varobj[tuple(slicev)]
@@ -10658,22 +10660,26 @@
 
 # Circle values
-                cslicev.append(gtrajvals[it,0])
-                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(gtrajvals[it0,0])
+                if gtrajvals[it0,2]-Nrad < 0 or gtrajvals[it0,2]+Nrad + 1 > dimy + 1 \
+                  or gtrajvals[it0,1]-Nrad < 0 or gtrajvals[it0,1]+Nrad + 1 > dimx +1:
                     cslicev.append(slice(0,dimz))
-                    cslicev.append(slice(cyrangeslice[it][0],cyrangeslice[it][1]))
-                    cslicev.append(slice(cxrangeslice[it][0],cxrangeslice[it][1]))
+                    cslicev.append(slice(cyrangeslice[it0][0],cyrangeslice[it0][1]))
+                    cslicev.append(slice(cxrangeslice[it0][0],cxrangeslice[it0][1]))
 
                     cslicevnoT.append(slice(0,dimz))
-                    cslicevnoT.append(slice(cyrangeslice[it][0],cyrangeslice[it][1]))
-                    cslicevnoT.append(slice(cxrangeslice[it][0],cxrangeslice[it][1]))
+                    cslicevnoT.append(slice(cyrangeslice[it0][0],                    \
+                      cyrangeslice[it0][1]))
+                    cslicevnoT.append(slice(cxrangeslice[it0][0],                    \
+                      cxrangeslice[it0][1]))
 
                     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]))
-                    cslice2Dhor.append(slice(0, cyrangeslice[it][1] -                \
-                      cyrangeslice[it][0]))
-                    cslice2Dhor.append(slice(0, cxrangeslice[it][1] -                \
-                      cxrangeslice[it][0]))
+                    cslice2D.append(slice(0,cyrangeslice[it0][1]-                    \
+                      cyrangeslice[it0][0]))
+                    cslice2D.append(slice(0,cxrangeslice[it0][1]-                    \
+                      cxrangeslice[it0][0]))
+                    cslice2Dhor.append(slice(0, cyrangeslice[it0][1] -               \
+                      cyrangeslice[it0][0]))
+                    cslice2Dhor.append(slice(0, cxrangeslice[it0][1] -               \
+                      cxrangeslice[it0][0]))
 
                     rvarvalst = np.ones((dimz,Nrad*2+1,Nrad*2+1),dtype=np.float)*    \
@@ -10681,5 +10687,5 @@
                     rvarvalst[tuple(cslice2D)] = varobj[tuple(cslicev)]
                     for iz in range(dimz):
-                        tslice = [slice(it)]+cslice2Dhor
+                        tslice = [slice(it0)]+cslice2Dhor
                         rvarvalst[iz,:,:] = np.where(circdist[tuple(tslice)] >       \
                           np.float(Nrad), fillValue, rvarvalst[iz,:,:]) 
@@ -10701,20 +10707,22 @@
                 else:
                     cslicev.append(slice(0,dimz))
-                    cslicev.append(slice(gtrajvals[it,2]-Nrad,gtrajvals[it,2]+Nrad+1))
-                    cslicev.append(slice(gtrajvals[it,1]-Nrad,gtrajvals[it,1]+Nrad+1))
+                    cslicev.append(slice(gtrajvals[it0,2]-Nrad,gtrajvals[it0,2]+Nrad+\
+                      1))
+                    cslicev.append(slice(gtrajvals[it0,1]-Nrad,gtrajvals[it0,1]+Nrad+\
+                      1))
                     cslicevnoT.append(slice(0,dimz))
-                    cslicevnoT.append(slice(gtrajvals[it,2]-Nrad, gtrajvals[it,2]+   \
+                    cslicevnoT.append(slice(gtrajvals[it0,2]-Nrad, gtrajvals[it0,2]+ \
                       Nrad+1))
-                    cslicevnoT.append(slice(gtrajvals[it,1]-Nrad, gtrajvals[it,1]+   \
+                    cslicevnoT.append(slice(gtrajvals[it0,1]-Nrad, gtrajvals[it0,1]+ \
                       Nrad+1))
-                    cslicevnoThor.append(slice(gtrajvals[it,2]-Nrad, gtrajvals[it,2]+\
+                    cslicevnoThor.append(slice(gtrajvals[it0,2]-Nrad,                \
+                      gtrajvals[it0,2] + Nrad+1))
+                    cslicevnoThor.append(slice(gtrajvals[it0,1]-Nrad,                \
+                      gtrajvals[it0,1] + Nrad+1))
+                    cslice2D.append(slice(0,dimz))
+                    cslice2D.append(slice(gtrajvals[it0,2]-Nrad,gtrajvals[it0,2] +   \
                       Nrad+1))
-                    cslicevnoThor.append(slice(gtrajvals[it,1]-Nrad, gtrajvals[it,1]+\
+                    cslice2D.append(slice(gtrajvals[it0,1]-Nrad,gtrajvals[it0,1] +   \
                       Nrad+1))
-                    cslice2D.append(slice(0,dimz))
-                    cslice2D.append(slice(gtrajvals[it,2]-Nrad,gtrajvals[it,2]+Nrad+ \
-                      1))
-                    cslice2D.append(slice(gtrajvals[it,1]-Nrad,gtrajvals[it,1]+Nrad+ \
-                      1))
 
                     rvarvalst = varobj[tuple(cslicev)]
@@ -10722,5 +10730,5 @@
 # circle values
                     for iz in range(dimz):
-                        tslice = [it]+cslicevnoThor
+                        tslice = [it0]+cslicevnoThor
                         rvarvalst[iz,:,:] = np.where(circdist[tuple(tslice)] >       \
                           np.float(Nrad), fillValue, rvarvalst[iz,:,:]) 
