PSFKing

class gammapy.irf.PSFKing(energy_lo, energy_hi, offset, gamma, sigma, energy_thresh_lo=<Quantity 0.1 TeV>, energy_thresh_hi=<Quantity 100. TeV>)[source]

Bases: object

King profile analytical PSF depending on energy and offset.

This PSF parametrisation and FITS data format is described here: PSF_KING.

Parameters
energy_loQuantity

Lower energy boundary of the energy bin.

energy_hiQuantity

Upper energy boundary of the energy bin.

offsetAngle

Offset nodes (1D)

gammandarray

PSF parameter (2D)

sigmaAngle

PSF parameter (2D)

Methods Summary

evaluate(self[, energy, offset])

Evaluate analytic PSF parameters at a given energy and offset.

evaluate_direct(r, gamma, sigma)

Evaluate the PSF model.

from_table(table)

Create PSFKing from Table.

info(self)

Print some basic info.

read(filename[, hdu])

Create PSFKing from FITS file.

to_energy_dependent_table_psf(self[, theta, …])

Convert to energy-dependent table PSF.

to_fits(self)

Convert PSF table data to FITS HDU list.

write(self, filename, \*args, \*\*kwargs)

Write PSF to FITS file.

Methods Documentation

evaluate(self, energy=None, offset=None)[source]

Evaluate analytic PSF parameters at a given energy and offset.

Uses nearest-neighbor interpolation.

Parameters
energyQuantity

energy value

offsetAngle

Offset in the field of view

Returns
valuesQuantity

Interpolated value

static evaluate_direct(r, gamma, sigma)[source]

Evaluate the PSF model.

Formula is given here: PSF_KING.

Parameters
rAngle

Offset from PSF center used for evaluating the PSF on a grid

gammaQuantity

model parameter, no unit

sigmaAngle

model parameter

Returns
psf_valueQuantity

PSF value

classmethod from_table(table)[source]

Create PSFKing from Table.

Parameters
tableTable

Table King PSF info.

info(self)[source]

Print some basic info.

classmethod read(filename, hdu=1)[source]

Create PSFKing from FITS file.

Parameters
filenamestr

File name

to_energy_dependent_table_psf(self, theta=None, rad=None, exposure=None)[source]

Convert to energy-dependent table PSF.

Parameters
thetaAngle

Offset in the field of view. Default theta = 0 deg

radAngle

Offset from PSF center used for evaluating the PSF on a grid. Default offset = [0, 0.005, …, 1.495, 1.5] deg.

exposureQuantity

Energy dependent exposure. Should be in units equivalent to ‘cm^2 s’. Default exposure = 1.

Returns
table_psfEnergyDependentTablePSF

Energy-dependent PSF

to_fits(self)[source]

Convert PSF table data to FITS HDU list.

Returns
hdu_listHDUList

PSF in HDU list format.

write(self, filename, *args, **kwargs)[source]

Write PSF to FITS file.

Calls writeto, forwarding all arguments.