CWTData¶
-
class
gammapy.detect.
CWTData
(counts, background, n_scale)[source]¶ Bases:
object
Images for CWT algorithm.
Contains also input counts and background.
Parameters: Examples
>>> from gammapy.maps import Map >>> from gammapy.detect import CWTData >>> counts = Map.read("$GAMMAPY_DATA/fermi-3fhl-gc/fermi-3fhl-gc-counts.fits.gz") >>> background = Map.read("$GAMMAPY_DATA/fermi-3fhl-gc/fermi-3fhl-gc-background.fits.gz") >>> data = CWTData(counts=counts, background=background, n_scale=2)
Attributes Summary
approx
2D approx ??? image ( WcsNDMap
).approx_bkg
2D approx bkg image ( WcsNDMap
).background
2D background input image ( WcsNDMap
).counts
2D counts input image ( WcsNDMap
).error
3D error cube ( WcsNDMap
).info_table
Information about all the images and cubes. max_scale_image
Maximum scale image ( WcsNDMap
).model
2D model image ( WcsNDMap
).model_plus_approx
TODO: document what this is. residual
2D residual image ( WcsNDMap
).support_2d
2D cube exclusion mask ( WcsNDMap
).support_3d
3D support (exclusion) cube ( WcsNDMap
).transform_2d
2D transform ??? image ( WcsNDMap
).transform_3d
3D transform ??? cube ( WcsNDMap
).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 (
WcsNDMap
).In the course of iterations updated by convolution of
counts - model - background
withkern_approx
Primordial initialized by zero array.
-
approx_bkg
¶ 2D approx bkg image (
WcsNDMap
).In the course of iterations updated by convolution of
background
withkern_approx
. Primordial initialized by zero array.
-
error
¶ 3D error cube (
WcsNDMap
).Primordial initialized by zero array. In the course of iterations updated by convolution of
total_background
with kernel^2 for each scale.
-
info_table
¶ Information about all the images and cubes.
Returns: - table :
Table
Information about the object.
- table :
-
model
¶ 2D model image (
WcsNDMap
).Positive version of transform_2d image. Primordial initialized by zero array.
-
model_plus_approx
¶ TODO: document what this is.
-
transform_2d
¶ 2D transform ??? image (
WcsNDMap
).Created from transform_3d by summarize values per 0 axes. Primordial initialized by zero array.
-
transform_3d
¶ 3D transform ??? cube (
WcsNDMap
).Primordial initialized by zero array. In the course of iterations updated by convolution of
counts - total_background
with 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 :
Table
Information about the object.
-
cubes
()[source]¶ All the cubes in a dict.
Returns: - cubes : dict
Dictionary with keys {‘transform_3d’, ‘error’, ‘support_3d’} and 3D
ndarray
cubes 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 :
Table
Information about the object.
-