Index: /fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py
===================================================================
--- /fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py	(revision 13450)
+++ /fact/tools/pyscripts/sandbox/kraehenb/CalFitsPerformanceWeave.py	(revision 13451)
@@ -12,5 +12,4 @@
 
 import numpy as np
-import itertools
 from scipy import weave
 from scipy.weave import converters
@@ -51,9 +50,5 @@
 caltest.datafile.PrintColumns()
 
-def offsum(x,y):
-    return np.sum(npcalevent[x,y+5:y+15])
-vecoffsum = np.vectorize(offsum) #specifying otypes=[np.float/double] does not improve speed
-
-#AND WE HAVE A WINNER: 35 Hz with scipy.weave!
+#AND WE HAVE A WINNER: 43 Hz with scipy.weave!
 while caltest.GetCalEvent():
     c_integrals = np.zeros(40000, np.float64) #Allocate the memory for about 40000 singles
@@ -83,7 +78,7 @@
     }
 //    std::cout << std::endl << singles << std::endl;
-    
     """
     weave.inline(cppcode, ['c_integrals', 'npcalevent'], type_converters=converters.blitz)
+    
 #    print "CalFitsPerformanceWeave"
 #    for i in range(10):
@@ -92,19 +87,4 @@
 #        if x:
 #            print x,
-    
-#    npcalevent = npcalevent.reshape((caltest.npix, caltest.nroi))
-#    npthr = npcalevent>2.5 #true if above threshold
-#    npthr = npthr[:,1:-14] * np.logical_not(npthr[:,:-15]) #only true for the zero crossings, shape (1400,285) [smaller due to necessary integration range]
-##    print [(x,y) for x,y in zip(npthr.nonzero()[0],npthr.nonzero()[1])] #print the coordinates, range 0-1399,0-284
-#    
-#    #Various versions to get the integral, all with approximately the same miserable speed (3 Hz), except for the last one (vectorized function) with ~4.3 Hz
-#    #Missing: add deadtime after an integration, remove start & end of the array
-##    integrals = [np.sum(npcalevent[x,y+5:y+15]) for x,y in np.transpose(npthr.nonzero())]
-##    integrals = [np.sum(npcalevent[x,y+5:y+15]) for x,y in zip(npthr.nonzero()[0],npthr.nonzero()[1])]
-##    integrals = [np.sum(npcalevent[x,y+5:y+15]) for x,y in itertools.izip(npthr.nonzero()[0],npthr.nonzero()[1])]
-##    integrals = map((lambda index_a,index_b: np.sum(npcalevent[index_a,index_b+5:index_b+15])),npthr.nonzero()[0],npthr.nonzero()[1])
-#    integrals = vecoffsum(npthr.nonzero()[0],npthr.nonzero()[1])
-#    print len(integrals)
-    
 #    print caltest.event_id, caltest.event_triggertype, caltest.event_caldata[10]
 #    pass
Index: /fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py
===================================================================
--- /fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py	(revision 13450)
+++ /fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py	(revision 13451)
@@ -29,4 +29,5 @@
 print "Information per Event:"
 caltest.GetCalEvent()
+print "Calibrated data in numpy array: ", npcalevent
 print "Event ID: ", caltest.event_id
 print "Trigger type: ", caltest.event_triggertype
Index: /fact/tools/pyscripts/sandbox/kraehenb/calfits.h
===================================================================
--- /fact/tools/pyscripts/sandbox/kraehenb/calfits.h	(revision 13450)
+++ /fact/tools/pyscripts/sandbox/kraehenb/calfits.h	(revision 13451)
@@ -21,5 +21,5 @@
 //********************************
 
-//ToDo: alle Event-Parameter zugänglich, shared library creation debuggen
+//ToDo: shared library creation debuggen
 
 #ifndef CALFITS_H
@@ -69,4 +69,5 @@
 	float* calib_gainmean;
 	float* calib_triggeroffsetmean;
+	//Using <vector> instead of arrays makes no visible difference
 	//ToDo: use arrays of size 1440x1024 (x2 for wrap-arounds) and read all variables into those
 	
@@ -140,5 +141,5 @@
 	}
 	
-	~CalFits()
+	~CalFits() //Standard destructor
 	{
 		delete[] calib_baselinemean;
@@ -150,5 +151,5 @@
 	}
 	
-	bool GetCalEvent()
+	bool GetCalEvent() //Read calibrated event into the event variables
 	{
 		if(!npcaldata) {
@@ -179,7 +180,7 @@
 	}
 	
-	void SetNpcaldataPtr(double *ptr)
+	void SetNpcaldataPtr(double *numpyptr) //Set the pointer for the calibrated data to the numpy array
 	{
-		npcaldata = ptr;
+		npcaldata = numpyptr;
 		return;
 	}
