 '5'],
                        ['clustering', 'decimation', 'bool', 'True'],
                        ['detection', 'jitter_range', 'float', '0.1'],
                        ['detection','smoothing', 'bool', 'False'],
                        ['detection','smoothing_factor', 'float', '0.25']]

    def __init__(self, file_name, create_folders=True, **kwargs):

        self.file_name    = os.path.abspath(file_name)
        f_next, extension = os.path.splitext(self.file_name)
        file_path         = os.path.dirname(self.file_name)
        self.file_params  = f_next + '.params'
        self.do_folders   = create_folders
        self.parser       = configparser.ConfigParser()

        ## First, we remove all tabulations from the parameter file, in order
        ## to secure the parser
        if comm.rank == 0:
            myfile            = open(self.file_params, 'r')
            lines             = myfile.readlines()
            myfile.close()
            myfile            = open(self.file_params, 'w')
            for l in lines:
              myfile.write(l.replace('\t', ''))
            myfile.close()

        comm.Barrier()

        self._N_t         = None

        if not os.path.exists(self.file_params):
            if comm.rank == 0:
                print_and_log(["%s does not exist" %self.file_params], 'error', logger)
            sys.exit(0)

        if comm.rank == 0:
            print_and_log(['Creating a Circus Parser for datafile %s' %self.file_name], 'debug', logger)
        self.parser.read(self.file_params)

        for section in self.__all_sections__:
            if self.parser.has_section(section):
                for (key, value) in self.parser.items(section):
                    self.parser.set(section, key, value.split('#')[0].rstrip())
            else:
                self.parser.add_section(section)

        for item in self.__default_values__ + self.__extra_values__:
            section, name, val_type, value = item
            try:
                if val_type is 'bool':
                    self.parser.getboolean(section, name)
                elif val_type is 'int':
                    self.parser.getint(section, name)
                elif val_type is 'float':
                    self.parser.getfloat(section, name)
                elif val_type is'string':
                    self.parser.get(section, name)
            except Exception:
                self.parser.set(section, name, value)

        for key, value in list(kwargs.items()):
            for section in self.__all_sections__:
                if key in self.parser._sections[section]:
                    self.parser._sections[section][key] = value

        if self.do_folders and self.parser.get('data', 'output_dir') == '':
            try:
                os.makedirs(f_next)
            except Exception:
                pass

        self.parser.set('data', 'data_file', self.file_name)

        if self.parser.get('data', 'output_dir')!= '':
          path = os.path.abspath(os.path.expanduser(self.parser.get('data', 'output_dir')))
          self.parser.set('data', 'output_dir', path)
          file_out = os.path.join(path, os.path.basename(f_next))
          if not os.path.exists(file_out) and self.do_folders:
            os.makedirs(file_out)
          self.logfile      = file_out + '.log'
        else:
          file_out = os.path.join(f_next, os.path.basename(f_next))
          self.logfile      = f_next + '.log'
        
        self.parser.set('data', 'data_file_no_overwrite', file_out + '_all_sc.dat')
        self.parser.set('data', 'file_out', file_out) # Output file without suffix
        self.parser.set('data', 'file_out_suff', file_out + self.parser.get('data','suffix')) # Output file with suffix
        self.parser.set('data', 'data_file_noext', f_next)   # Data file (assuming.filtered at the end)

        self.probe = read_probe(self.parser)

        dead_channels = self.parser.get('detection', 'dead_channels')
        if dead_channels!= '':
          dead_channels = parse_dead_channels(dead_channels)
          if comm.rank == 0:
            print_and_log(["Removing dead channels %s" %str(dead_channels)], 'debug', logger)
          for key in list(dead_channels.keys()):            
            if key in list(self.probe["channel_groups"].keys()):
              for channel in dead_channels[key]:
                n_before = len(self.probe["channel_groups"][key]['channels'])
                self.probe["channel_groups"][key]['channels'] = list(set(self.probe["channel_groups"][key]['channels']).difference(dead_channels[key]))
                n_after = len(self.probe["channel_groups"][key]['channels'])
            else:
              if comm.rank == 0:
                print_and_log(["Probe has no group named %s for dead channels" %key], 'debug', logger)

        N_e = 0
        for key in list(self.probe['channel_groups'].keys()):
            N_e += len(self.probe['channel_groups'][key]['channels'])

        self.set('data', 'N_e', str(N_e))
        self.set('data', 'N_total', str(self.probe['total_nb_channels']))
        self.set('data', 'nb_channels', str(self.probe['total_nb_channels']))
        self.nb_channels = self.probe['total_nb_channels']

        if N_e > self.nb_channels:
            if comm.rank == 0:
                print_and_log(['The number of analyzed channels is higher than the number of recorded channels'], 'error', logger)
            sys.exit(0)

        if N_e == 1 and self.parser.getboolean('filtering','remove_median'):
          if comm.rank == 0:
            print_and_log(["With 1 channel, remove_median in [filtering] is not possible"], 'error', logger)
          sys.exit(0)  

        to_write = ["You must specify explicitly the file format in the config file",
                    "Please have a look to the documentation and add a file_format",
                    "parameter in the [data] section. Valid files formats can be:", '']
        try:
            self.file_format = self.parser.get('data', 'file_format')
        except Exception:
            if comm.rank == 0:
                for f in list(__supported_data_files__.keys()):
                    to_write += ['-- %s -- %s' %(f, __supported_data_files__[f].extension)]

                to_write += ['', "To get more info on a given file format, see",
                    ">> spyking-circus file_format -i"]

                print_and_log(to_write, 'error', logger)
            sys.exit(0)

        test = self.file_format.lower() in list(__supported_data_files__.keys())
        if not test:
            if comm.rank == 0:
                for f in list(__supported_data_files__.keys()):
                    to_write += ['-- %s -- %s' %(f, __supported_data_files__[f].extension)]

                to_write += ['', "To get more info on a given file format, see",
                    ">> spyking-circus file_format -i"]

                print_and_log(to_write, 'error', logger)
            sys.exit(0)


        try:
            self.parser.get('detection', 'radius')
        except Exception:
            self.parser.set('detection', 'radius', 'auto')
        try:
            self.parser.getint('detection', 'radius')
        except Exception