Feature #599

Add spectral table model à la XSPEC

Added by Knödlseder Jürgen about 12 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:HighDue 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.

test.py Magnifier (3.93 KB) Knödlseder Jürgen, 06/23/2020 04:18 PM

Normalization_100_50_50.png (42 KB) Knödlseder Jürgen, 06/23/2020 04:24 PM

Index_100_50_50.png (39.4 KB) Knödlseder Jürgen, 06/23/2020 04:24 PM

Cutoff_100_50_50.png (39.9 KB) Knödlseder Jürgen, 06/23/2020 04:24 PM

Normalization_100_50_50 Index_100_50_50 Cutoff_100_50_50

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 12 years ago

  • Description updated (diff)

#2 Updated by Knödlseder Jürgen about 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 about 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 about 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

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.

Also available in: Atom PDF