def _create_properties_(self):
        p = Derived_UTS_Dataset._create_properties_(self)
        c = self.compiled
        F = c['F']
        n = c['n']

        p['data_type'] = 'spec'
        
        samplingrate = self.parent.samplingrate
        offset_insamples = c['offset']
        p['samplingrate'] = samplingrate / offset_insamples
        
        p['t0'] = p['t0'] - (self.p.window_length.in_seconds(samplingrate) / 2)
        
        # data shape
        p['ndim'] = 2
        shape = p['shape'][:]
        if shape[0] == None:
            length = None
        else:
            length = (shape[0] - n) // offset_insamples
        p['shape'] = (length, ) + shape[1:] + F.shape
        
        freq = F * (samplingrate / n)
        p['frequencies'] = freq
        
#        info = ["{n} (d{s}) _compile:".format(n=self.name, s=self.id),
#                "  > _window {w}, {s}".format(w=self.p.window.get(), 
#                                              s=window.shape)]
#        logging.info('\n'.join(info))
        return p
    def _create_properties_(self):
        p = Derived_UTS_Dataset._create_properties_(self)
        
        # TODO: shape
#        sr = self.parent.samplingrate
#        p['segmented'] = True
#        # shape
#        old_shape = p['shape']
#        length = self.p.tend.in_samples(sr) - self.p.tstart.in_samples(sr)
#        new_shape = (length, ) + old_shape[1:]
#        p['shape'] = new_shape
        
        return p
    def _create_properties_(self):
        p = Derived_UTS_Dataset._create_properties_(self)
        c = self.compiled
        sr = self.parent.samplingrate

        p['t0'] = self.p.pre.in_seconds(sr)
        # shape
        p['segmented'] = True
        old_shape = p['shape']
        length = c['pre'] + c['post']
        new_shape = (length, ) + old_shape[1:]
        p['shape'] = new_shape
        
        return p
 def __init__(self, data, events, name="segmentation"):
     assert events['data_type'] == 'event'
     Derived_UTS_Dataset.__init__(self, data, name=name)
     self.parent_events = events
     events.children.append(self)