Exemple #1
0
def get_all_isi_epoch(session,area,unit,epoch):
    '''
    Returns the durations of all ISI intervals from the given session, area,
    unit, and epoch
    '''
    all_isi = []
    for trial in cgid.data_loader.get_valid_trials(session,area):
        spk = get_spikes_epoch(session,area,unit,trial,epoch)
        isi = diff(spk)
        all_isi.extend(isi)
    return array(all_isi)
Exemple #2
0
def get_all_ibi_epoch(session,area,unit,epoch,thr):
    if dowarn(): print 'note: threshold is in ms, defaults to 5'
    all_ibi = []
    if thr==None: thr=5
    for trial in cgid.data_loader.get_valid_trials(session,area):
        spk   = get_spikes_epoch(session,area,unit,trial,epoch)
        if spk==None:
            warn('ERROR %s %s %s %s'%(session,area,unit,epoch))
            assert 0
        if len(spk)<2: continue
        isi   = diff(spk)
        burst = spk[find(isi<=thr)]
        if len(burst)>2:
            all_ibi.extend(diff(burst))
    return array(all_ibi)
Exemple #3
0
def get_all_ibi_merged_epoch(session,area,unit,epoch,thr):
    if dowarn(): print 'note: threshold is in ms, defaults to 5'
    if dowarn(): print 'note: misses burst if starts on 1st spike, TODOFIX'
    all_ibi = []
    if thr==None: thr=5
    for trial in cgid.data_loader.get_valid_trials(session,area):
        spk   = get_spikes_epoch(session,area,unit,trial,epoch)
        if spk==None:
            warn('ERROR %s %s %s %s'%(session,area,unit,epoch))
            assert 0
        if len(spk)<3: continue
        isi   = diff(spk)
        short = isi<thr
        burst = spk[find(diff(int32(short))==1)+1]
        if len(burst)>2:
            all_ibi.extend(diff(burst))
    return array(all_ibi)