Commit 27e49f06a8842f5adef7b478f5fac6317b1bc017

Authored by Jürgen Knödlseder
1 parent 6b40d0a5

Adjust unit tests

test/test_csworkflow.py
@@ -140,16 +140,16 @@ class Test(test): @@ -140,16 +140,16 @@ class Test(test):
140 140
141 # Check fit result values 141 # Check fit result values
142 self.test_value(models['Crab'][2].value(), 142 self.test_value(models['Crab'][2].value(),
143 - 5.65431687851392e-16, 1.0e-4 * 5.65431687851392e-16, 143 + 5.65974581468379e-16, 1.0e-4 * 5.65974581468379e-16,
144 'Check Crab prefactor') 144 'Check Crab prefactor')
145 self.test_value(models['Crab'][3].value(), 145 self.test_value(models['Crab'][3].value(),
146 - -2.45753747320273, 1.0e-4 * 2.45753747320273, 146 + -2.45911900829089, 1.0e-4 * 2.45911900829089,
147 'Check Crab index') 147 'Check Crab index')
148 self.test_value(models['Background'][0].value(), 148 self.test_value(models['Background'][0].value(),
149 - 1.0444753409474, 1.0e-4 * 1.0444753409474, 149 + 1.04744971751241, 1.0e-4 * 1.04744971751241,
150 'Check background model prefactor') 150 'Check background model prefactor')
151 self.test_value(models['Background'][1].value(), 151 self.test_value(models['Background'][1].value(),
152 - 0.0126628793551562, 1.0e-4 * 0.0126628793551562, 152 + 0.0117967073949693, 1.0e-4 * 0.0117967073949693,
153 'Check background model index') 153 'Check background model index')
154 154
155 # Return 155 # Return
test/test_ctobssim.py
@@ -86,7 +86,7 @@ class Test(test): @@ -86,7 +86,7 @@ class Test(test):
86 86
87 # Load counts cube and check content. 87 # Load counts cube and check content.
88 evt = gammalib.GCTAEventList('ctobssim_cmd1.fits') 88 evt = gammalib.GCTAEventList('ctobssim_cmd1.fits')
89 - self._test_list(evt, 3776) 89 + self._test_list(evt, 3775)
90 90
91 # Setup ctobssim command 91 # Setup ctobssim command
92 cmd = ctobssim+' inmodel="model_that_does_not_exist.xml"'+ \ 92 cmd = ctobssim+' inmodel="model_that_does_not_exist.xml"'+ \
@@ -152,21 +152,21 @@ class Test(test): @@ -152,21 +152,21 @@ class Test(test):
152 152
153 # Check content of observation 153 # Check content of observation
154 self._test_observation(sim) 154 self._test_observation(sim)
155 - self._test_list(sim.obs()[0].events(), 3776) 155 + self._test_list(sim.obs()[0].events(), 3775)
156 156
157 # Save events 157 # Save events
158 sim.save() 158 sim.save()
159 159
160 # Load counts cube and check content. 160 # Load counts cube and check content.
161 evt = gammalib.GCTAEventList('ctobssim_py1.fits') 161 evt = gammalib.GCTAEventList('ctobssim_py1.fits')
162 - self._test_list(evt, 3776) 162 + self._test_list(evt, 3775)
163 163
164 # Copy ctobssim tool 164 # Copy ctobssim tool
165 cpy_sim = sim.copy() 165 cpy_sim = sim.copy()
166 166
167 # Retrieve observation and check content of copy 167 # Retrieve observation and check content of copy
168 self._test_observation(cpy_sim) 168 self._test_observation(cpy_sim)
169 - self._test_list(cpy_sim.obs()[0].events(), 3776) 169 + self._test_list(cpy_sim.obs()[0].events(), 3775)
170 170
171 # Execute copy of ctobssim tool again, now with a higher chatter 171 # Execute copy of ctobssim tool again, now with a higher chatter
172 # level than before 172 # level than before
@@ -179,7 +179,7 @@ class Test(test): @@ -179,7 +179,7 @@ class Test(test):
179 179
180 # Load counts cube and check content. 180 # Load counts cube and check content.
181 evt = gammalib.GCTAEventList('ctobssim_py2.fits') 181 evt = gammalib.GCTAEventList('ctobssim_py2.fits')
182 - self._test_list(evt, 3776) 182 + self._test_list(evt, 3775)
183 183
184 # Set-up observation container 184 # Set-up observation container
185 pnts = [{'ra': 83.63, 'dec': 21.01}, 185 pnts = [{'ra': 83.63, 'dec': 21.01},
@@ -207,7 +207,7 @@ class Test(test): @@ -207,7 +207,7 @@ class Test(test):
207 # Retrieve observation and check content 207 # Retrieve observation and check content
208 self._test_observation(sim, nobs=2, pnts=pnts) 208 self._test_observation(sim, nobs=2, pnts=pnts)
209 self._test_list(sim.obs()[0].events(), 3569) 209 self._test_list(sim.obs()[0].events(), 3569)
210 - self._test_list(sim.obs()[1].events(), 3515) 210 + self._test_list(sim.obs()[1].events(), 3521)
211 211
212 # Save events 212 # Save events
213 sim.save() 213 sim.save()
@@ -217,7 +217,7 @@ class Test(test): @@ -217,7 +217,7 @@ class Test(test):
217 217
218 # Retrieve observation and check content 218 # Retrieve observation and check content
219 self._test_list(obs[0].events(), 3569) 219 self._test_list(obs[0].events(), 3569)
220 - self._test_list(obs[1].events(), 3515) 220 + self._test_list(obs[1].events(), 3521)
221 221
222 # Return 222 # Return
223 return 223 return