def on_timer(self):
        """Callback function triggered by SidTimer every 'log_interval' seconds"""
        # current_index is the position in the buffer calculated from current UTC time
        current_index = self.timer.data_index
        utc_now = self.timer.utc_now
        # clear the View to prepare for new data display
        self.viewer.clear()

        # Get new data and pass them to the View
        message = "%s  [%d]  Capturing data..." % (self.timer.get_utc_now(), current_index)
        self.viewer.status_display(message, level=1)

        try:
            data = self.sampler.capture_1sec()  # return a list of 1 second signal strength
            Pxx, freqs = self.psd(data, self.sampler.NFFT, self.sampler.audio_sampling_rate)
        except __HOLE__ as idxerr:
            print("Index Error:", idxerr)
            print("Data len:", len(data))

        signal_strengths = []
        for binSample in self.sampler.monitored_bins:
            signal_strengths.append(Pxx[binSample])

        # ensure that one thread at the time accesses the sid_file's' buffers
        with self.timer.lock:
            # Save signal strengths into memory buffers ; prepare message for status bar
            message = self.timer.get_utc_now() + "  [%d]  " % current_index
            message += "%d" % (self.scan_end_time - self.timer.time_now)
            for station, strength in zip(self.config.stations, signal_strengths):
                station['raw_buffer'][current_index] = strength
            self.logger.sid_file.timestamp[current_index] = utc_now

            # did we complete the expected scanning duration?
            if self.timer.time_now >= self.scan_end_time:
                fileName = "scanner_buffers.raw.ext.%s.csv" % (self.logger.sid_file.sid_params['utc_starttime'][:10])
                fsaved = self.save_current_buffers(filename=fileName, log_type='raw', log_format='supersid_extended')
                print(fsaved,"saved.")
                self.close()
                exit(0)

        # end of this thread/need to handle to View to display captured data & message
        self.viewer.status_display(message, level=2)
dataset/ETHPy150Open ericgibert/supersid/supersid/supersid_scanner.py/SuperSID_scanner.on_timer