예제 #1
0
def opto_get_all_lfp_analytic_quick(opto_dataset,fa,fb):
    Fs = 1000.0
    order = 4
    data = metaloadmat(opto_dataset_compact)['lfp']
    data = data.transpose((0,2,1))
    data = bandfilter(hilbert(data),fa,fb,Fs,order)
    return data
예제 #2
0
def opto_get_lfp_filtered(opto_dataset,channel,fa,fb,order=4):
    '''
    Retrieves channel or channels from opto LFP dataset
    Channels are 1-indexed
    
    Parameters
    ----------
    opto_dataset : string
        path or string identifier for a dataset
    channel:
        1-indexed channel ID or None to return a NTimes x NChannel array
        of all LFP data
    fa:
        low frequency of band-pass, or 'None' to use a low-pass filter.
        if fb is 'None' then this is the cutoff for a high-pass filter.
    fb:
        high-frequency of band-pass, or 'None to use a high-pass filter.
        if fa is 'None' then this is the cutoff for a low-pass filter
    '''
    Fs = opto_get_Fs(opto_dataset)
    if channel is None:
        data = metaloadmat(opto_dataset)['LFP'].T
        #return array([bandfilter(x,fa,fb,Fs,order) for x in data])
        problems = [(i,x,fa,fb,Fs,order) for i,x in enumerate(data)]
        data = np.array(parmap(__opto_get_lfp_filtered_helper__,problems))
        return squeeze(data)
    else:
        assert channel>=1
        data = metaloadmat(opto_dataset)['LFP'][:,channel-1]
        return bandfilter(data,fa,fb,Fs,order)
예제 #3
0
def __opto_get_lfp_filtered_helper__((i,data,fa,fb,Fs,order)):
    return i,bandfilter(data,fa,fb,Fs,order)
예제 #4
0
def __opto_get_lfp_analytic_helper__((i,data,fa,fb,Fs,order)):
    '''
    Parallel function wrapper for opto_get_lfp_analytic
    '''
    print 5,i
    return i,hilbert(bandfilter(data,fa,fb,Fs,order))