Esempio n. 1
0
    def measure(self, segment, location='center'):
        if location is None:
            return self.__measure_spectrum(segment)

        j = get_location(segment, location)

        data = np.array(segment.spec[:, j], np.float64)
        value = np.sqrt(energy(data) / len(segment.data))

        segment.measures_dict[self.name + '(' + location + ')'] = value
        return True
Esempio n. 2
0
    def __measure_spectrum(self, segment):
        data = np.array(segment.spectrum, np.float64)
        value = np.sqrt(energy(data) / len(segment.data))

        segment.measures_dict[self.name + '(total)'] = value
        return True
Esempio n. 3
0
    def __measure_spectrum(self, segment):
        data = np.array(segment.spectrum)
        value = energy(data)

        segment.measures_dict[self.name + '(total)'] = value
        return True
Esempio n. 4
0
 def measure(self, segment):
     value = np.sqrt(energy(segment.data) / len(segment.data))
     segment.measures_dict[self.name] = value
     return True