Commit 73f1cda520fa8dd795f4638f0c9492d81ec45e11

Authored by Jürgen Knödlseder
1 parent 11c19573

Add spectral models for science verification.

Showing 1 changed file with 100 additions and 1 deletions
test/science_verification.py
... ... @@ -179,8 +179,15 @@ class sciver(gammalib.GPythonTestSuite):
179 179 # Set test name
180 180 self.name("Science Verification")
181 181  
182   - # Append tests
  182 + # Append spectral tests
183 183 self.append(self.spec_plaw, "Test power law model")
  184 + self.append(self.spec_plaw2, "Test power law 2 model")
  185 + self.append(self.spec_eplaw, "Test exponentially cut off power law model")
  186 + self.append(self.spec_supeplaw, "Test super exponentially cut off power law model")
  187 + self.append(self.spec_logparabola, "Test log parabola model")
  188 + self.append(self.spec_gauss, "Test Gaussian model")
  189 + self.append(self.spec_filefct, "Test file function model")
  190 + self.append(self.spec_nodes, "Test nodes model")
184 191  
185 192 # Return
186 193 return
... ... @@ -228,6 +235,98 @@ class sciver(gammalib.GPythonTestSuite):
228 235 self.pull("data/sciver/crab_plaw")
229 236 self.test("Pull_Crab_Prefactor")
230 237 self.test("Pull_Crab_Index")
  238 + self.test("Pull_Background_Prefactor")
  239 + self.test("Pull_Background_Index")
  240 + return
  241 +
  242 + # Test power law 2 model
  243 + def spec_plaw2(self):
  244 + """
  245 + Test power law 2 model.
  246 + """
  247 + self.pull("data/sciver/crab_plaw2")
  248 + self.test("Pull_Crab_Integral")
  249 + self.test("Pull_Crab_Index")
  250 + self.test("Pull_Background_Prefactor")
  251 + self.test("Pull_Background_Index")
  252 + return
  253 +
  254 + # Test exponentially cut off power law model
  255 + def spec_eplaw(self):
  256 + """
  257 + Test exponentially cut off power law model.
  258 + """
  259 + self.pull("data/sciver/crab_eplaw")
  260 + self.test("Pull_Crab_Prefactor")
  261 + self.test("Pull_Crab_Index")
  262 + self.test("Pull_Crab_Cutoff")
  263 + self.test("Pull_Background_Prefactor")
  264 + self.test("Pull_Background_Index")
  265 + return
  266 +
  267 + # Test super exponentially cut off power law model
  268 + def spec_supeplaw(self):
  269 + """
  270 + Test super exponentially cut off power law model.
  271 + """
  272 + self.pull("data/sciver/crab_supeplaw")
  273 + self.test("Pull_Crab_Prefactor")
  274 + self.test("Pull_Crab_Index1")
  275 + self.test("Pull_Crab_Index2")
  276 + self.test("Pull_Crab_Cutoff")
  277 + self.test("Pull_Background_Prefactor")
  278 + self.test("Pull_Background_Index")
  279 + return
  280 +
  281 + # Test log parabola model
  282 + def spec_logparabola(self):
  283 + """
  284 + Test log parabola model.
  285 + """
  286 + self.pull("data/sciver/crab_logparabola")
  287 + self.test("Pull_Crab_Prefactor")
  288 + self.test("Pull_Crab_Index")
  289 + self.test("Pull_Crab_Curvature")
  290 + self.test("Pull_Background_Prefactor")
  291 + self.test("Pull_Background_Index")
  292 + return
  293 +
  294 + # Test Gaussian model
  295 + def spec_gauss(self):
  296 + """
  297 + Test Gaussian model.
  298 + """
  299 + self.pull("data/sciver/crab_gauss")
  300 + self.test("Pull_Crab_Normalization")
  301 + self.test("Pull_Crab_Mean")
  302 + self.test("Pull_Crab_Sigma")
  303 + self.test("Pull_Background_Prefactor")
  304 + self.test("Pull_Background_Index")
  305 + return
  306 +
  307 + # Test file function model
  308 + def spec_filefct(self):
  309 + """
  310 + Test file function model.
  311 + """
  312 + self.pull("data/sciver/crab_filefct")
  313 + self.test("Pull_Crab_Normalization")
  314 + self.test("Pull_Background_Prefactor")
  315 + self.test("Pull_Background_Index")
  316 + return
  317 +
  318 + # Test nodes model
  319 + def spec_nodes(self):
  320 + """
  321 + Test nodes model.
  322 + """
  323 + self.pull("data/sciver/crab_nodes")
  324 + self.test("Pull_Crab_Intensity0")
  325 + self.test("Pull_Crab_Intensity1")
  326 + self.test("Pull_Crab_Intensity2")
  327 + self.test("Pull_Crab_Intensity3")
  328 + self.test("Pull_Background_Prefactor")
  329 + self.test("Pull_Background_Index")
231 330 return
232 331  
233 332  
... ...