code: def _read_hdr_dir(self):
          
          foldername = Path(self.filename)
          stc_file = foldername / (foldername.stem + '.stc')
  
          if stc_file.exists():
              self._filename = stc_file.with_suffix('')
  
          else:  # if the folder was renamed
              stc_file = list(foldername.glob('*.stc'))
              if len(stc_file) == 1:
                  self._filename = foldername / stc_file[0].stem
              elif len(stc_file) == 0:
                  raise FileNotFoundError('Could not find any .stc file.')
              else:
                  raise OSError('Found too many .stc files: ' +
                                '\n'.join(str(x) for x in stc_file))
  
          hdr = {}
          # use .erd because it has extra info, such as sampling freq
          # try to read any possible ERD (in case one or two ERD are missing)
          # don't read very first erd because creation_time is slightly off
          for erd_file in foldername.glob(self._filename.stem + '_*.erd'):
              try:
                  hdr['erd'] = _read_hdr_file(erd_file)
                  # we need this to look up stc
                  hdr['erd'].update({'filename': erd_file.stem})
                  break
  
              except (FileNotFoundError, PermissionError):
                  pass
  
          stc = _read_stc(self._filename.with_suffix('.stc'))
  
          hdr['stc'], hdr['stamps'] = stc
  
          return hdr
docs: Read the header for basic information.
  
          Returns
          -------
          hdr : dict
            - 'erd': header of .erd file
            - 'stc': general part of .stc file
            - 'stamps' : time stamp for each file
  
          Also, it adds the attribute
          _basename : Path
              the name of the files inside the directory