code: def svd_to_stream(uvectors, stachans, k, sampling_rate):
      
      svstreams = []
      for i in range(k):
          svstream = []
          for j, stachan in enumerate(stachans):
              if len(uvectors[j]) <= k:
                  warnings.warn('Too few traces at %s for a %02d dimensional '
                                'subspace. Detector streams will not include '
                                'this channel.' % ('.'.join(stachan[0],
                                                            stachan[1]), k))
              else:
                  svstream.append(Trace(uvectors[j][i],
                                        header={'station': stachan[0],
                                                'channel': stachan[1],
                                                'sampling_rate': sampling_rate}))
          svstreams.append(Stream(svstream))
      return svstreams
docs: Convert the singular vectors output by SVD to streams.
  
      One stream will be generated for each singular vector level,
      for all channels.  Useful for plotting, and aiding seismologists thinking
      of waveforms!
  
      :type svectors: list
      :param svectors: List of :class:`numpy.ndarray` Singular vectors
      :type stachans: list
      :param stachans: List of station.channel Strings
      :type k: int
      :param k: Number of streams to return = number of SV's to include
      :type sampling_rate: float
      :param sampling_rate: Sampling rate in Hz
  
      :returns:
          svstreams, List of :class:`obspy.core.stream.Stream`, with
          svStreams[0] being composed of the highest rank singular vectors.