Index: fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py
===================================================================
--- fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py	(revision 13415)
+++ fact/tools/pyscripts/sandbox/kraehenb/CalFitsTest.py	(revision 13416)
@@ -11,4 +11,6 @@
 calibfilename = '/fact/raw/2012/04/17/20120417_003.drs.fits.gz'
 
+import numpy as np
+
 from ROOT import gSystem
 gSystem.Load("calfits_h.so")
@@ -16,4 +18,6 @@
 print "Testing object creation: "
 caltest = CalFits(datafilename,calibfilename)
+npcalevent  = np.empty( caltest.npix * caltest.nroi, np.float64) #.reshape(caltest.npix ,caltest.nroi)
+caltest.SetNpcaldataPtr(npcalevent)
 
 print "Common variables:"
@@ -45,5 +49,7 @@
 
 #while caltest.GetCalEvent():
-#    print caltest.event_id, caltest.event_triggertype, caltest.event_caldata[0]
+#    if caltest.event_id>10:
+#        break
+#    print caltest.event_id, caltest.event_triggertype, caltest.event_caldata[10]
 #print
 
Index: fact/tools/pyscripts/sandbox/kraehenb/calfits.h
===================================================================
--- fact/tools/pyscripts/sandbox/kraehenb/calfits.h	(revision 13415)
+++ fact/tools/pyscripts/sandbox/kraehenb/calfits.h	(revision 13416)
@@ -78,8 +78,10 @@
 	vector<int32_t> event_boardtimes;
 	vector<float> event_caldata; //Vector for calibrated event
+	double* npcaldata;
 	
 	CalFits(const string &datafilename, const string &calibfilename) //Constructor with two filenames
 		: datafile(datafilename),
-			calibfile(calibfilename)
+			calibfile(calibfilename),
+			npcaldata(NULL)
 	{
 		//Read basic parameters of the two files
@@ -124,7 +126,4 @@
 		calibfile.GetRow(0);
 		
-		//Get the column sizes per pixel
-		//...
-		
 		//Set the event pointers
 //		std::cout << "...Setting event pointers..." << std::endl;
@@ -145,4 +144,14 @@
 	bool GetCalEvent()
 	{
+		if(!npcaldata) {
+			ostringstream str;
+			str << "Pointer to the calibrated data not initialized!";
+#ifdef __EXCEPTIONS
+			throw runtime_error(str.str());
+#else
+			gLog << ___err___ << "ERROR - " << str.str() << endl;
+			return false;
+#endif
+		}
 		if(datafile.GetNextRow() == false) {
 //			std::cout << "Last event reached..." << std::endl;
@@ -154,5 +163,6 @@
 				for(UInt_t slice=0;slice<data_nroi;slice++) {
 					drs_calib_offset = (slice+event_offset[pixel])%calib_blm_size;
-					event_caldata[pixel*data_nroi+slice] = float((event_data[pixel*data_nroi+slice]*2000./4096.-calib_baselinemean[pixel*calib_blm_size+drs_calib_offset]-calib_triggeroffsetmean[pixel*data_nroi+slice])/calib_gainmean[pixel*calib_blm_size+drs_calib_offset]*1907.35);
+					npcaldata[pixel*data_nroi+slice] = double((event_data[pixel*data_nroi+slice]*2000./4096.-calib_baselinemean[pixel*calib_blm_size+drs_calib_offset]-calib_triggeroffsetmean[pixel*data_nroi+slice])/calib_gainmean[pixel*calib_blm_size+drs_calib_offset]*1907.35);
+//					event_caldata[pixel*data_nroi+slice] = float((event_data[pixel*data_nroi+slice]*2000./4096.-calib_baselinemean[pixel*calib_blm_size+drs_calib_offset]-calib_triggeroffsetmean[pixel*data_nroi+slice])/calib_gainmean[pixel*calib_blm_size+drs_calib_offset]*1907.35);
 					//Note: data_nroi=calib_nroi, calib_blm_size=calib_gm_size
 				}
@@ -161,4 +171,10 @@
 		return true;
 	}
+	
+	void SetNpcaldataPtr(double *ptr)
+	{
+		npcaldata = ptr;
+		return;
+	}
 };
 #endif
