Ejemplo n.º 1
0
start_sample = sample_start_clip
num_samples = clip_sample_lenght



# Specify data paths
raw_path = raw_recording


# Specify sample range for clip
start_sample = 32837802
num_samples = 657331

# Load raw data and convert to microvolts
raw_uV = ephys.get_raw_clip_from_amplifier(raw_path, start_sample, num_samples)

# Compute mean and standard deviation for each channel
raw_mean = np.mean(raw_uV, axis=1)
raw_std = np.std(raw_uV, axis=1)

# Z-score each channel
raw_Z = np.zeros(raw_uV.shape)
for ch in range(128):
    raw_Z[ch,:] = (raw_uV[ch,:] - raw_mean[ch]) / raw_std[ch]

# Specify channels to exclude
#exlcude_channels = np.array([12, 13, 18, 19, 108, 109 ,115])
exlcude_channels = np.array([12, 13, 18, 54, 108, 109 ,115])
include_channels = np.delete(np.arange(128), exlcude_channels)
Ejemplo n.º 2
0
    if idx == 0:
        count = +1
    else:
        start_sample = end_samples[idx - 1]
        num_samples = samples_lenght_end_to_end[idx]
        trial_end_and_lenght.append((start_sample, num_samples))

#iterating on each trial

#trial =21

for trial in np.arange(len(trial_end_and_lenght)):

    # Load raw data and convert to microvolts
    raw_uV = ephys.get_raw_clip_from_amplifier(raw_path,
                                               trial_end_and_lenght[trial][0],
                                               trial_end_and_lenght[trial][1])

    # Compute mean and standard deviation for each channel
    raw_mean = np.mean(raw_uV, axis=1)
    raw_std = np.std(raw_uV, axis=1)

    # Z-score each channel
    raw_Z = np.zeros(raw_uV.shape)

    for ch in range(128):
        raw_Z[ch, :] = (raw_uV[ch, :] - raw_mean[ch]) / raw_std[ch]

    # Store raw Z-scored as raw
    raw = np.copy(raw_Z)