Changeset 12915
 Timestamp:
 Feb 22, 2012, 2:27:11 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

fact/tools/pyscripts/pyfact/pyfact_rename.py
r12896 r12915 110 110 self.v_bsl = np.zeros(self.npix) # array of baseline values (all ZERO) 111 111 self.data_saverage_out = None 112 self. maxPos= None113 self. maxAmp= None112 self.pulse_time_of_maximum = None 113 self.pulse_amplitude = None 114 114 115 115 def next_event(self): … … 200 200 self.data_saverage_out 201 201 filling arrays: 202 self. maxPos203 self. maxAmp202 self.pulse_time_of_maximum 203 self.pulse_amplitude 204 204 205 205 """ … … 210 210 pass 211 211 212 maxPos= np.argmax( self.data_saverage_out[:,min:max], 1)213 maxAmp= np.max( self.data_saverage_out[:,min:max], 1)214 self. maxPos = maxPos215 self. maxAmp = maxAmp212 pulse_time_of_maximum = np.argmax( self.data_saverage_out[:,min:max], 1) 213 pulse_amplitude = np.max( self.data_saverage_out[:,min:max], 1) 214 self.pulse_time_of_maximum = pulse_time_of_maximum 215 self.pulse_amplitude = pulse_amplitude 216 216 217 217 def sum_around_peak(self, left=13, right=23): … … 219 219 220 220 using: 221 self. maxPos221 self.pulse_time_of_maximum 222 222 self.acal_data 223 223 filling array: 224 self. sums224 self.pulse_integral_simple 225 225 226 226 """ 227 227 228 if self. maxPos== None:228 if self.pulse_time_of_maximum == None: 229 229 print 'error pyfact.sum_around_peak was called without prior call of find_peak' 230 print ' variable self. maxPosis needed'230 print ' variable self.pulse_time_of_maximum is needed' 231 231 pass 232 232 233 233 # find left and right limit and sum the amplitudes in the range 234 sums= np.empty(self.npix)234 pulse_integral_simple = np.empty(self.npix) 235 235 for pixel in range(self.npix): 236 min = self. maxPos[pixel]left237 max = self. maxPos[pixel]+right238 sums[pixel] = self.acal_data[pixel,min:max].sum()239 240 self. sums = sums236 min = self.pulse_time_of_maximum[pixel]left 237 max = self.pulse_time_of_maximum[pixel]+right 238 pulse_integral_simple[pixel] = self.acal_data[pixel,min:max].sum() 239 240 self.pulse_integral_simple = pulse_integral_simple 241 241 242 242 def baseline_read_values(self, file, bsl_hist='bsl_sum/hplt_mean'):
Note: See TracChangeset
for help on using the changeset viewer.