os.mkdir(os.path.join(folder_angle, folder))
                except:
                    pass

            for folder, Emin, Emax in zip(folderlist, Emins, Emaxs):

                input_dir = os.path.join(folder_angle, folder, 'input')
                try:
                    os.mkdir(input_dir)
                except:
                    pass
                outname = folder_angle + '/' + folder + '/input/' + folder + '.hdf5'
                print(Emin / units.PeV, Emax / units.PeV)
                print(outname)

                generate_eventlist_cylinder(
                    outname,
                    nevt,
                    Emin,
                    Emax,
                    volume,
                    thetamin=thetamin,
                    thetamax=thetamax,
                    phimin=phimin,
                    phimax=phimax,
                    start_event_id=1,
                    flavor=[flavour],
                    n_events_per_file=nevt_perfile,
                    deposited=True
                )
Esempio n. 2
0
from NuRadioMC.utilities import units
from NuRadioMC.EvtGen.generator import generate_eventlist_cylinder

# define simulation volume
zmin = -2.7 * units.km  # the ice sheet at South Pole is 2.7km deep
zmax = 0 * units.km
rmin = 0 * units.km
rmax = 4 * units.km

# generate one event list at 1e19 eV with 1000 neutrinos
generate_eventlist_cylinder('1e19_n1e3.hdf5',
                            1e3,
                            1e19 * units.eV,
                            1e19 * units.eV,
                            rmin,
                            rmax,
                            zmin,
                            zmax,
                            full_rmin=rmin,
                            full_rmax=rmax,
                            full_zmin=zmin,
                            full_zmax=zmax)

