Feature #599
Add spectral table model à la XSPEC
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | High | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.7.0 | |||
Duration: |
Description
The XSPEC package allows spectral models to be defined using a FITS table. Code should be added to GammaLib to support this format. This would then allow inclusion of XSPEC table models in GammaLib analyses.
See http://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_92_009/ogip_92_009.html for more information on XSPEC table models.
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen almost 12 years ago
- Description updated (diff)
#2 Updated by Knödlseder Jürgen almost 11 years ago
- Target version set to 2nd coding sprint
#3 Updated by Knödlseder Jürgen almost 11 years ago
- Target version deleted (
2nd coding sprint)
#4 Updated by Knödlseder Jürgen over 5 years ago
- Priority changed from Normal to High
- Target version set to 1.7.0
#5 Updated by Knödlseder Jürgen almost 5 years ago
- Status changed from New to In Progress
- Assigned To set to Knödlseder Jürgen
- % Done changed from 0 to 10
I added the classes GModelSpectralTablePar
and GModelSpectralTablePars
to handle table model parameters.
The class GModelSpectralTablePar
implements a structure that combines a model parameter GModelPar
with a list of values that represent the values at which the parameter is evaluated.
The class GModelSpectralTablePars
is a container class that combines the relevant parameters for a given table model.
#6 Updated by Knödlseder Jürgen almost 5 years ago
- % Done changed from 10 to 30
I started implementing a GModelSpectralTable
class that handles table model in the XSPEC format.
For the moment the class supports creating of table models, saving them into a FITS file and reloading the models from the FITS file.
#7 Updated by Knödlseder Jürgen over 4 years ago
- File test.py added
- File Normalization_100_50_50.png added
- File Index_100_50_50.png added
- File Cutoff_100_50_50.png added
- % Done changed from 30 to 80
I completed the implementation of the GModelSpectralTable
class. I did some tests using the following script: test.py. The script generates a table model using an exponentially cutoff power law. The script generates spectral vectors with 50 energy bins for the energy range 10 GeV - 300 TeV. The spectral index is varied between -1 and -3 with a step size of 0.02, the cutoff energy is varied from 0.1 TeV to 28 TeV using a logarithmic spacing. Note, however, that for the moment the parameters are interpolated linearly.
The script checks also the results of the flux
and eflux
methods:
Method | GModelSpectralExpPlaw | GModelSpectralTable |
flux() |
650290.728691 | 649713.700728 |
eflux() |
262858.068641 | 262396.532449 |
Finally, I created a pull distribution with 1000 trials for the table model, below the normalisation, index and cutoff pull histograms.
#8 Updated by Knödlseder Jürgen over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
Merged into devel
.