Changeset 12915


Ignore:
Timestamp:
Feb 22, 2012, 2:27:11 PM (8 years ago)
Author:
neise
Message:
renamed maxPos, maxAmp & sums --> pulse_amplitude, _time_of_maximum & _integral_simple
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/pyfact/pyfact_rename.py

    r12896 r12915  
    110110        self.v_bsl = np.zeros(self.npix)  # array of baseline values (all ZERO)
    111111        self.data_saverage_out = None
    112         self.maxPos = None
    113         self.maxAmp = None
     112        self.pulse_time_of_maximum = None
     113        self.pulse_amplitude = None
    114114
    115115    def next_event(self):
     
    200200            self.data_saverage_out
    201201        filling arrays:
    202             self.maxPos
    203             self.maxAmp
     202            self.pulse_time_of_maximum
     203            self.pulse_amplitude
    204204
    205205        """
     
    210210            pass
    211211
    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 = maxPos
    215         self.maxAmp = maxAmp
     212        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
    216216
    217217    def sum_around_peak(self, left=13, right=23):
     
    219219
    220220        using:
    221             self.maxPos
     221            self.pulse_time_of_maximum
    222222            self.acal_data
    223223        filling array:
    224             self.sums
     224            self.pulse_integral_simple
    225225           
    226226        """
    227227       
    228         if self.maxPos == None:
     228        if self.pulse_time_of_maximum == None:
    229229            print 'error pyfact.sum_around_peak was called without prior call of find_peak'
    230             print ' variable self.maxPos is needed'
     230            print ' variable self.pulse_time_of_maximum is needed'
    231231            pass
    232232
    233233        # 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)
    235235        for pixel in range(self.npix):
    236             min = self.maxPos[pixel]-left
    237             max = self.maxPos[pixel]+right
    238             sums[pixel] = self.acal_data[pixel,min:max].sum()
    239        
    240         self.sums = sums
     236            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
    241241       
    242242    def baseline_read_values(self, file, bsl_hist='bsl_sum/hplt_mean'):
Note: See TracChangeset for help on using the changeset viewer.