code: def find_initial_offset(self, pyramids=6):
          
          flow = self.video.flow
          gyro_rate = self.parameter['gyro_rate']
          frame_times = np.arange(len(flow)) / self.video.frame_rate
          gyro_times = np.arange(self.gyro.num_samples) / gyro_rate
          time_offset = timesync.sync_camera_gyro(flow, frame_times, self.gyro.data.T, gyro_times, levels=pyramids)
          
          logger.debug("Initial time offset: {:.4f}".format(time_offset))
          self.params['initialized']['time_offset'] = time_offset
          
          return time_offset
docs: Estimate time offset
          
          This sets and returns the initial time offset estimation.
          
          Parameters
          ---------------
          pyramids : int
              Number of pyramids to use for ZNCC calculations.
              If initial estimation of time offset fails, try lowering this value.
  
          Returns
          ---------------
          float
              Estimated time offset