Beispiel #1
0
#
# all_trials_values, all_trials_outsiders = get_channel_trials_values_and_outsiders(doas, 'light', 'spontaneous', 7)
# a_matrix_all = np.zeros((encoding.no_symbols, encoding.no_symbols), dtype=int)
# for i in range(len(all_trials_values)):
#     a_matrix = encoding.get_a(all_trials_values[i], all_trials_outsiders[i])
#     a_matrix_all = np.add(a_matrix_all, a_matrix)
# a_matrix_all = np.log10(a_matrix_all + 1)
# plot_matrix_A(DOA='LIGHT_all', segment='spontaneous', channel_number=7, values=a_matrix_all)

mark_outsiders(doas)

all_trials_values, all_trials_outsiders = get_channel_trials_segment_values_and_outsiders(
    doas, 'deep', 'spontaneous', 2)
a_matrix_all = np.zeros((encoding.no_symbols, encoding.no_symbols), dtype=int)
for i in range(len(all_trials_values)):
    a_matrix = encoding.get_a(all_trials_values[i], all_trials_outsiders[i])
    a_matrix_all = np.add(a_matrix_all, a_matrix)
a_matrix_all = np.log10(a_matrix_all + 1)
plot_matrix_A(DOA='DEEP_all_no_bursts',
              segment='spontaneous',
              channel_number=2,
              values=a_matrix_all)

# all_trials_values, all_trials_outsiders = get_channel_trials_values_and_outsiders(doas, 'light', 'spontaneous', 7)
# a_matrix_all = np.zeros((encoding.no_symbols, encoding.no_symbols), dtype=int)
# for i in range(len(all_trials_values)):
#     a_matrix = encoding.get_a(all_trials_values[i], all_trials_outsiders[i])
#     a_matrix_all = np.add(a_matrix_all, a_matrix)
# a_matrix_all = np.log10(a_matrix_all + 1)
# plot_matrix_A(DOA='lib2_LIGHT_all_no_bursts_log', segment='spontaneous', channel_number=7, values=a_matrix_all)
Beispiel #2
0
    lag_diff_stimulus = 0
    lag_diff_poststimulus = 0
    lag_diff_total = 0

    for ch_index in range(ch_numbers):
        # at ch_index in range [1 .. 30]
        diff_spontaneous = np.zeros(a_size, dtype='i')
        diff_stimulus = np.zeros(a_size, dtype='i')
        diff_poststimulus = np.zeros(a_size, dtype='i')

        # here sum of the differeces matrix between DEEP and LIGHT
        for trial_index in range(trials_numbers):
            t_deep = doas[0].channels[ch_index].trials[trial_index]
            t_light = doas[1].channels[ch_index].trials[trial_index]
            diff_spontaneous += np.absolute(
                np.array(encoder.get_a(t_deep.spontaneous.values, lag)) -
                np.array(encoder.get_a(t_light.spontaneous.values, lag)))

            diff_stimulus += np.absolute(
                np.array(encoder.get_a(t_deep.stimulus.values, lag)) -
                np.array(encoder.get_a(t_light.stimulus.values, lag)))

            diff_poststimulus += np.absolute(
                np.array(encoder.get_a(t_deep.poststimulus.values, lag)) -
                np.array(encoder.get_a(t_light.poststimulus.values, lag)))

        results_file.write('channel ' + str(ch_index) + ' \n')
        print('channel ' + str(ch_index) + ' \n')

        # average of the trials_numbers trials
        diff_spontaneous = diff_spontaneous / trials_numbers