Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
DavidWalz
airshower-deeplearning
Commits
86dafa50
Commit
86dafa50
authored
Jun 22, 2017
by
DavidWalz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add example sim
parent
98b3d41d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
examples/sim.py
examples/sim.py
+34
-0
No files found.
examples/sim.py
0 → 100644
View file @
86dafa50
import
numpy
as
np
from
airshower
import
shower
,
utils
,
plotting
import
argparse
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--mass"
,
default
=
1
,
type
=
int
,
help
=
'mass number'
)
parser
.
add_argument
(
"--nfiles"
,
default
=
1
,
type
=
int
,
help
=
'mass number'
)
parser
.
add_argument
(
"--nevents"
,
default
=
1000
,
type
=
int
,
help
=
'mass number'
)
args
=
parser
.
parse_args
()
print
'Simulating'
print
'A'
,
args
.
mass
print
'nfiles'
,
args
.
nfiles
print
'nevents'
,
args
.
nevents
v_stations
=
utils
.
station_coordinates
(
9
,
layout
=
'offset'
)
for
i
in
range
(
args
.
nfiles
):
logE
=
18.5
+
1.5
*
np
.
random
.
rand
(
args
.
nevents
)
mass
=
args
.
mass
*
np
.
ones
(
args
.
nevents
)
data
=
shower
.
rand_events
(
logE
,
mass
,
v_stations
)
np
.
savez_compressed
(
'showers-A%i-%i.npz'
%
(
args
.
mass
,
i
),
detector
=
data
[
'detector'
],
logE
=
data
[
'logE'
],
mass
=
data
[
'mass'
],
Xmax
=
data
[
'Xmax'
],
showercore
=
data
[
'showercore'
],
showeraxis
=
data
[
'showeraxis'
],
showermax
=
data
[
'showermax'
],
time
=
data
[
'time'
],
signal
=
data
[
'signal'
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment