docs: def openBiocamFile(filename, verbose=False):
      """Open a Biocam hdf5 file, read and return the recording info, pick te correct method to access raw data, and return this to the caller."""
      rf = h5py.File(filename, 'r')
      # Read recording variables
      recVars = rf.require_group('3BRecInfo/3BRecVars/')
      # bitDepth = recVars['BitDepth'].value[0]
      # maxV = recVars['MaxVolt'].value[0]
      # minV = recVars['MinVolt'].value[0]
      nFrames = recVars['NRecFrames'][0]
      samplingRate = recVars['SamplingRate'][0]
      signalInv = recVars['SignalInversion'][0]
      # Read chip variables
      chipVars = rf.require_group('3BRecInfo/3BMeaChip/')
      nCols = chipVars['NCols'][0]
      # Get the actual number of channels used in the recording
      file_format = rf['3BData'].attrs.get('Version')
      if file_format == 100:
          nRecCh = len(rf['3BData/Raw'][0])
      elif file_format == 101:
          nRecCh = int(1. * rf['3BData/Raw'].shape[0] / nFrames)
      else:
          raise Exception('Unknown data file format.')
  
      if verbose:
          print('# 3Brain data format:', file_format, 'signal inversion', signalInv)
          print('#       signal range: ', recVars['MinVolt'][0], '- ', recVars['MaxVolt'][0])
          print('# channels: ', nRecCh)
          print('# frames: ', nFrames)
          print('# sampling rate: ', samplingRate)
      # get channel locations
      r = rf['3BRecInfo/3BMeaStreams/Raw/Chs'][()]['Row']
      c = rf['3BRecInfo/3BMeaStreams/Raw/Chs'][()]['Col']
      rawIndices = np.vstack((r, c)).T
      # assign channel numbers
      chIndices = np.array([(x - 1) + (y - 1) * nCols for (y, x) in rawIndices])
      # determine correct function to read data
      if verbose:
          print("# Signal inversion looks like " + str(signalInv) + ", guessing correct method for data access.")
          print("# If your results look wrong, signal polarity is may be wrong.")
      if file_format == 100:
          if signalInv == -1:
              read_function = readHDF5t_100
          else:
              read_function = readHDF5t_100_i
      else:
          if signalInv == -1:
              read_function = readHDF5t_101_i
          else:
              read_function = readHDF5t_101
      return (rf, nFrames, samplingRate, nRecCh, chIndices, file_format, signalInv, rawIndices, read_function)