Changeset 13380 for fact/tools/pyscripts/pyfact
- Timestamp:
- 04/18/12 17:07:40 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/pyfact/pyfact.py
r13375 r13380 83 83 user_action_calib=lambda acal_data, data, blm, tom, gm, scells, nroi: None, 84 84 baseline_file_name='', 85 return_dict = None): 85 return_dict = None, 86 do_calibration = True): 86 87 """ initialize object 87 88 … … 107 108 print 'and some time later, the option will not be supported anymore' 108 109 return_dict = False 109 110 110 self.return_dict = return_dict 111 111 112 self.do_calibration = do_calibration 113 112 114 self.data_file_name = data_file_name 113 115 self.calib_file_name = calib_file_name … … 198 200 raise StopIteration 199 201 else: 200 self.calibrate_drs_amplitude() 202 if self.do_calibration == True: 203 self.calibrate_drs_amplitude() 201 204 202 205 #print 'nevents = ', self.nevents, 'event_id = ', self.event_id.value … … 229 232 gm = np.reshape(self.gm, (self.npix, self.Ngm) ) 230 233 234 # double the calibration constants 235 blm = np.hstack((blm,blm)) 236 gm = np.hstack((gm,gm)) 237 231 238 for pixel in range( self.npix ): 232 239 # rotate the pixel baseline mean to the Data startCell 233 blm_pixel = np.roll( blm[pixel,:], -self.start_cells[pixel] ) 240 #blm_pixel = np.roll( blm[pixel,:], -self.start_cells[pixel] ) 241 blm_pixel = blm[pixel, self.start_cells[pixel]:self.start_cells[pixel]+self.nroi] 234 242 # rotate the pixel gain mean to the Data startCell 235 gm_pixel = np.roll( gm[pixel,:], -self.start_cells[pixel] ) 243 #gm_pixel = np.roll( gm[pixel,:], -self.start_cells[pixel] ) 244 gm_pixel = gm[pixel, self.start_cells[pixel]:self.start_cells[pixel]+self.nroi] 236 245 # the 'trigger offset mean' does not need to be rolled 237 246 # on the contrary, it seems there is an offset in the DRS data, 238 247 # which is related to its distance to the startCell, not to its 239 248 # distance to the beginning of the physical pipeline in the DRS chip 240 tom_pixel = tom[pixel, :]249 tom_pixel = tom[pixel,0:self.nroi ] 241 250 242 acal_data[pixel,:] -= blm_pixel [0:self.nroi]243 acal_data[pixel,:] -= tom_pixel [0:self.nroi]244 acal_data[pixel,:] /= gm_pixel [0:self.nroi]251 acal_data[pixel,:] -= blm_pixel 252 acal_data[pixel,:] -= tom_pixel 253 acal_data[pixel,:] /= gm_pixel 245 254 246 255 self.acal_data = acal_data * 1907.35
Note:
See TracChangeset
for help on using the changeset viewer.