Index: fact/tools/pyscripts/camplotter.py
===================================================================
--- fact/tools/pyscripts/camplotter.py	(revision 12872)
+++ fact/tools/pyscripts/camplotter.py	(revision 12872)
@@ -0,0 +1,110 @@
+import matplotlib.pyplot as plt
+import numpy as np
+import numpy.ma as ma
+import os, sys
+
+class camplotter( object ):
+    def __init__( self ):
+        chid, y,x,xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)
+        self.fig = plt.figure()
+        self.xe = xe
+        self.ye = ye
+        self.H = (6,0,30./180.*3.1415926)
+
+
+
+
+#########################################################################
+#########################################################################
+
+if __name__ == '__main__':
+    
+    inputfname = 'nofile.npz'
+    
+    if (len(sys.argv) > 1):
+        inputfname = sys.argv[1]
+    else:
+        print 'Usage ', sys.argv[0], 'input-file-path'
+        exit (0)
+        
+    cplt = camplotter()
+    # np.savez ( filename, amplitude=maxAmp, time=maxPos, integral=integ)
+    npz = np.load( inputfname )
+    print npz.files
+
+    amp = npz['amplitude']
+    int = npz['integral']
+    tim = npz['time']
+    
+    files = []
+    fig = plt.figure(figsize=(24,16))
+#    plt.title('left amplitude ... right integral')
+    ax1 = fig.add_subplot(231, aspect='equal')
+    ax2 = fig.add_subplot(232, aspect='equal')
+    ax3 = fig.add_subplot(233, aspect='equal')
+    ax4 = fig.add_subplot(234)
+    ax5 = fig.add_subplot(235)
+    ax6 = fig.add_subplot(236)
+    
+    ax1.grid(True)
+    ax2.grid(True)
+    ax3.grid(True)
+    ax4.grid(True)
+    ax5.grid(True)
+    ax6.grid(True)
+    
+    thr = 40.
+    
+    print '------------ thr=', thr, '-------------------'
+    print '------------', len(amp[:,0]), '-------------------'
+
+#    for i in range(len(data[:,0])):
+    os.system("mkdir -p pngs")
+    for i in range(50):
+        
+        mamp = ma.masked_less(amp[i,:], thr)
+        mx = ma.masked_where(mamp.mask == True, cplt.xe)
+        my = ma.masked_where(mamp.mask == True, cplt.ye)
+        
+        ax1.cla()
+        ax2.cla()
+        ax3.cla()
+        ax1.scatter(cplt.xe,cplt.ye,s=65,alpha=0.75,marker=cplt.H, c=amp[i,:], edgecolors='none', label='amp')
+        ax1.scatter(mx.compressed() , my.compressed() ,s=65,alpha=0.75,marker=cplt.H, facecolors='none', linewidths=3, edgecolors='r')
+        ax1.axis([-22,22,-22,22])
+        
+        ax2.scatter(cplt.xe,cplt.ye,s=70,alpha=0.75,marker=cplt.H, c=int[i,:], edgecolors='none', label='inte')
+        ax2.axis([-22,22,-22,22])
+        ax3.scatter(cplt.xe,cplt.ye,s=70,alpha=0.75,marker=cplt.H, c=tim[i,:], edgecolors='none', label='time')
+        ax3.axis([-22,22,-22,22])
+        
+        ax4.cla()
+        ax4.hist(amp[i,:], 100, facecolor='r', alpha=0.75)
+        ax4.set_yscale("log", nonposy='clip')
+
+        ax5.cla()
+        ax5.hist(int[i,:], 100, facecolor='g', alpha=0.75)
+        ax5.set_yscale("log", nonposy='clip')
+
+        ax6.cla()
+        ax6.hist(tim[i,:], 100,facecolor='b', alpha=0.75)
+        ax6.set_yscale("log", nonposy='clip')
+        
+        
+        
+        fname = 'pngs/_tmp%03d.png'%i
+        print 'Saving frame', fname
+        fig.savefig(fname)
+        
+        files.append(fname)
+
+    # in order to make a movie using mencoder   -- uncomment the following two lines
+    # 
+    #print 'Making movie animation.mpg - this make take a while'
+    #os.system("mencoder 'mf://pngs/_tmp*.png' -mf type=png:fps=2 -ovc lavc -lavcopts vcodec=wmv2 -oac copy -o animation.mpg")
+    
+    # in order to make an animated gif using ImageMagick   -- uncomment the following two lines
+    #
+    #print 'Making animated gif animation.gif - this make take a while'
+    #os.system("convert -delay 33 -loop 0 pngs/_tmp*.png animation.gif")
+    
