Commit 543b050a authored by DavidWalz's avatar DavidWalz

merge

parents 12cc50d4 1641799f
......@@ -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)
......
......@@ -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
......
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')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment