Blame view

Analysis.py 1.21 KB
7030f150   Thomas Fitoussi   Full reorganisati...
1
2
3
4
#!/bin/python

from sys import argv
from numpy import shape
374f3d52   Thomas Fitoussi   add Weight distri...
5
from Modules.Spectrum import drawSpectrum, drawSpectrum_normaLepton
7030f150   Thomas Fitoussi   Full reorganisati...
6
7
8
from Modules.Angle import drawAngle, drawRadial
from Modules.Timing import drawTiming
from Modules.Generation import drawGeneration
e6f5876a   Thomas Fitoussi   Map: convolution ...
9
from Modules.Map import drawMap
7030f150   Thomas Fitoussi   Full reorganisati...
10

8ffbee93   Thomas Fitoussi   Analytic expressi...
11
12
def error(error_type):
   print error_type
7030f150   Thomas Fitoussi   Full reorganisati...
13
   print "Give at least 2 arguments"
8011cc96   Thomas Fitoussi   Add profile readi...
14
15
16
   print "first argument could be:"
   print "  - spectrum (flux versus energy)"
   print "  - angle (angle versus energy)"
8ffbee93   Thomas Fitoussi   Analytic expressi...
17
18
   print "  - radial (angular distribution)"
   print "  - timing (time distribution)"
8011cc96   Thomas Fitoussi   Add profile readi...
19
20
21
22
   print "  - generation (generation histogram)"
   print "  - maphisto"
   print "  - map"
   print "others arguments are the folders files to plot"
7030f150   Thomas Fitoussi   Full reorganisati...
23
24
   exit()

8ffbee93   Thomas Fitoussi   Analytic expressi...
25
26
27
if shape(argv)[0] < 3:
   error("not enough argument")

374f3d52   Thomas Fitoussi   add Weight distri...
28
elif argv[1] == "spectrum": 
f4246390   Thomas Fitoussi   Improve angular d...
29
   drawSpectrum(argv[2:],PlotAnalytic=True)
7030f150   Thomas Fitoussi   Full reorganisati...
30

374f3d52   Thomas Fitoussi   add Weight distri...
31
32
33
elif argv[1] == "spectrumLept": 
   drawSpectrum_normaLepton(argv[2:])

7030f150   Thomas Fitoussi   Full reorganisati...
34
35
36
37
38
39
40
41
42
43
44
45
elif argv[1] == "angle":
   drawAngle(argv[2:])

elif argv[1] == "radial":
   drawRadial(argv[2:])

elif argv[1] == "timing":
   drawTiming(argv[2:])

elif argv[1] == "generation":
   drawGeneration(argv[2:])

7030f150   Thomas Fitoussi   Full reorganisati...
46
47
48
49
elif argv[1] == "map":
   drawMap(argv[2:])

else:
8ffbee93   Thomas Fitoussi   Analytic expressi...
50
   error("bad 1st argument")