Exemplo n.º 1
0
 def locate_peaks(self):
     from hyperspy import peak_char as pc
     peaks=[]
     for idx in xrange(self.numfiles):
         self.CC = cv_funcs.xcorr(self.sig.data[self.top:self.top+self.tmp_size,
                                            self.left:self.left+self.tmp_size,self.tmp_img_idx],
                                            self.sig.data[:,:,idx])
         # peak finder needs peaks greater than 1.  Multiply by 255 to scale them.
         pks=pc.two_dim_findpeaks(self.CC*255, peak_width=self.peak_width, medfilt_radius=None)
         pks[:,2]=pks[:,2]/255.
         peaks.append(pks)
     self.peaks=peaks
Exemplo n.º 2
0
 def locate_peaks(self):
     from hyperspy import peak_char as pc
     peaks = []
     for idx in xrange(self.numfiles):
         self.CC = cv_funcs.xcorr(
             self.sig.data[self.top:self.top + self.tmp_size,
                           self.left:self.left + self.tmp_size,
                           self.tmp_img_idx], self.sig.data[:, :, idx])
         # peak finder needs peaks greater than 1.  Multiply by 255 to scale them.
         pks = pc.two_dim_findpeaks(self.CC * 255,
                                    peak_width=self.peak_width,
                                    medfilt_radius=None)
         pks[:, 2] = pks[:, 2] / 255.
         peaks.append(pks)
     self.peaks = peaks
Exemplo n.º 3
0
 def locate_peaks(self):
     from hyperspy import peak_char as pc
     peaks=[]
     """from hyperspy.misc.progressbar import ProgressBar, \
         Percentage, RotatingMarker, ETA, Bar
     widgets = ['Locating peaks: ', Percentage(), ' ', Bar(marker=RotatingMarker()),
                ' ', ETA()]
     pbar = ProgressBar(widgets=widgets, maxval=100).start()"""
     progress = ProgressDialog(title="Peak finder progress", message="Finding peaks on %s images"%self.numfiles, max=self.numfiles, show_time=True, can_cancel=False)
     progress.open()
     for idx in xrange(self.numfiles):
         #pbar.update(float(idx)/self.numfiles*100)
         self.CC = cv_funcs.xcorr(self.sig.data[self.tmp_img_idx,
                                                self.top:self.top+self.tmp_size,
                                                self.left:self.left+self.tmp_size],
                                            self.sig.data[idx,:,:])
         # peak finder needs peaks greater than 1.  Multiply by 255 to scale them.
         pks=pc.two_dim_findpeaks(self.CC*255, peak_width=self.peak_width, medfilt_radius=None)
         pks[:,2]=pks[:,2]/255.
         peaks.append(pks)
         progress.update(idx+1)
     #pbar.finish()
     self.peaks=peaks