Esempio n. 1
0
def perform_groundparticlessimulation(filename, mock_time):
    """Perform a small simulation and store results in filename"""

    mock_time.return_value = int(1e9)

    corsika_data_path = os.path.join(self_path, 'test_data/corsika.h5')
    cluster = sapphire.clusters.SimpleCluster(size=40)
    filters = tables.Filters(complevel=1)
    with tables.open_file(filename, 'w', filters=filters) as data:
        sim = GroundParticlesSimulation(corsika_data_path, 70, cluster,
                                        data, n=10, seed=1, progress=False)
        sim.run()
    def create_test_simulation_output(self):
        np.random.seed(1)
        self.sim = 'E_100TeV/zenith_0'
        cluster = clusters.SimpleCluster(size=50)
        simulation = GroundParticlesSimulation(cluster, self.data,
                                               os.path.join('/showers', self.sim, 'leptons'),
#                                               os.path.join('/simulations', self.sim), force=True,
                                               os.path.join('/test_output', self.sim),
                                               R=10, N=20)
        self.redirect_stdout_stderr_to_devnull()
        simulation.run()
        self.restore_stdout_stderr()
Esempio n. 3
0
 def create_test_simulation_output(self):
     np.random.seed(1)
     self.sim = 'E_100TeV/zenith_0'
     cluster = clusters.SimpleCluster(size=50)
     simulation = GroundParticlesSimulation(
         cluster,
         self.data,
         os.path.join('/showers', self.sim, 'leptons'),
         #                                               os.path.join('/simulations', self.sim), force=True,
         os.path.join('/test_output', self.sim),
         R=10,
         N=20)
     self.redirect_stdout_stderr_to_devnull()
     simulation.run()
     self.restore_stdout_stderr()
Esempio n. 4
0
def perform_groundparticlessimulation(filename, mock_time):
    """Perform a small simulation and store results in filename"""

    mock_time.return_value = int(1e9)

    corsika_data_path = os.path.join(self_path, 'test_data/corsika.h5')
    cluster = sapphire.clusters.SimpleCluster(size=40)
    filters = tables.Filters(complevel=1)
    with tables.open_file(filename, 'w', filters=filters) as datafile:
        sim = GroundParticlesSimulation(corsika_data_path,
                                        70,
                                        cluster,
                                        datafile,
                                        N=10,
                                        seed=1,
                                        progress=False)
        sim.run()