ParametricPSF#

class gammapy.irf.ParametricPSF[source]#

Bases: PSF

Parametric PSF base class.

Parameters:
axeslist of MapAxis or MapAxes

Axes.

datadict of ndarray or recarray

Data.

unitdict of str or Unit

Unit.

is_pointlikebool, optional

Whether the IRF is point-like. True for point-like IRFs, False for full-containment. Default is False.

fov_alignmentFoVAlignment, optional

The orientation of the field of view coordinate system. Default is FoVAlignment.RADEC.

metadict

Metadata dictionary.

Attributes Summary

quantity

Quantity.

required_parameters

unit

Map unit as a Unit.

Methods Summary

containment(rad, **kwargs)

Containment of the PSF at given axes coordinates.

evaluate(rad, **kwargs)

Evaluate the PSF model.

evaluate_containment(rad, **kwargs)

evaluate_direct(rad, **kwargs)

evaluate_parameters(energy_true, offset)

Evaluate analytic PSF parameters at a given energy and offset.

from_table(table[, format])

Create parametric PSF from Table.

is_allclose(other[, rtol_axes, atol_axes])

Compare two data IRFs for equivalency.

normalize()

Normalize parametric PSF.

to_psf3d([rad])

Create a PSF3D from a parametric PSF.

to_table([format])

Convert PSF table data to table.

to_unit(unit)

Convert IRF to unit.

Attributes Documentation

quantity#

Quantity.

required_parameters#
unit#

Map unit as a Unit.

Methods Documentation

containment(rad, **kwargs)[source]#

Containment of the PSF at given axes coordinates.

Parameters:
radQuantity

Rad value.

**kwargsdict

Other coordinates. You can view the available options through “psf.axes.names”.

Returns:
containmentndarray

Containment.

evaluate(rad, **kwargs)[source]#

Evaluate the PSF model.

Parameters:
radAngle

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

**kwargsdict

Other coordinates.

Returns:
psf_valueQuantity

PSF value.

abstractmethod evaluate_containment(rad, **kwargs)[source]#
abstractmethod evaluate_direct(rad, **kwargs)[source]#
evaluate_parameters(energy_true, offset)[source]#

Evaluate analytic PSF parameters at a given energy and offset.

Uses nearest-neighbor interpolation.

Parameters:
energy_trueQuantity

Energy value.

offsetAngle

Offset in the field of view.

Returns:
valuesQuantity

Interpolated value.

classmethod from_table(table, format='gadf-dl3')[source]#

Create parametric PSF from Table.

Parameters:
tableTable

Table information.

format{“gadf-dl3”}, optional

Format specification. Default is “gadf-dl3”.

Returns:
psfParametricPSF

PSF class.

is_allclose(other, rtol_axes=0.001, atol_axes=1e-06, **kwargs)[source]#

Compare two data IRFs for equivalency.

Parameters:
othergammapy.irfs.ParametricPSF

The PSF to compare against.

rtol_axesfloat, optional

Relative tolerance for the axis comparison. Default is 1e-3.

atol_axesfloat, optional

Relative tolerance for the axis comparison. Default is 1e-6.

**kwargsdict

Keywords passed to numpy.allclose.

Returns:
is_allclosebool

Whether the IRF is all close.

normalize()[source]#

Normalize parametric PSF.

to_psf3d(rad=None)[source]#

Create a PSF3D from a parametric PSF.

It will be defined on the same energy and offset values than the input PSF.

Parameters:
radQuantity

Rad values.

Returns:
psf3dPSF3D

3D PSF.

to_table(format='gadf-dl3')[source]#

Convert PSF table data to table.

Parameters:
format{“gadf-dl3”}

Format specification. Default is “gadf-dl3”.

Returns:
hdu_listHDUList

PSF in HDU list format.

to_unit(unit)[source]#

Convert IRF to unit.

__init__(axes, data=0, unit='', is_pointlike=False, fov_alignment=FoVAlignment.RADEC, meta=None, interp_kwargs=None)#
classmethod __new__(*args, **kwargs)#