예제 #1
0
 def simulate_sources(self, gen_conf_1, gen_conf_2):
     [simulated_gen_1, gen_conf_1, electrodes] = \
             gen_simulation(gen_conf_1, 
                            num_sim=self.number_of_subjects,
                            gen_magnitude_stddev=\
                            self.generator_magnitude_stddev)
     [simulated_gen_2, gen_conf_2, electrodes] = \
             gen_simulation(gen_conf_2, 
                            num_sim=self.number_of_subjects,
                            gen_magnitude_stddev=\
                            self.generator_magnitude_stddev)
     return [simulated_gen_1, gen_conf_1, 
             simulated_gen_2, gen_conf_2,
             electrodes]
예제 #2
0
    def simulate_noise(self, size):
        if self.normal_noise_amplitude:
            normal_noise_1 = normal(0, self.normal_noise_amplitude, size)
            normal_noise_2 = normal(0, self.normal_noise_amplitude, size)
        else:
            normal_noise_1 = None
            normal_noise_2 = None

        if self.constant_noise_amplitude:
            constant_noise = self.constant_noise_amplitude * ones(size)
        else:
            constant_noise = None

        if self.topographic_noise_amplitude:
            noise_conf_1 = \
                random_generator_configuration(
                                        self.limits_number, 
                                        self.limits_depth,
                                        self.limits_orientation,
                                        self.limits_magnitude,
                                        self.topographic_noise_amplitude)[0]
            noise_conf_2 = \
                random_generator_configuration(
                                        self.limits_number, 
                                        self.limits_depth,
                                        self.limits_orientation,
                                        self.limits_magnitude,
                                        self.topographic_noise_amplitude)[0]
            [topographic_noise_1, noise_conf_1, electrodes] = \
                    gen_simulation(noise_conf_1, 
                                   num_sim=self.number_of_subjects)
            [topographic_noise_2, noise_conf_2, electrodes] = \
                    gen_simulation(noise_conf_2, 
                                   num_sim=self.number_of_subjects)
        else:
            topographic_noise_1 = None
            topographic_noise_2 = None
        
        return [normal_noise_1, topographic_noise_1, 
                normal_noise_2, topographic_noise_2, constant_noise]
예제 #3
0
        plot_topographic_map_array(map_array, scale=scale_array, label_y=label_y_array, title=title_array)
        savefig(folder + "/subject_" + str(i + 1) + ".png")


if parameters["todo_plot_grand_averages"]:
    print("Drawing grand averages for all imported data")
    figure()
    plot_ERP(ERP_avg["old"][0])


if parameters["todo_plot_simulated_noise"]:
    print("Running simulation to show topographic properties of noise")
    gen_conf = random_generator_configuration()
    [simulated_data, gen_conf, electrodes] = gen_simulation(
        gen_conf,
        num_sim=parameters["number_of_subjects"],
        gen_magnitude_stddev=parameters["generator_magnitude_stddev"],
    )
    figure()
    plot_topographic_map(mean(simulated_data, 0))
    # savefig('Results/' + timestamp + '/simulated_noise')
    savefig("Results/" + label + "/simulated_noise")


# Here we will be running the scaling experiments
# se <-- holds all simulation experiments, for all parameter combinations
se = {}

# All simulation experiment parameters we will be looping through
experiments = [1, 2, 3, 4]
configurations = ["random", "uandk"]