Skip to content
Snippets Groups Projects
Commit b29c3bb7 authored by JGlombitza's avatar JGlombitza
Browse files

compatibility fixes

parent ac2d8ff7
Branches
No related tags found
No related merge requests found
*.pyc
*.txt
*.png
No preview for this file type
......@@ -14,6 +14,7 @@ import tensorflow as tf
KTF.set_session(utils.get_session()) # Allows 2 jobs per GPU, Please do not change this during the tutorial
log_dir="."
EPOCHS = 10
GRADIENT_PENALTY_WEIGHT = 10
......@@ -21,13 +22,12 @@ BATCH_SIZE = 256
NCR = 5
latent_size = 512
# load trainings data
Folder = '/home/JGlombitza/DataLink/ToyMC/PreProData' # Training no black tanks
filenames=glob.glob(Folder + "/PlanarWaveShower_PrePro_2*")
shower_maps, Energy, shower_axis = utils.ReadInData(filenames)
shower_maps=shower_maps[:,:,:,0]
np.savez("Data", Energy=Energy, shower_maps=shower_maps)
shower_maps = shower_maps[:,:,:,1,np.newaxis]
filenames=glob.glob("*.npz")
shower_maps, Energy = utils.ReadInData(filenames)
#shower_maps = shower_maps[:,:,:,1,np.newaxis]
#np.savez("Data", Energy=Energy, shower_maps=shower_maps)
Energy = Energy/np.max(Energy)
utils.plot_multiple_signalmaps(shower_maps[:,:,:,0], log_dir=log_dir, title='Footprints', epoch='Real')
......
......@@ -15,21 +15,15 @@ def get_session(gpu_fraction=0.40):
def ReadInData(filenames):
N = 10000 *len(filenames)
a = 10000 # packagesize
Input2 = np.zeros(N*9*9*2).reshape(N,9,9,2)
N = 100000 *len(filenames)
a = 100000
shower_maps = np.zeros(N*9*9*1).reshape(N,9,9,1)
Energy = np.zeros(N)
showeraxis = np.zeros(N*3).reshape(N,3)
for i in range(0, len(filenames)):
data = np.load(filenames[i])
Energy[a*i:a*(i+1)] = data['Energy']
Input2[a*i:a*(i+1)] = data['Input2'].reshape(a,9,9,2)
showeraxis[a*i:a*(i+1)] = data['showeraxis']
Input2[:,:,:,0] = Input2[:,:,:,0] - np.min(Input2[:,:,:,0], axis=(1,2))[:,np.newaxis,np.newaxis] + 1
Filter = Input2[:,:,:,1] == 0
Input2[:,:,:,0][Filter] = 0
return Input2, Energy, showeraxis
shower_maps[a*i:a*(i+1)] = data['shower_maps'].reshape(a,9,9,1)
return shower_maps, Energy
def ang2vec(phi, zenith):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment