Bug #3279
Broken power law flux is zero for energy boundary at break energy
| Status: | Closed | Start date: | 07/21/2020 | |
|---|---|---|---|---|
| Priority: | Urgent | Due date: | ||
| Assigned To: | % Done: | 100% | ||
| Category: | - | |||
| Target version: | 1.7.1 | |||
| Duration: |
Description
It turned out that for the model
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<source_library title="source library">
<source name="GammaCygni" type="DiffuseSource" tscalc="1">
<spectrum type="BrokenPowerLaw">
<parameter name="Prefactor" value="1.08949" error="0" scale="1e-15" min="1e-07" max="1000" free="1" />
<parameter name="Index1" value="2.05" scale="-1" min="0" max="5" free="0" />
<parameter name="Index2" value="2.79" error="0" scale="-1" min="0.01" max="1000" free="1" />
<parameter name="BreakEnergy" value="1" scale="100000" min="0.01" max="1000" free="0" />
</spectrum>
<spatialModel type="DiffuseMap" file="gammacygni_map.fits">
<parameter name="Normalization" value="1" scale="1" min="0.001" max="1000" free="0" />
</spatialModel>
</source>
</source_library>
the flux is zero when the break energy and the energy boundary are identical:
>>> print(m[0].spectral().flux(gammalib.GEnergy(0.1,'TeV'),gammalib.GEnergy(100.0,'TeV'))) 0.0 >>> print(m[0].spectral().flux(gammalib.GEnergy(0.09,'TeV'),gammalib.GEnergy(100.0,'TeV'))) 7.30030511938e-11 >>> print(m[0].spectral().flux(gammalib.GEnergy(0.0999,'TeV'),gammalib.GEnergy(100.0,'TeV'))) 6.09741642757e-11 >>> print(m[0].spectral().flux(gammalib.GEnergy(0.11,'TeV'),gammalib.GEnergy(100.0,'TeV'))) 5.13186370633e-11 >>> print(m[0].spectral().flux(gammalib.GEnergy(0.10,'TeV'),gammalib.GEnergy(100.0,'TeV'))) 0.0
Recurrence
No recurrence.
History
#1
Updated by Knödlseder Jürgen over 6 years ago
- Status changed from New to In Progress
Same is true for the energy flux.
#2
Updated by Knödlseder Jürgen over 6 years ago
- Status changed from In Progress to Pull request
- % Done changed from 0 to 100
The problem occured during an imcomplete coverage of all possible cases. This was fixed now.
#3
Updated by Knödlseder Jürgen over 6 years ago
- Status changed from Pull request to Closed