コード例 #1
0
ファイル: massconvert.py プロジェクト: jeffalstott/Culture
                else:
                #Anything that remains is the same drug condition as the present case
                    n+=1
            assert n!=0
            visit = str(n+1)
        except (IOError, AssertionError):
            visit = '1'

    if drug!='':
        task = drug+'_spontaneous'+visit
    else:
        task = 'spontaneous'+visit

    preproc.write_to_HDF5(data,output_file, task, sampling_rate=sampling_rate, bands=bands,\
            window=window, taps=taps,\
            downsample=downsample,
            group_name=group_name, species=species, location=location,\
                    number_in_group=number, name=name, date=date, drug=drug)

    badelec_mat = loadmat(file[:-4]+'badelec.mat')
    badelec = badelec_mat['badelec']
    if not badelec.any():
        badelec = array([-1])
    else:
        for i in range(len(badelec[0])):
            if badelec[0][i]<=8:
                badelec[0][i]-=2
            elif badelec[0][i]<=56:
                badelec[0][i]-=3
            else:
                badelec[0][i]-=4
コード例 #2
0
ファイル: massconvert.py プロジェクト: evonfernando/RIKEN
    task = tasks[components[1]]
    if name=='A' and task=='food_tracking':
        task = task+str(A_counter)
        A_counter = A_counter+1
    if name=='K1' and task=='food_tracking':
        task = task+str(K1_counter)
        K1_counter = K1_counter+1
    if name=='K2' and task=='visual_grating':
        task = task+str(K2_counter)
        K2_counter = K2_counter+1
    if name=='K2' and task=='sleep_task':
        data = mat(filename)

        preproc.write_to_HDF5(data,output_file, task, sampling_rate=sampling_rate, bands=bands,\
                window=window, taps=taps,\
                downsample=downsample,
                group_name='RIKEN', species='monkey', location='RIKEN',\
                        number_in_group=name, name=name, date=date)
        preproc.write_to_HDF5(data[:,:600000],output_file, 'rest', sampling_rate=sampling_rate, bands=bands,\
                window=window, taps=taps,\
                downsample=downsample,
                group_name='RIKEN', species='monkey', location='RIKEN',\
                        number_in_group=name, name=name, date=date)
        preproc.write_to_HDF5(data[:,-600000:],output_file, 'anesthetized', sampling_rate=sampling_rate, bands=bands,\
                window=window, taps=taps,\
                downsample=downsample,
                group_name='RIKEN', species='monkey', location='RIKEN',\
                        number_in_group=name, name=name, date=date)
        preproc.write_to_HDF5(data[:,600001:-600001],output_file, 'sleep_wake_transition', sampling_rate=sampling_rate, bands=bands,\
                window=window, taps=taps,\
                downsample=downsample,