Index: fact/tools/pyscripts/examples/plotcam.py
===================================================================
--- fact/tools/pyscripts/examples/plotcam.py	(revision 12867)
+++ fact/tools/pyscripts/examples/plotcam.py	(revision 12868)
@@ -3,56 +3,74 @@
 import numpy.ma as ma
 
-def plotcam():
-    chid, y,x,xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)
-    fig = plt.figure()
-    ax = fig.add_subplot(111, aspect='equal')
-    H = (6,0,30./180.*3.1415926)
-    ax.scatter(xe,ye,s=40,alpha=0.75,marker=H, linewidths=0.)
-    plt.show()
+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)
+        
+    def plotcam():
+        data = np.random.rand(1440)
+        chid, y,x,xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)
+        fig = plt.figure()
+        ax = fig.add_subplot(121, aspect='equal')
+        bx = fig.add_subplot(122, aspect='equal')
+        
+        H = (6,0,30./180.*3.1415926)
+        
+        ax.scatter( xe, ye , s=40 , alpha=0.75 , marker=H , linewidths=0.)
+        bx.scatter( xe, ye , s=40 , alpha=0.75 , marker=H , linewidths=0., c=data)
+        plt.show()
 
-def plotincam( data ):
-    chid, y,x,xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)
-    fig = plt.figure()
-    ax = fig.add_subplot(111, aspect='equal')
-    H = (6,0,30./180.*3.1415926)
-    ax.scatter(xe,ye,s=40,alpha=0.75,marker=H, c=data)
-    plt.show()
+    def plotincam( data ):
+        ax = fig.add_subplot(aspect='equal')
+        ax.scatter(xe,ye,s=40,alpha=0.75,marker=H, c=data)
+        plt.show()
 
-def plotmaskedcam( thr):
-    chid, y,x,xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)
-    data = np.random.rand(1440)
-    mdata = ma.masked_greater(data, thr)
-    fig = plt.figure()
-    ax = fig.add_subplot(111, aspect='equal')
-    H = (6,0,30./180.*3.1415926)
-    
-    a = ma.masked_where(mdata.mask == True, xe)
-    b = ma.masked_where(mdata.mask == True, ye)
-    
-    xm = a.compressed()
-    ym = b.compressed()
-    dm = mdata.compressed()
-    
-    print xm
-    print ym
-    print dm
-    ax.scatter(xe,ye,s=80,alpha=0.75,marker=H, c=data, edgecolors='none')
-    ax.scatter( xm, ym ,s=80,alpha=1,marker=H,facecolors='none',linewidths=3)
-    plt.show()
+    def plotmaskedcam( thr):
+        chid, y,x,xe,ye,yh,xh,softid,hardid = np.loadtxt("map_dn.txt",unpack=True)
+        data = np.random.rand(1440)
+        mdata = ma.masked_greater(data, thr)
+        fig = plt.figure()
+        ax = fig.add_subplot(111, aspect='equal')
+        H = (6,0,30./180.*3.1415926)
+        
+        a = ma.masked_where(mdata.mask == True, xe)
+        b = ma.masked_where(mdata.mask == True, ye)
+        
+        xm = a.compressed()
+        ym = b.compressed()
+        dm = mdata.compressed()
+        
+        print xm
+        print ym
+        print dm
+        ax.scatter(xe,ye,s=80,alpha=0.75,marker=H, c=data, edgecolors='none')
+        ax.scatter( xm, ym ,s=80,alpha=1,marker=H,facecolors='none',linewidths=3)
+        plt.show()
 
 
-def randomcam():
-    data = np.random.rand(1440)
-    plotincam( data )
+    def randomcam():
+        data = np.random.rand(1440)
+        plotincam( data )
 
 
-# uncomment what ever you like to test.
 
-# plotcam()  #plot an empty cam .. 
-# randomcam() # plot a cam filled with random data
 
- fun = np.linspace(0,1,1440)
- plotincam( fun )
 
-#plotmaskedcam( 0.15 )
+if __name__ == '__main__':
+    """
+    create an instance
+    """
+    cplt = camplotter()
+    # np.savez ( filename, amplitude=maxAmp, time=maxPos, integral=integ)
+    npz = np.load('test.npz')
+    print npz.files
 
+    data = npz['integral']
+    print 'data.shape', data.shape()
+
+    for event in data:
+        print 'event.shape', event.shape()
+
Index: fact/tools/pyscripts/examples/produce_npz.py
===================================================================
--- fact/tools/pyscripts/examples/produce_npz.py	(revision 12867)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#!/usr/bin/python
-#
-# Dominik Neise
-# TU Dortmund
-#
-# test for freshly implemented methods in pyfact.
-# subject to frequent change!
-
-from pyfact import *
-#from savecam import *
-
-name='20111124_081'
-dfname = '/data03/fact-construction/raw/2011/11/24/'+name+'.fits'
-calfname = '/data03/fact-construction/raw/2011/11/24/20111124_071.drs.fits'
-# access the data
-rd = rawdata( dfname, calfname )
-
-print 'dfname:  ', dfname
-print 'calfname:', calfname
-print 'NEvents: ', rd.NEvents
-
-def loop_acal( Neve = 1000 ):
-    """
-    bla
-    """
-    if rd.NEvents < Neve:
-        print 'data file contains not enough events'
-        exit( 0 )
-    else:
-        for i in range( Neve ):
-            if (np.mod(i,100)==0) :
-                print 'Event: ', i
-            rd.next()
-            
-            rd.filterSlidingAverage()
-#            print rd.smoothData
-            rd.filterCFD()
-#            print rd.cfdData
-            rd.findPeak()
-            list_maxPos.append(rd.maxPos)
-            list_maxAmp.append(rd.maxAmp)
-            rd.sumAroundPeak()
-            list_integral.append(rd.integral)
-#            plotincam(rd.integral, 'evt_'+str(i)+'.pdf')
-            #print len(rd.maxPos)
-            #print len(rd.maxAmp)
-#            print 'Trigger Type', rd.trigType
-
-#print (rd.filterSlidingAverage.__doc__)
-#print (rd.filterCFD.__doc__)
-#print (rd.findPeak.__doc__)
-#print (rd.sumAroundPeak.__doc__)
-
-list_maxPos = []
-list_maxAmp = []
-list_integral = []
-loop_acal(rd.NEvents)
-maxAmp = np.vstack(list_maxAmp)
-maxPos = np.vstack(list_maxPos)
-integ = np.vstack(list_integral)
-
-np.savez(name+'.npz', amplitude=maxAmp, time=maxPos, integral=integ)
