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.0 TeV>)[source]¶ Bases:
object
PSF with axes: energy, offset, rad.
Data format specification: psf_table
Parameters: energy_lo :
Quantity
Energy bins lower edges (1-dim)
energy_hi :
Quantity
Energy bins upper edges (1-dim)
offset :
Angle
Offset angle (1-dim)
rad_lo :
Angle
Offset angle bins lower edges
rad_hi :
Angle
Offset angle bins upper edges
psf_value :
Quantity
PSF (3-dim with axes: psf[rad_index, offset_index, energy_index]
energy_thresh_lo :
Quantity
Lower energy threshold.
energy_thresh_hi :
Quantity
Upper energy threshold.
Methods Summary
containment_radius
(energy[, theta, ...])Containment radius. energy_logcenter
()Get logcenters of energy bins. evaluate
([energy, offset, rad, interp_kwargs])Interpolate the value of the EnergyOffsetArray
at a given offset and energy.from_table
(table)Create PSF3D
fromTable
.info
()Print some basic info. peek
([figsize])Quick-look summary plots. plot_containment
([fraction, ax, ...])Plot containment image with energy and theta axes. plot_containment_vs_energy
([fractions, ...])Plot containment fraction as a function of energy. plot_psf_vs_rad
([theta, energy])Plot PSF vs rad. rad_center
()Get centers of rad bins ( Angle
in deg).read
(filename[, hdu])Create PSF3D
from FITS file.to_energy_dependent_table_psf
([theta, exposure])Convert PSF3D in EnergyDependentTablePSF. to_fits
()Convert PSF table data to FITS HDU list. to_table_psf
(energy[, theta, interp_kwargs])Evaluate the EnergyOffsetArray
at one given energy.write
(filename, *args, **kwargs)Write PSF to FITS file. Methods Documentation
-
containment_radius
(energy, theta=None, fraction=0.68, interp_kwargs=None)[source]¶ Containment radius.
Parameters: energy :
Quantity
Energy
theta :
Angle
Offset in the field of view. Default theta = 0 deg
fraction : float
Containment fraction. Default fraction = 0.68
Returns: radius :
Quantity
Containment radius in deg
-
energy_logcenter
()[source]¶ Get logcenters of energy bins.
Returns: energies :
Quantity
Logcenters of energy bins
-
evaluate
(energy=None, offset=None, rad=None, interp_kwargs=None)[source]¶ Interpolate the value of the
EnergyOffsetArray
at a given offset and energy.Parameters: energy :
Quantity
energy value
offset :
Angle
Offset in the field of view
rad :
Angle
Offset wrt source position
interp_kwargs : dict
option for interpolation for
RegularGridInterpolator
Returns: values :
Quantity
Interpolated value
-
plot_containment
(fraction=0.68, ax=None, show_safe_energy=False, add_cbar=True, **kwargs)[source]¶ Plot containment image with energy and theta axes.
Parameters: fraction : float
Containment fraction between 0 and 1.
add_cbar : bool
Add a colorbar
-
plot_containment_vs_energy
(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
(theta=<Angle 0.0 deg>, energy=<Quantity 1.0 TeV>)[source]¶ Plot PSF vs rad.
Parameters: energy :
Quantity
Energy. Default energy = 1 TeV
theta :
Angle
Offset in the field of view. Default theta = 0 deg
-
classmethod
read
(filename, hdu='PSF_2D_TABLE')[source]¶ Create
PSF3D
from FITS file.Parameters: filename : str
File name
-
to_energy_dependent_table_psf
(theta=None, exposure=None)[source]¶ Convert PSF3D in EnergyDependentTablePSF.
Parameters: theta :
Angle
Offset in the field of view. Default theta = 0 deg
exposure :
Quantity
Energy dependent exposure. Should be in units equivalent to ‘cm^2 s’. Default exposure = 1.
Returns: table_psf :
EnergyDependentTablePSF
Energy-dependent PSF
-
to_fits
()[source]¶ Convert PSF table data to FITS HDU list.
Returns: hdu_list :
HDUList
PSF in HDU list format.
-
to_table_psf
(energy, theta=None, interp_kwargs=None, **kwargs)[source]¶ Evaluate the
EnergyOffsetArray
at one given energy.Parameters: energy :
Quantity
Energy
theta :
Angle
Offset in the field of view. Default theta = 0 deg
interp_kwargs : dict
Option for interpolation for
RegularGridInterpolator
Returns: table :
Table
Table with two columns: offset, value
-