Commit db4d74b23b07732f0e8b92b70854ea5b5787dbc8

Authored by Jürgen Knödlseder
1 parent aeaeaf41

Adapt COMPTEL unit test to new DRW weighting cubes

test/data/comptel/datastore/vp0001_0_drw_psd0-110_000750-001000keV.fits.gz 0 → 100644
No preview for this file type
test/data/comptel/obs_binned1.xml
... ... @@ -3,6 +3,7 @@
3 3 <observation name="CRAB" id="vp0001_0_000750-001000keV" instrument="COM">
4 4 <parameter name="DRE" file="datastore/vp0001_0_dre_psd0-110_000750-001000keV.fits" />
5 5 <parameter name="DRB" file="datastore/vp0001_0_drb_psd0-110_000750-001000keV.fits" />
  6 + <parameter name="DRW" file="datastore/vp0001_0_drw_psd0-110_000750-001000keV.fits" />
6 7 <parameter name="DRG" file="datastore/vp0001_0_drg.fits" />
7 8 <parameter name="DRX" file="datastore/vp0001_0_drx.fits" />
8 9 <parameter name="IAQ" value="datastore/iaq_000750-001000keV.fits" />
... ...
test/test_comobsadd.py
... ... @@ -2,7 +2,7 @@
2 2 # ==========================================================================
3 3 # This scripts performs unit tests for the comobsadd script.
4 4 #
5   -# Copyright (C) 2021 Juergen Knoedlseder
  5 +# Copyright (C) 2021-2023 Juergen Knoedlseder
6 6 #
7 7 # This program is free software: you can redistribute it and/or modify
8 8 # it under the terms of the GNU General Public License as published by
... ... @@ -195,5 +195,16 @@ class Test(test):
195 195 self.test_value(drb.npsi(), 20, 'Check DRB Psi size')
196 196 self.test_value(drb.nphibar(), 25, 'Check DRB Phibar size')
197 197  
  198 + # Check DRW file
  199 + fname = '%s/com_000750-001000keV_drw.fits' % foldername
  200 + exists = os.path.isfile(fname)
  201 + self.test_assert(exists, 'Check that DRW file "%s" exists' % fname)
  202 + if exists:
  203 + drw = gammalib.GCOMDri(fname)
  204 + self.test_value(drw.size(), 10000, 'Check DRW size')
  205 + self.test_value(drw.nchi(), 20, 'Check DRW Chi size')
  206 + self.test_value(drw.npsi(), 20, 'Check DRW Psi size')
  207 + self.test_value(drw.nphibar(), 25, 'Check DRW Phibar size')
  208 +
198 209 # Return
199 210 return
... ...
test/test_comobsbin.py
... ... @@ -2,7 +2,7 @@
2 2 # ==========================================================================
3 3 # This scripts performs unit tests for the comobsbin script.
4 4 #
5   -# Copyright (C) 2021-2022 Juergen Knoedlseder
  5 +# Copyright (C) 2021-2023 Juergen Knoedlseder
6 6 #
7 7 # This program is free software: you can redistribute it and/or modify
8 8 # it under the terms of the GNU General Public License as published by
... ... @@ -194,6 +194,17 @@ class Test(test):
194 194 self.test_value(drb.npsi(), 80, 'Check DRB Psi size')
195 195 self.test_value(drb.nphibar(), 25, 'Check DRB Phibar size')
196 196  
  197 + # Check DRW file
  198 + fname = '%s/vp0001_0_drw_000750-001000keV.fits' % foldername
  199 + exists = os.path.isfile(fname)
  200 + self.test_assert(exists, 'Check that DRW file "%s" exists' % fname)
  201 + if exists:
  202 + drw = gammalib.GCOMDri(fname)
  203 + self.test_value(drw.size(), 160000, 'Check DRW size')
  204 + self.test_value(drw.nchi(), 80, 'Check DRW Chi size')
  205 + self.test_value(drw.npsi(), 80, 'Check DRW Psi size')
  206 + self.test_value(drw.nphibar(), 25, 'Check DRW Phibar size')
  207 +
197 208 # Check IAQ file
198 209 fname = '%s/iaq_000750-001000keV.fits' % foldername
199 210 exists = os.path.isfile(fname)
... ...