class_docstr: Thread which runs rtl_power_fftw process
docstr: Parse one line of output from rtl_power_fftw
code: def parse_output(self, line):
      """Parse one line of output from rtl_power_fftw"""
      line = line.strip()
  
      # One empty line => new hop
      if not line and self.prev_line:
          self.hop += 1
          self.databuffer["x"].extend(self.databuffer_hop["x"])
          self.databuffer["y"].extend(self.databuffer_hop["y"])
          self.databuffer_hop = {"timestamp": [], "x": [], "y": []}
  
      # Two empty lines => new set
      elif not line and not self.prev_line:
          self.hop = 0
          self.data_storage.update(self.databuffer)
          self.databuffer = {"timestamp": [], "x": [], "y": []}
  
      # Get timestamp for new hop and set
      elif line.startswith("# Acquisition start:"):
          timestamp = line.split(":", 1)[1].strip()
          if not self.databuffer_hop["timestamp"]:
              self.databuffer_hop["timestamp"] = timestamp
          if not self.databuffer["timestamp"]:
              self.databuffer["timestamp"] = timestamp
  
      # Skip other comments
      elif line.startswith("#"):
          pass
  
      # Parse frequency and power
      elif line[0].isdigit():
          freq, power = line.split()
          freq, power = float(freq) + self.lnb_lo, float(power)
          start_freq, stop_freq = self.freqs_crop[self.hop]
  
          # Apply cropping
          if freq >= start_freq and freq <= stop_freq:
              # Skip overlapping frequencies
              if (
                  not self.databuffer["x"]
                  or freq > self.databuffer["x"][-1]
              ):
                  # print("  {:.3f} MHz".format(freq / 1e6))
                  self.databuffer_hop["x"].append(freq)
                  self.databuffer_hop["y"].append(power)
              else:
                  # print("  Overlapping {:.3f} MHz".format(freq / 1e6))
                  pass
          else:
              # print("  Cropping {:.3f} MHz".format(freq / 1e6))
              pass
  
      self.prev_line = line
  
file_path: qspectrumanalyzer/qspectrumanalyzer/backends/rtl_power_fftw.py
imports: import math, shlex
  from Qt import QtCore
  from qspectrumanalyzer import subprocess
  from qspectrumanalyzer.backends import BaseInfo, BasePowerThread
label_desc: Use image node_id 4 for calling the PowerThread obj's underlying member method code with example usage: obj.parse_output(line) without return types