Commit d4ecfbc1e3ecb9a7bdceaaa164a6711d10d503d4
1 parent
b99c8d60
Make IRF units compliant with IAU format
Showing
8 changed files
with
5 additions
and
9 deletions
caldb/data/cta/prod2/bcf/North_0.5h/irf_file.fits.gz
No preview for this file type
caldb/data/cta/prod2/bcf/North_50h/irf_file.fits.gz
No preview for this file type
caldb/data/cta/prod2/bcf/North_5h/irf_file.fits.gz
No preview for this file type
caldb/data/cta/prod2/bcf/South_0.5h/irf_file.fits.gz
No preview for this file type
caldb/data/cta/prod2/bcf/South_50h/irf_file.fits.gz
No preview for this file type
caldb/data/cta/prod2/bcf/South_5h/irf_file.fits.gz
No preview for this file type
cscripts/csroot2caldb.py
| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | # ========================================================================== |
| 3 | 3 | # Generate IRFs in CALDB format from a ROOT offaxis performance file |
| 4 | 4 | # |
| 5 | -# Copyright (C) 2016-2017 Juergen Knoedlseder | |
| 5 | +# Copyright (C) 2016-2018 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 |
| ... | ... | @@ -618,7 +618,7 @@ class csroot2caldb(ctools.cscript): |
| 618 | 618 | ds['HDU_EA'].card('HI_THRES', emin, '[TeV] High energy threshold') |
| 619 | 619 | |
| 620 | 620 | # Create "EFFAREA" data column |
| 621 | - self._make_2D(etrue, ds['HDU_EA'], 'EFFAREA', 'm2') | |
| 621 | + self._make_2D(etrue, ds['HDU_EA'], 'EFFAREA', 'm**2') | |
| 622 | 622 | |
| 623 | 623 | # Return |
| 624 | 624 | return |
| ... | ... | @@ -745,7 +745,6 @@ class csroot2caldb(ctools.cscript): |
| 745 | 745 | 'Generate Gaussian point spread function extension') |
| 746 | 746 | |
| 747 | 747 | # Get relevant ROOT histograms |
| 748 | - #r68 = tfile.Get('AngRes_offaxis') | |
| 749 | 748 | r68, _ = self._root2psf_get_r68_and_r80(tfile) |
| 750 | 749 | |
| 751 | 750 | # Extract number of bins in histogram |
| ... | ... | @@ -826,8 +825,6 @@ class csroot2caldb(ctools.cscript): |
| 826 | 825 | 'Generate King point spread function extension') |
| 827 | 826 | |
| 828 | 827 | # Get relevant ROOT histograms |
| 829 | - #r68 = tfile.Get('AngRes_offaxis') | |
| 830 | - #r80 = tfile.Get('AngRes80_offaxis') | |
| 831 | 828 | r68, r80 = self._root2psf_get_r68_and_r80(tfile) |
| 832 | 829 | |
| 833 | 830 | # Extract number of bins in histogram |
| ... | ... | @@ -1034,7 +1031,6 @@ class csroot2caldb(ctools.cscript): |
| 1034 | 1031 | |
| 1035 | 1032 | # Get relevant ROOT histograms |
| 1036 | 1033 | matrix = self._root2edisp_get_migra(tfile) |
| 1037 | - #matrix = tfile.Get('EestOverEtrue_offaxis') | |
| 1038 | 1034 | |
| 1039 | 1035 | # Write boundary keywords |
| 1040 | 1036 | self._set_cif_keywords(ds['HDU_EDISP'], irf['EDISP_NAME'], |
| ... | ... | @@ -1087,7 +1083,7 @@ class csroot2caldb(ctools.cscript): |
| 1087 | 1083 | irf['BGD_BOUNDS'], irf['BGD_DESC'], irf) |
| 1088 | 1084 | |
| 1089 | 1085 | # Create "BGD" data column |
| 1090 | - self._make_3D(array, ds['HDU_BGD'], 'BGD', '1/s/MeV/sr') | |
| 1086 | + self._make_3D(array, ds['HDU_BGD'], 'BGD', '1/(MeV s sr)') | |
| 1091 | 1087 | |
| 1092 | 1088 | # Return |
| 1093 | 1089 | return |
| ... | ... | @@ -1327,7 +1323,7 @@ class csroot2caldb(ctools.cscript): |
| 1327 | 1323 | # Log power law replacement |
| 1328 | 1324 | self._log_value(gammalib.NORMAL, |
| 1329 | 1325 | 'Power law replacement', |
| 1330 | - '%e cts/s/deg2 (E=%8.4f TeV (%d) ' | |
| 1326 | + '%e cts/(s deg**2) (E=%8.4f TeV (%d) ' | |
| 1331 | 1327 | 'Off=%.2f deg (%d)' % |
| 1332 | 1328 | (value,engs[ieng],ieng,offset,ioff)) |
| 1333 | 1329 | |
| ... | ... | @@ -1479,7 +1475,7 @@ class csroot2caldb(ctools.cscript): |
| 1479 | 1475 | # Log background infill |
| 1480 | 1476 | self._log_value(gammalib.NORMAL, |
| 1481 | 1477 | 'Background infill', |
| 1482 | - '%e cts/s/deg2 (E=%8.4f TeV (%d) ' | |
| 1478 | + '%e cts/(s deg**2) (E=%8.4f TeV (%d) ' | |
| 1483 | 1479 | 'Off=%.2f deg (%d)' % |
| 1484 | 1480 | (value,engs[ieng],ieng,offset,ioff)) |
| 1485 | 1481 | ... | ... |
test/data/irf_file.fits.gz
No preview for this file type