code: def find_trigger_value(psd_var, idx, start, sample_rate):
      
  
      # Find gps time of the trigger
      time = start + idx / sample_rate
      # Find where in the psd variation time series the trigger belongs
      ind = numpy.digitize(time, psd_var.sample_times)
      ind -= 1
      vals = psd_var[ind]
      return vals
docs: Find the PSD variation value at a particular time
  
      Parameters
      ----------
      psd_var : TimeSeries
          Time series of the varaibility in the PSD estimation
      idx : numpy.ndarray
          Time indices of the triggers
      start : float
          GPS start time
      sample_rate : float
          Sample rate defined in ini file
  
      Returns
      -------
      vals : Array
          PSD variation value at a particular time