PSFKing

class gammapy.irf.PSFKing(energy_axis_true, offset_axis, 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_axis_trueMapAxis

True energy axis

offset_axisMapAxis

Offset axis

gammandarray

PSF parameter (2D)

sigmaAngle

PSF parameter (2D)

Attributes Summary

energy_axis_true

offset_axis

tag

Methods Summary

evaluate([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()

Print some basic info.

read(filename[, hdu])

Create PSFKing from FITS file.

to_energy_dependent_table_psf([theta, rad, …])

Convert to energy-dependent table PSF.

to_hdulist()

Convert PSF table data to FITS HDU list.

write(filename, *args, **kwargs)

Write PSF to FITS file.

Attributes Documentation

energy_axis_true
offset_axis
tag = 'psf_king'

Methods Documentation

evaluate(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()[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(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_hdulist()[source]

Convert PSF table data to FITS HDU list.

Returns
hdu_listHDUList

PSF in HDU list format.

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

Write PSF to FITS file.

Calls writeto, forwarding all arguments.