'Collect DACQ averaging categories into a dict.
Categories are keyed by the comment field in DACQ. Each category is
itself represented a dict containing the category parameters.'

def _categories_from_acq_pars(self):

    cats = dict()
    for catnum in [str(x).zfill(2) for x in range(1, (self.nevent + 1))]:
        catdi = dict()
        for var in self._cat_vars:
            acq_key = (('ERFcat' + var) + catnum)
            class_key = var.lower()
            val = self.acq_dict[acq_key]
            catdi[class_key] = val
        catdi['display'] = (catdi['display'] == '1')
        catdi['state'] = (catdi['state'] == '1')
        for key in ['start', 'end', 'reqwithin']:
            catdi[key] = float(catdi[key])
        for key in ['nave', 'event', 'reqevent', 'reqwhen', 'subave']:
            catdi[key] = int(catdi[key])
        catdi['index'] = int(catnum)
        cats[catdi['comment']] = catdi
    return cats
