Index: fact/tools/pyscripts/pyfact/plotters.py
===================================================================
--- fact/tools/pyscripts/pyfact/plotters.py	(revision 13080)
+++ fact/tools/pyscripts/pyfact/plotters.py	(revision 13090)
@@ -128,4 +128,7 @@
         #handle masked case specially
         if mask!= None:
+            if len(mask)==0:
+                return
+            
             if mask.dtype == bool and data.ndim ==1 and len(mask)==1440:
                 length = mask.sum()
@@ -178,53 +181,53 @@
         else: # i.e. when mask is None
         # handle 1D and 2D case differently
-        if data.ndim == 1 and len(data)==1440:
-            result = self.ax.scatter(xe,ye,s=25,alpha=1,
-                        c=data, marker=H, linewidths=0., vmin=vmin, vmax=vmax)
-            self.figure.colorbar( result, shrink=0.8, pad=-0.04 )
-            plt.draw()
-            
-        elif data.ndim == 2 and data.shape[0] == 2 and data.shape[1] <=1440:
-            # I assume the first row of data, contains the CHIDs 
-            # and the 2nd row contains the actual data.
-            chids = data[0]
-            # check if there are double chids in chids
-            if len(chids)!=len(set(chids)):
-                print 'warning: there are doubled chids in input data',
-                print 'you might want to plot something else, but I plot it anyway...'
-                print chids
-            data = data[1]
-            # now I have to mask the xe, and ye vectors accordingly
-            mxe = np.empty( len(chids) )
-            mye = np.empty( len(chids) )
-            for i,chid in enumerate(chids):
-                mxe[i] = xe[chid]
-                mye[i] = ye[chid]
-            
-            # check if I did it right
-            if len(mxe)!=len(data) or len(mye)!=len(data):
-                print 'the masking did not work:'
-                print 'len(mxe)', len(mxe)
-                print 'len(mye)', len(mye)
-                print 'len(data)', len(data)
-            
-            self.ax.axis([-22,22,-22,22])
-            self.ax.set_title(name)
-            self.ax.grid(grid)
-            # the next line is a stupid hack
-            # I plot invisible pixels, so that the axes show look ok.
-            # this must be possible differently, but I don't know how...
-            self.ax.scatter(xe,ye,s=25,alpha=0,marker=H)
-            
-            result = self.ax.scatter(mxe,mye,s=25,alpha=1.,
-                        c=data, marker=H, linewidths=0., vmin=vmin, vmax=vmax)
-            self.figure.colorbar( result, shrink=0.8, pad=-0.04 )
-            plt.draw()
-            
-        else:
-            print 'CamPlotter call input data has bad format'
-            print 'data.ndim', data.ndim
-            print 'data.shape', data.shape
-            print 'data:----------------------------------'
-            print data
+            if data.ndim == 1 and len(data)==1440:
+                result = self.ax.scatter(xe,ye,s=25,alpha=1,
+                            c=data, marker=H, linewidths=0., vmin=vmin, vmax=vmax)
+                self.figure.colorbar( result, shrink=0.8, pad=-0.04 )
+                plt.draw()
+                
+            elif data.ndim == 2 and data.shape[0] == 2 and data.shape[1] <=1440:
+                # I assume the first row of data, contains the CHIDs 
+                # and the 2nd row contains the actual data.
+                chids = data[0]
+                # check if there are double chids in chids
+                if len(chids)!=len(set(chids)):
+                    print 'warning: there are doubled chids in input data',
+                    print 'you might want to plot something else, but I plot it anyway...'
+                    print chids
+                data = data[1]
+                # now I have to mask the xe, and ye vectors accordingly
+                mxe = np.empty( len(chids) )
+                mye = np.empty( len(chids) )
+                for i,chid in enumerate(chids):
+                    mxe[i] = xe[chid]
+                    mye[i] = ye[chid]
+                
+                # check if I did it right
+                if len(mxe)!=len(data) or len(mye)!=len(data):
+                    print 'the masking did not work:'
+                    print 'len(mxe)', len(mxe)
+                    print 'len(mye)', len(mye)
+                    print 'len(data)', len(data)
+                
+                self.ax.axis([-22,22,-22,22])
+                self.ax.set_title(name)
+                self.ax.grid(grid)
+                # the next line is a stupid hack
+                # I plot invisible pixels, so that the axes show look ok.
+                # this must be possible differently, but I don't know how...
+                self.ax.scatter(xe,ye,s=25,alpha=0,marker=H)
+                
+                result = self.ax.scatter(mxe,mye,s=25,alpha=1.,
+                            c=data, marker=H, linewidths=0., vmin=vmin, vmax=vmax)
+                self.figure.colorbar( result, shrink=0.8, pad=-0.04 )
+                plt.draw()
+                
+            else:
+                print 'CamPlotter call input data has bad format'
+                print 'data.ndim', data.ndim
+                print 'data.shape', data.shape
+                print 'data:----------------------------------'
+                print data
         
         
