PSF3D

class gammapy.irf.PSF3D(energy_lo, energy_hi, offset, rad_lo, rad_hi, psf_value, energy_thresh_lo=<Quantity 0.1 TeV>, energy_thresh_hi=<Quantity 100. TeV>, interp_kwargs=None)[source]

Bases: object

PSF with axes: energy, offset, rad.

Data format specification: PSF_TABLE

Parameters
energy_loQuantity

Energy bins lower edges (1-dim)

energy_hiQuantity

Energy bins upper edges (1-dim)

offsetAngle

Offset angle (1-dim)

rad_loAngle

Offset angle bins lower edges

rad_hiAngle

Offset angle bins upper edges

psf_valueQuantity

PSF (3-dim with axes: psf[rad_index, offset_index, energy_index]

energy_thresh_loQuantity

Lower energy threshold.

energy_thresh_hiQuantity

Upper energy threshold.

Methods Summary

containment_radius(self, energy[, theta, …])

Containment radius.

evaluate(self[, energy, offset, rad])

Interpolate PSF value at a given offset and energy.

from_table(table)

Create PSF3D from Table.

info(self)

Print some basic info.

peek(self[, figsize])

Quick-look summary plots.

plot_containment(self[, fraction, ax, …])

Plot containment image with energy and theta axes.

plot_containment_vs_energy(self[, …])

Plot containment fraction as a function of energy.

plot_psf_vs_rad(self[, theta, energy])

Plot PSF vs rad.

read(filename[, hdu])

Create PSF3D from FITS file.

to_energy_dependent_table_psf(self[, theta, …])

Convert PSF3D in EnergyDependentTablePSF.

to_fits(self)

Convert PSF table data to FITS HDU list.

to_table_psf(self, energy[, theta])

Create TablePSF at one given energy.

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

Write PSF to FITS file.

Methods Documentation

containment_radius(self, energy, theta='0 deg', fraction=0.68, interp_kwargs=None)[source]

Containment radius.

Parameters
energyQuantity

Energy

thetaAngle

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

fractionfloat

Containment fraction. Default fraction = 0.68

Returns
radiusQuantity

Containment radius in deg

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

Interpolate PSF value at a given offset and energy.

Parameters
energyQuantity

energy value

offsetAngle

Offset in the field of view

radAngle

Offset wrt source position

Returns
valuesQuantity

Interpolated value

classmethod from_table(table)[source]

Create PSF3D from Table.

Parameters
tableTable

Table Table-PSF info.

info(self)[source]

Print some basic info.

peek(self, figsize=(15, 5))[source]

Quick-look summary plots.

plot_containment(self, fraction=0.68, ax=None, show_safe_energy=False, add_cbar=True, **kwargs)[source]

Plot containment image with energy and theta axes.

Parameters
fractionfloat

Containment fraction between 0 and 1.

add_cbarbool

Add a colorbar

plot_containment_vs_energy(self, fractions=[0.68, 0.95], thetas=<Angle [0., 1.] deg>, ax=None)[source]

Plot containment fraction as a function of energy.

plot_psf_vs_rad(self, theta='0 deg', energy=<Quantity 1. TeV>)[source]

Plot PSF vs rad.

Parameters
energyQuantity

Energy. Default energy = 1 TeV

thetaAngle

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

classmethod read(filename, hdu='PSF_2D_TABLE')[source]

Create PSF3D from FITS file.

Parameters
filenamestr

File name

hdustr

HDU name

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

Convert PSF3D in EnergyDependentTablePSF.

Parameters
thetaAngle

Offset in the field of view

radAngle

Offset from PSF center used for evaluating the PSF on a grid. Default is the rad from this PSF.

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.

to_table_psf(self, energy, theta='0 deg', **kwargs)[source]

Create TablePSF at one given energy.

Parameters
energyQuantity

Energy

thetaAngle

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

Returns
psfTablePSF

Table PSF

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

Write PSF to FITS file.

Calls writeto, forwarding all arguments.