Commit bcae3ed6ca49e53cbcdb93c79b9fe8c6803a07ef

Authored by knodlseder
1 parent fc2a1c1d

correct formatting

Showing 1 changed file with 18 additions and 18 deletions
test/test_python.py
... ... @@ -17,11 +17,11 @@ import sys
17 17 def pipeline_v1():
18 18 """
19 19 Unbinned analysis pipeline - save intermediate results.
20   -
21   - This function implements an analysis pipeline that successively calls
22   - ctobssim, ctselect and ctlike by saving the intermediate results as FITS
23   - files on disk. This replicates the way how the analysis would be done
24   - in a ftools-like approach.
  20 +
  21 + This function implements an analysis pipeline that successively calls
  22 + ctobssim, ctselect and ctlike by saving the intermediate results as FITS
  23 + files on disk. This replicates the way how the analysis would be done
  24 + in a ftools-like approach.
25 25 """
26 26 # Set script parameters
27 27 model_name = "data/crab.xml"
... ... @@ -38,11 +38,11 @@ def pipeline_v1():
38 38 emin = 0.1
39 39 emax = 100.0
40 40 rad_select = 3.0
41   -
  41 +
42 42 # Initialise timing
43 43 wall_seconds = 0.0
44 44 cpu_seconds = 0.0
45   -
  45 +
46 46 # Simulate events
47 47 sim = ctobssim()
48 48 sim.logFileOpen()
... ... @@ -59,7 +59,7 @@ def pipeline_v1():
59 59 sim["emax"].real(emax)
60 60 sim.execute()
61 61 sys.stdout.write(".")
62   -
  62 +
63 63 # Select events
64 64 select = ctselect()
65 65 select.logFileOpen()
... ... @@ -74,7 +74,7 @@ def pipeline_v1():
74 74 select["emax"].real(emax)
75 75 select.execute()
76 76 sys.stdout.write(".")
77   -
  77 +
78 78 # Perform maximum likelihood fitting
79 79 like = ctlike()
80 80 like.logFileOpen()
... ... @@ -86,7 +86,7 @@ def pipeline_v1():
86 86 like["irf"].string(irf)
87 87 like.execute()
88 88 sys.stdout.write(".")
89   -
  89 +
90 90 # Return
91 91 return
92 92  
... ... @@ -97,9 +97,9 @@ def pipeline_v1():
97 97 def pipeline_v2():
98 98 """
99 99 Unbinned analysis pipeline - keep intermediate results in memory.
100   -
101   - This function implements an analysis pipeline that successively calls
102   - ctobssim, ctselect and ctlike without saving the intermediate results as
  100 +
  101 + This function implements an analysis pipeline that successively calls
  102 + ctobssim, ctselect and ctlike without saving the intermediate results as
103 103 FITS files on disk. All data is only hold in memory.
104 104 """
105 105 # Set script parameters
... ... @@ -114,11 +114,11 @@ def pipeline_v2():
114 114 emin = 0.1
115 115 emax = 100.0
116 116 rad_select = 3.0
117   -
  117 +
118 118 # Initialise timing
119 119 wall_seconds = 0.0
120 120 cpu_seconds = 0.0
121   -
  121 +
122 122 # Simulate events
123 123 sim = ctobssim()
124 124 sim["infile"].filename(model_name)
... ... @@ -133,7 +133,7 @@ def pipeline_v2():
133 133 sim["emax"].real(emax)
134 134 sim.run()
135 135 sys.stdout.write(".")
136   -
  136 +
137 137 # Select events
138 138 select = ctselect(sim.obs())
139 139 select["ra"].real(ra)
... ... @@ -145,12 +145,12 @@ def pipeline_v2():
145 145 select["emax"].real(emax)
146 146 select.run()
147 147 sys.stdout.write(".")
148   -
  148 +
149 149 # Perform maximum likelihood fitting
150 150 like = ctlike(select.obs())
151 151 like.run()
152 152 sys.stdout.write(".")
153   -
  153 +
154 154 # Return
155 155 return
156 156  
... ...