IRFMap#
- class gammapy.irf.IRFMap(irf_map, exposure_map)[source]#
Bases:
object
IRF map base class for DL4 instrument response functions
Attributes Summary
Mask safe for the map
Methods Summary
copy
()Copy IRF map
cutout
(position, width[, mode])Cutout IRF map.
downsample
(factor[, axis_name, weights])Downsample the spatial dimension by a given factor.
from_hdulist
(hdulist[, hdu, hdu_bands, ...])Create from
HDUList
.read
(filename[, format, hdu])Read an IRF_map from file and create corresponding object"
slice_by_idx
(slices)Slice sub dataset.
stack
(other[, weights, nan_to_num])Stack IRF map with another one in place.
to_hdulist
([format])Convert to
HDUList
.to_region_nd_map
(region)Extract IRFMap in a given region or position
write
(filename[, overwrite, format])Write IRF map to fits
Attributes Documentation
- mask_safe_image#
Mask safe for the map
- required_axes#
- tag#
Methods Documentation
- cutout(position, width, mode='trim')[source]#
Cutout IRF map.
- Parameters
- Returns
- cutout
IRFMap
Cutout IRF map.
- cutout
- downsample(factor, axis_name=None, weights=None)[source]#
Downsample the spatial dimension by a given factor.
- classmethod from_hdulist(hdulist, hdu=None, hdu_bands=None, exposure_hdu=None, exposure_hdu_bands=None, format='gadf')[source]#
Create from
HDUList
.- Parameters
- hdulist
HDUList
HDU list.
- hdustr
Name or index of the HDU with the IRF map.
- hdu_bandsstr
Name or index of the HDU with the IRF map BANDS table.
- exposure_hdustr
Name or index of the HDU with the exposure map data.
- exposure_hdu_bandsstr
Name or index of the HDU with the exposure map BANDS table.
- format{“gadf”, “gtpsf”}
File format
- hdulist
- Returns
- irf_map
IRFMap
IRF map.
- irf_map
- classmethod read(filename, format='gadf', hdu=None)[source]#
Read an IRF_map from file and create corresponding object”
- Parameters
- filenamestr or
Path
File name
- format{“gadf”, “gtpsf”}
File format
- hdustr or int
HDU location
- filenamestr or
- Returns
- irf_map
PSFMap
,EDispMap
orEDispKernelMap
IRF map
- irf_map
- slice_by_idx(slices)[source]#
Slice sub dataset.
The slicing only applies to the maps that define the corresponding axes.
- to_hdulist(format='gadf')[source]#
Convert to
HDUList
.- Parameters
- format{“gadf”, “gtpsf”}
File format
- Returns
- hdu_list
HDUList
HDU list.
- hdu_list