Commit 9862cebda1b6df5f2cbfc104f10f6a1c8833d93c
1 parent
8581bdb2
use r80 instead of r68 for background rate estimation
Showing
1 changed file
with
6 additions
and
5 deletions
scripts/cta_kb_bkgrates.py
| @@ -61,17 +61,18 @@ def make_file_function(irfname, filename): | @@ -61,17 +61,18 @@ def make_file_function(irfname, filename): | ||
| 61 | 61 | ||
| 62 | # Compute energy (in MeV) | 62 | # Compute energy (in MeV) |
| 63 | energy = math.pow(10.0, logE)*1.0e6 | 63 | energy = math.pow(10.0, logE)*1.0e6 |
| 64 | + emin = math.pow(10.0, logE-0.1)*1.0e6 | ||
| 65 | + emax = math.pow(10.0, logE+0.1)*1.0e6 | ||
| 66 | + ewidth = emax-emin | ||
| 64 | 67 | ||
| 65 | - # Compute solid angle of r68 region in sr | ||
| 66 | - omega = 2.0 * math.pi * (1.0 - math.cos(math.radians(r68))) | 68 | + # Compute solid angle of r80 region in sr |
| 69 | + omega = 2.0 * math.pi * (1.0 - math.cos(math.radians(r80))) | ||
| 67 | 70 | ||
| 68 | # Compute background rate per steradian and MeV | 71 | # Compute background rate per steradian and MeV |
| 69 | - bkg_rate = bgd/omega/energy | 72 | + bkg_rate = bgd/omega/ewidth |
| 70 | 73 | ||
| 71 | # Write | 74 | # Write |
| 72 | file.write(str(energy)+" "+str(bkg_rate)+"\n") | 75 | file.write(str(energy)+" "+str(bkg_rate)+"\n") |
| 73 | - | ||
| 74 | - print logE, energy, bgd, omega, bkg_rate | ||
| 75 | 76 | ||
| 76 | # Close files | 77 | # Close files |
| 77 | irf.close() | 78 | irf.close() |