# generate one event list at 1e18 eV with 10000 neutrinos
generate_eventlist_cylinder('1e18_n1e4.hdf5',
                            1e4,
                            1e18 * units.eV,
                            1e18 * units.eV,
                            rmin,
                            rmax,
                            zmin,
                            zmax,
import numpy as np
import h5py

from NuRadioMC.EvtGen import generator
from NuRadioReco.utilities import units
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("testtaueventgen")

# define simulation volume
volume = {
'fiducial_rmin':0 * units.km,
'fiducial_rmax': 3 * units.km,
'fiducial_zmin':-2.7 * units.km,  # the ice sheet at South Pole is 2.7km deep
'fiducial_zmax': 0 * units.km}
generator.generate_eventlist_cylinder('tau.hdf5', 1e4, 1e18 * units.eV, 1e19 * units.eV,
                            volume, add_tau_second_bang=True)

print("writing many subfiles")
generator.generate_eventlist_cylinder('tau2.hdf5', 1e4, 1e16 * units.eV, 1e19 * units.eV,
                            volume, add_tau_second_bang=True, n_events_per_file=10)
from __future__ import absolute_import, division, print_function
from NuRadioReco.utilities import units
from NuRadioMC.EvtGen.generator import generate_eventlist_cylinder

# define simulation volume
volume = {
    'fiducial_zmin':
    -2.7 * units.km,  # the ice sheet at South Pole is 2.7km deep
    'fiducial_zmax': 0 * units.km,
    'fiducial_rmin': 0 * units.km,
    'fiducial_rmax': 4 * units.km
}

# generate one event list at 1e19 eV with 1000 neutrinos
generate_eventlist_cylinder('1e19_n1e3.hdf5', 1e3, 1e19 * units.eV,
                            1e19 * units.eV, volume)

# generate one event list at 1e18 eV with 10000 neutrinos
generate_eventlist_cylinder('1e18_n1e4.hdf5', 1e4, 1e18 * units.eV,
                            1e18 * units.eV, volume)
Esempio n. 5
0
        consists of a 2.7 km deep layer of ice, bedrock below and air above.
        -'MooresBay', a config file for Moore's Bay (spherical Earth). It
        consists of a 576 m deep ice layer with a 2234 m deep water layer below,
        and bedrock below that.
        -'InfIce', a config file with a medium of infinite ice
        -'Greenland', a config file for Summit Station, Greenland (spherical Earth),
        same as SouthPole but with a 3 km deep ice layer.
        IMPORTANT: If these options are used, the code is more efficient if the
        user requests their own "path_to_tables" and "path_to_tables_readonly",
        pointing them to a writable directory
        If one of these three options is chosen, the user is supposed to edit
        the corresponding config_PROPOSAL_xxx.json.sample file to include valid
        table paths and then copy this file to config_PROPOSAL_xxx.json.""")
    parser.add_argument(
        '--start_file_id',
        type=int,
        default=0,
        help=
        "in case the data set is distributed over several files, this number specifies the id of the first file (useful if an existing data set is extended)"
    )
    args = parser.parse_args()

    generate_eventlist_cylinder(
        args.filename, args.n_events, args.Emin, args.Emax, args.fiducial_rmin,
        args.fiducial_rmax, args.fiducial_zmin, args.fiducial_zmax,
        args.full_rmin, args.full_rmax, args.full_zmin, args.full_zmax,
        args.thetamin, args.thetamax, args.phimin, args.phimax,
        args.start_event_id, args.flavor, args.n_events_per_file,
        args.spectrum, args.deposited, args.proposal, args.proposal_config,
        args.start_file_id)
Esempio n. 6
0
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
from NuRadioReco.utilities import units
from NuRadioMC.EvtGen.generator import generate_eventlist_cylinder

# define simulation volume
volume = {
    'fiducial_rmin': 0 * units.km,
    'fiducial_rmax': 2 * units.km,
    'fiducial_zmin':
    -2.7 * units.km,  # the ice sheet at South Pole is 2.7km deep
    'fiducial_zmax': 0 * units.km
}

# generate one event list at 1e18 eV with 10000 neutrinos
generate_eventlist_cylinder('1e18_full.hdf5', 2000, 1e18 * units.eV,
                            1e18 * units.eV, volume)
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
from NuRadioReco.utilities import units
from NuRadioMC.EvtGen.generator import generate_eventlist_cylinder
import numpy as np

# define simulation volume
volume = {
'fiducial_rmin':0 * units.km,
'fiducial_rmax': 4 * units.km,
'fiducial_zmin':-2.7 * units.km,  # the ice sheet at South Pole is 2.7km deep
'fiducial_zmax': 0 * units.km}

path = os.path.dirname(os.path.abspath(__file__))

# generate one event list at 1e18 eV with 10000 neutrinos
generate_eventlist_cylinder(os.path.join(path, '1e18_full.hdf5'),
                            5e4, 1e18 * units.eV, 1e18 * units.eV,
                            volume, seed=10)
config_PROPOSAL_greeenland.json.sample should be renamed to config_PROPOSAL_greeenland.json.

In this case we are going to use the Proposal config file in the present folder
"""
proposal_config = 'config_PROPOSAL_greenland.json'
"""
start_event_id is the event id of the first event generated by the generator file.
In principle, it can be anything. However, when using PROPOSAL, if several jobs
are used to create events for the same energy bin and zenith band, be sure to
change the start_event_id so that different files referring to the same bin.
"""
start_event_id = 0
"""
We choose a name for the file to be generated.
"""
filename = 'input_{:.1e}_{:.1e}.hdf5'.format(Emin, Emax)

generate_eventlist_cylinder(filename,
                            n_events,
                            Emin,
                            Emax,
                            volume,
                            thetamin=thetamin,
                            thetamax=thetamax,
                            flavor=flavor,
                            n_events_per_file=n_events_per_file,
                            spectrum=spectrum,
                            proposal=proposal,
                            proposal_config=proposal_config,
                            start_event_id=start_event_id)
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
from NuRadioReco.utilities import units
from NuRadioMC.EvtGen.generator import generate_eventlist_cylinder

# define simulation volume
volume = {
    'fiducial_rmin': 0 * units.km,
    'fiducial_rmax': 2 * units.km,
    'fiducial_zmin':
    -0.55 * units.km,  # the ice sheet at South Pole is 2.7km deep
    'fiducial_zmax': 0 * units.km
}

# generate one event list at 1e18 eV with 10000 neutrinos
generate_eventlist_cylinder('MB_1e18_full.hdf5', 1e3, 1e18 * units.eV,
                            1e18 * units.eV, volume)
Esempio n. 10
0
that is not the case, the azimuthal range can be restricted with phimin and phimax.

The thetamin and thetamax we have chosen here are the ones by default (whole sky).
"""
thetamin = 0 * units.deg
thetamax = 180 * units.deg
"""
The generator lets us specify the flavour of the initial neutrinos by using the
PDG particle codes. 12 is for electron neutrino, 14 is for muon neutrino, and
16 is for tau neutrino. The negative signs represent the antineutrinos. We must
pass the flavour choice as a list of particle codes, and the generator will randomly
choose flavours contained in this list. For instance, to get a 1:1:1 flux, which
is also the one by default, we can write:
"""
flavor = [12, -12, 14, -14, 16, -16]
"""
We choose a name for the file to be generated.
"""
filename = 'input_{:.1e}_{:.1e}.hdf5'.format(Emin, Emax)
"""
And we call the function to generate the events.
"""
generate_eventlist_cylinder(filename,
                            n_events,
                            Emin,
                            Emax,
                            volume,
                            thetamin=thetamin,
                            thetamax=thetamax,
                            flavor=flavor)