diff --git a/Analysis.py b/Analysis.py index f491658..fb90c7f 100755 --- a/Analysis.py +++ b/Analysis.py @@ -5,60 +5,40 @@ from numpy import append, savetxt, shape, array, newaxis, zeros, arange from Modules.Read import ReadEnergy, ReadTime, ReadExtraFile, ReadProfile from Modules.Read import ReadMomentumAngle, ReadPositionAngle, resultDirectory from Modules.Spectrum import spectrum -from Modules.Map import printMap, isotrop -from Modules.Angle import radial, angle_vs_energy +from Modules.Map import computeMap, isotrop +from Modules.Angle import angle_vs_energy from Modules.Timing import timing from Modules.Constants import degre -def InProgress(fileId,step,i,Nmax): - print "Work on ", fileId, "(step "+ step +": ", (i*100)/Nmax, "% done" +def InProgress(i,Nmax): + print " ", (i*100)/Nmax, "% done" if shape(argv)[0] < 2: print "not enough arguments (at least 1)" exit() -#================================================================# -# Parameters -#================================================================# +#=============================================================================# PowerSpectrum=[1,1.5,2,2.5] -powerlaw_index = 2 -Elim = 1e-1 # GeV -thetalim = 20 # degre for fileId in argv[1:]: + print "#=============================================================================#" + print "# Analysis of", fileId + print "#=============================================================================#" # read files + print "# 1. Reading data" time = ReadTime(fileId) energy = ReadEnergy(fileId) weightini, generation, theta_arrival, Esource = ReadExtraFile(fileId,[2,3,4,5]) nbPhotonsEmitted=ReadProfile(fileId,[3]) - #=============================================================================# - # IMAGING - #=============================================================================# - thetaDir,phiDir = ReadMomentumAngle(fileId)*degre - thetaPos,phiPos = ReadPositionAngle(fileId)*degre - theta = thetaDir - thetaPos - phi = phiDir -phiPos - - # apply source spectrum - weight_source = (Esource/min(Esource))**(1-powerlaw_index) - weight = weightini* weight_source - - # apply selection - cond=(energy>Elim) & (abs(theta)Elim) #& (abs(theta)