Feature #3606
Add spectral bin function
Status: | Closed | Start date: | 04/13/2021 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 2.0.0 | |||
Duration: |
Description
Creating a spectrum in the COMPTEL standard energy bands excluding the 26Al band (1.7-1.9 MeV) the spectral node functions gives unreliable flux and error estimates. For spectral analysis it seems more appropriate to have a spectral bin function that defines a constant intensity within a given energy band.
A class GModelSpectralBins
should be added to implement this functionality. The formal of the model definition XML file should be as follows:
<spectrum type="BinFunction">
<bin>
<parameter scale="1.0" name="LowerLimit" min="0.1" max="1.0e20" value="0.75" free="0"/>
<parameter scale="1.0" name="UpperLimit" min="0.1" max="1.0e20" value="1.0" free="0"/>
<parameter scale="1e-07" name="Intensity" min="1e-07" max="1000.0" value="1.0" free="1"/>
</bin>
<bin>
<parameter scale="1.0" name="LowerLimit" min="0.1" max="1.0e20" value="1.0" free="0"/>
<parameter scale="1.0" name="UpperLimit" min="0.1" max="1.0e20" value="3.0" free="0"/>
<parameter scale="1e-07" name="Intensity" min="1e-07" max="1000.0" value="0.1" free="1"/>
</bin>
</spectrum>
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen almost 4 years ago
- Status changed from New to Pull request
- % Done changed from 0 to 90
I implemented the GModelSpectralBins
class, modelled on the GModelSpectralNodes
class, but now with statistically independent spectral bins. Within a bin, the spectrum follows a power law, with a spectral index that is the same for all bins. The value of the spectral index is added as an additional parameter to the XML file, as shown below:
<spectrum type="BinFunction">
<parameter name="Index" scale="-1" value="2.48" min="0.0" max="+5.0" free="0"/>
<bin>
<parameter scale="1.0" name="LowerLimit" min="0.1" max="1.0e20" value="0.75" free="0"/>
<parameter scale="1.0" name="UpperLimit" min="0.1" max="1.0e20" value="1.0" free="0"/>
<parameter scale="1e-07" name="Intensity" min="1e-07" max="1000.0" value="1.0" free="1"/>
</bin>
<bin>
<parameter scale="1.0" name="LowerLimit" min="0.1" max="1.0e20" value="1.0" free="0"/>
<parameter scale="1.0" name="UpperLimit" min="0.1" max="1.0e20" value="3.0" free="0"/>
<parameter scale="1e-07" name="Intensity" min="1e-07" max="1000.0" value="0.1" free="1"/>
</bin>
</spectrum>
I added unit tests to test the check the validity of the class.
#2 Updated by Knödlseder Jürgen almost 4 years ago
I also added GModelSpectralNodes::error(int&)
and GModelSpectralBins::error(int&)
method so that the intensity error can be accessed directly.
#3 Updated by Knödlseder Jürgen almost 4 years ago
- Status changed from Pull request to Closed
- % Done changed from 90 to 100
Merged into devel
.