class_docstr: Data storage for spectrum measurements
docstr: Recalculate current data from history
code: def recalculate_data(self):
      """Recalculate current data from history"""
      if self.history is None:
          return
  
      history = self.history.get_buffer()
      if self.smooth:
          self.y = self.smooth_data(history[-1])
          self.average_counter = 0
          self.average = self.y.copy()
          self.peak_hold_max = self.y.copy()
          self.peak_hold_min = self.y.copy()
          for y in history[:-1]:
              self.average_counter += 1
              y = self.smooth_data(y)
              self.average = np.average(
                  (self.average, y),
                  axis=0,
                  weights=(self.average_counter - 1, 1),
              )
              self.peak_hold_max = np.maximum(self.peak_hold_max, y)
              self.peak_hold_min = np.minimum(self.peak_hold_min, y)
      else:
          self.y = history[-1]
          self.average_counter = self.history.history_size
          self.average = np.average(history, axis=0)
          self.peak_hold_max = history.max(axis=0)
          self.peak_hold_min = history.min(axis=0)
  
      self.data_recalculated.emit(self)
  
imports: import time, sys, os
  from Qt import QtCore
  import numpy
  from qspectrumanalyzer.utils import smooth
  from qspectrumanalyzer.backends import soapy_power
label_desc: Use image node_id 16 for calling the DataStorage obj's underlying member method code with example usage: obj.recalculate_data() without return types