CWTData¶
-
class
gammapy.detect.CWTData(counts, background, n_scale)[source]¶ Bases:
objectImages for CWT algorithm.
Contains also input counts and background.
Parameters: counts :
SkyImage2D counts image.
background :
SkyImage2D background image.
n_scale : int
Number of scales.
Examples
>>> from gammapy.image import SkyImage >>> from gammapy.detect import CWTData >>> filename = '$GAMMAPY_EXTRA/datasets/fermi_survey/all.fits.gz' >>> image = SkyImage.read(filename, hdu='COUNTS') >>> background = SkyImage.read(filename, hdu='BACKGROUND') >>> data = CWTData(counts=image, background=background, n_scale=2)
Attributes Summary
approx2D approx ??? image ( SkyImage).approx_bkg2D approx bkg image ( SkyImage).background2D background input image ( SkyImage).counts2D counts input image ( SkyImage).error3D error cube ( SkyCube).info_tableInformation about all the images and cubes. max_scale_imageMaximum scale image ( SkyImage).model2D model image ( SkyImage).model_plus_approxTODO: document what this is. residual2D residual image ( SkyImage).support_2d2D cube exclusion mask ( SkyCube).support_3d3D support (exclusion) cube ( SkyCube).transform_2d2D transform ??? image ( SkyImage).transform_3d3D transform ??? cube ( SkyCube).Methods Summary
cube_info(name[, per_scale])Compute cube info. cubes()All the cubes in a dict. image_info(name)Compute image info. images()All the images in a dict. write(filename[, overwrite])Save results to FITS file. Attributes Documentation
-
approx¶ 2D approx ??? image (
SkyImage).In the course of iterations updated by convolution of
counts - model - backgroundwithkern_approxPrimordial initialized by zero array.
-
approx_bkg¶ 2D approx bkg image (
SkyImage).In the course of iterations updated by convolution of
backgroundwithkern_approx. Primordial initialized by zero array.
-
error¶ 3D error cube (
SkyCube).Primordial initialized by zero array. In the course of iterations updated by convolution of
total_backgroundwith kernel^2 for each scale.
-
info_table¶ Information about all the images and cubes.
Returns: table :
TableInformation about the object.
-
model¶ 2D model image (
SkyImage).Positive version of transform_2d image. Primordial initialized by zero array.
-
model_plus_approx¶ TODO: document what this is.
-
transform_2d¶ 2D transform ??? image (
SkyImage).Created from transform_3d by summarize values per 0 axes. Primordial initialized by zero array.
-
transform_3d¶ 3D transform ??? cube (
SkyCube).Primordial initialized by zero array. In the course of iterations updated by convolution of
counts - total_backgroundwith kernel for each scale (total_background = model + background + approx).
Methods Documentation
-
cube_info(name, per_scale=False)[source]¶ Compute cube info.
Compute variance, mean, find max and min values and compute sum for image with given name. Return that information about the image.
Parameters: name : string
Name of the image. Name can be as one of the follow: {‘transform_3d’, ‘error’, ‘support’}
per_scale : boolean, optional (default False)
If True, return information about the cube per all the scales.
Returns: table :
TableInformation about the object.
-
cubes()[source]¶ All the cubes in a dict.
Returns: cubes :
OrderedDictDictionary with keys {‘transform_3d’, ‘error’, ‘support_3d’} and 3D
ndarraycubes as values.
-
image_info(name)[source]¶ Compute image info.
Compute variance, mean, find max and min values and compute sum for image with given name. Return that information about the image.
Parameters: name : string
Name of the image. Name can be as one of the follow: {‘counts’, ‘background’, ‘model’, ‘approx’, ‘approx_bkg’, ‘transform_2d’, ‘model_plus_approx’, ‘residual’, ‘maximal’, ‘support_2d’}
Returns: table :
TableInformation about the object.
-
images()[source]¶ All the images in a dict.
Returns: images :
OrderedDictDictionary with keys {‘counts’, ‘background’, ‘model’, ‘approx’, ‘approx_bkg’, ‘transform_2d’, ‘maximal’, ‘support_2d’} and 2D
ndarrayimages as values.
-