コード例 #1
0
imfs_filename = join(lfp_folder, 'EMD', 'imfs.bin')

imf_kilosort_folder = join(lfp_folder, 'Kilosort')

spike_info = pd.read_pickle(
    join(spikes_folder, 'spike_info_after_cortex_sorting.df'))
template_info = pd.read_pickle(join(spikes_folder, 'template_info.df'))

#  -------------------------------------------------
# Load the generated EMD data and have a look
#  -------------------------------------------------
num_of_imfs = const.NUMBER_OF_IMFS
num_of_channels = const.NUMBER_OF_LFP_CHANNELS_IN_BINARY_FILE

imfs = emd.load_memmaped_imfs(imfs_filename,
                              dtype=np.int16,
                              num_of_imfs=num_of_imfs,
                              num_of_channels=num_of_channels)

imf = 0
time = 1000000
buffer = 5000
factor = 2
args = [factor, time, buffer, imfs]


def get_specific_imf_spaced(imf, factor, data):
    imf_data = data[:, imf, :]
    return cdts.space_data_factor(imf_data, factor)


def get_time_window(time, buffer, data):
コード例 #2
0
analysis_folder = join(const_rat.base_save_folder, const_rat.rat_folder, const_rat.date_folders[date],
                       'Analysis', 'NeuropixelSimulations', 'Long')
kilosort_folder = join(analysis_folder, 'Kilosort')

results_folder = join(analysis_folder, 'Results')
spike_lfp_folder = join(results_folder, 'SpikeLfpCorrelations', 'SpikesAwayFromSuccTrials')

template_info = pd.read_pickle(join(kilosort_folder, 'template_info.df'))

spike_info = pd.read_pickle(join(kilosort_folder, 'spike_info_after_cleaning.df'))


imfs_file = join(const_rat.base_save_folder, const_rat.rat_folder, const_rat.date_folders[date],
                       'Analysis', 'Lfp', 'EMD', 'imfs.bin')
imfs = emd.load_memmaped_imfs(imfs_file, const_comm.NUMBER_OF_IMFS, const_comm.NUMBER_OF_LFP_CHANNELS_IN_BINARY_FILE)

# </editor-fold>

# -------------------------------------------------
# <editor-fold desc="GET TIMES OF SUCCESSFUL TRIALS">

camera_pulses, beam_breaks, sounds = \
    sync_funcs.get_time_points_of_events_in_sync_file(data_folder, clean=True,
                                                      cam_ttl_pulse_period=
                                                      const_comm.CAMERA_TTL_PULSES_TIMEPOINT_PERIOD)
sounds_dur = sounds[:, 1] - sounds[:, 0]
reward_sounds = sounds[sounds_dur < 4000]

# Using the start of the reward tone to generate events
# There is a difference of 78.6 frames (+-2) between the reward tone and the csv file event (about 700ms)