Changeset 13121
- Timestamp:
- 03/15/12 21:41:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/pyfact/pyfact_rename.py
r13076 r13121 27 27 """ 28 28 29 def __init__(self, data_file_name, 30 calib_file_name, baseline_file_name=''): 29 def __init__(self, data_file_name, calib_file_name, 30 user_action_calib=lambda acal_data, data, blm, tom, gm, scells, nroi: None, 31 baseline_file_name=''): 31 32 """ initialize object 32 33 … … 44 45 self.calib_file_name = calib_file_name 45 46 self.baseline_file_name = baseline_file_name 47 48 self.user_action_calib = user_action_calib 46 49 47 50 # baseline correction: True / False … … 133 136 134 137 #print 'nevents = ', self.nevents, 'event_id = ', self.event_id.value 138 135 139 return self.acal_data, self.start_cells, self.trigger_type.value 136 140 … … 161 165 # rotate the pixel baseline mean to the Data startCell 162 166 blm_pixel = np.roll( blm[pixel,:], -self.start_cells[pixel] ) 167 tom_pixel = np.roll( tom[pixel,:], -self.start_cells[pixel] ) 168 gm_pixel = np.roll( gm[pixel,:], -self.start_cells[pixel] ) 163 169 acal_data[pixel,:] -= blm_pixel[0:self.nroi] 164 acal_data[pixel,:] -= tom [pixel,0:self.nroi]165 acal_data[pixel,:] /= gm [pixel,0:self.nroi]170 acal_data[pixel,:] -= tom_pixel[0:self.nroi] 171 acal_data[pixel,:] /= gm_pixel[0:self.nroi] 166 172 167 173 self.acal_data = acal_data * 1907.35 174 175 #print 'blm _pyfact', blm[0,0:20] 176 #t = np.roll( blm[0,:], -self.start_cells[0] ) 177 #print 'blm _pyfact', t[0:20] 178 #print 'start_pyfact: ', self.start_cells[0] 179 #print 'acal _pyfact: ', self.acal_data[0,0:10] 180 #t = np.roll( gm[0,:], -self.start_cells[0] ) 181 #print 'gm _pyfact: ', t[0:10] 182 self.user_action_calib( self.acal_data, 183 np.reshape(self.data, (self.npix, self.nroi) ), blm, tom, gm, self.start_cells, self.nroi) 168 184 169 185 … … 289 305 """ test for function __iter__ """ 290 306 291 data_file_name = '/data00/fact-construction/raw/2011/11/24/20111124_111.fits.gz' 292 calib_file_name = '/data00/fact-construction/raw/2011/11/24/20111124_111.drs.fits.gz' 307 # data_file_name = '/data00/fact-construction/raw/2011/11/24/20111124_111.fits.gz' 308 # calib_file_name = data_file_name = 309 data_file_name = '/home/luster/win7/FACT/data/raw/20120114/20120114_028.fits.gz' 310 calib_file_name = '/home/luster/win7/FACT/data/raw/20120114/20120114_022.drs.fits.gz' 293 311 run = RawData( data_file_name, calib_file_name ) 294 312
Note:
See TracChangeset
for help on using the changeset viewer.