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
543b050a
Commit
543b050a
authored
Sep 04, 2017
by
DavidWalz
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
12cc50d4
1641799f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
PreProcessing.py
PreProcessing.py
+5
-1
norm.py
norm.py
+2
-3
sim.py
sim.py
+5
-7
No files found.
PreProcessing.py
View file @
543b050a
...
...
@@ -2,8 +2,12 @@ import numpy as np
import
glob
import
tensorflow
as
tf
import
norm
import
os
Folder
=
'./RawData'
# Path to simulated shower packages
if
not
os
.
path
.
exists
(
'Data_preprocessed'
):
os
.
makedirs
(
'Data_preprocessed'
)
log_dir
=
'./Data_preprocessed'
# Path to preprocessed shower packages
filenames
=
glob
.
glob
(
Folder
+
"/showers-*"
)
a
=
10000
# packagesize
...
...
@@ -28,7 +32,7 @@ for i in range(0,len(filenames)):
time
=
norm
.
NormCenter
(
time
)
# Preprocessing of signal
signal
[
signal
<
0
]
=
0
signal
[
np
.
less
(
signal
,
0
)
]
=
0
SignalSum
=
norm
.
NormPhysicalEnergylog10
(
np
.
sum
(
signal
,
axis
=-
1
))
signal
=
norm
.
NormPhysicalTimeTracelog10
(
signal
)
...
...
norm.py
View file @
543b050a
...
...
@@ -13,7 +13,7 @@ def NormCenter(time):
def
NormPhysicalEnergylog10
(
time
):
u
=
np
.
isnan
(
time
)
time
[
time
<
0
]
=
0
time
[
np
.
less
(
time
,
0
)
]
=
0
time
[
~
u
]
=
np
.
log10
(
time
[
~
u
]
-
np
.
nanmin
(
time
)
+
1.0
)
time
/=
np
.
nanstd
(
time
)
time
[
u
]
=
0
...
...
@@ -24,8 +24,7 @@ def NormPhysicalEnergylog10(time):
return
time
def
NormPhysicalTimeTracelog10
(
signal
,
log_dir
=
"."
):
signal
[
signal
<
0
]
=
0
x
=
np
.
arange
(
80
)
signal
[
np
.
less
(
signal
,
0
)]
=
0
signal
=
np
.
log10
(
signal
+
1
)
signal
[
np
.
isnan
(
signal
)]
=
0
return
signal
...
...
sim.py
View file @
543b050a
from
__future__
import
division
,
print_function
import
numpy
as
np
import
argparse
import
os
from
airshower
import
shower
,
utils
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--mass"
,
default
=
1
,
type
=
int
,
help
=
'mass number'
)
parser
.
add_argument
(
"--nfiles"
,
default
=
10
,
type
=
int
,
help
=
'number of files'
)
...
...
@@ -12,14 +10,14 @@ parser.add_argument("--nevents", default=10000, type=int, help='number of events
parser
.
add_argument
(
"--path"
,
default
=
'./RawData'
,
type
=
str
,
help
=
'output folder'
)
args
=
parser
.
parse_args
()
print
(
'A'
,
args
.
mass
)
if
not
(
os
.
path
.
exists
(
args
.
path
)):
os
.
makedirs
(
args
.
path
)
print
(
'Simulating'
)
print
(
'mass'
,
args
.
mass
)
print
(
'nfiles'
,
args
.
nfiles
)
print
(
'nevents'
,
args
.
nevents
)
print
(
'path'
,
args
.
path
)
print
(
'Simulating'
)
if
not
(
os
.
path
.
exists
(
args
.
path
)):
os
.
makedirs
(
args
.
path
)
v_stations
=
utils
.
station_coordinates
(
9
,
layout
=
'offset'
)
...
...
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