ImageProfile¶
-
class
gammapy.estimators.ImageProfile(table)[source]¶ Bases:
objectImage profile class.
The image profile data is stored in
Tableobject, with the following columns:x_refCoordinate bin center (required).x_minCoordinate bin minimum (optional).x_maxCoordinate bin maximum (optional).profileImage profile data (required).profile_errImage profile data error (optional).
- Parameters
- table
Table Table instance with the columns specified as above.
- table
Attributes Summary
Image profile quantity.
Image profile error quantity.
Max.
Min.
Reference x coordinates.
Methods Summary
normalize([mode])Normalize profile to peak value or integral.
peek([figsize])Show image profile and error.
plot([ax])Plot image profile.
plot_err([ax])Plot image profile error as band.
smooth([kernel, radius])Smooth profile with error propagation.
Attributes Documentation
-
profile¶ Image profile quantity.
-
profile_err¶ Image profile error quantity.
-
x_max¶ Max. x coordinates.
-
x_min¶ Min. x coordinates.
-
x_ref¶ Reference x coordinates.
Methods Documentation
-
normalize(mode='peak')[source]¶ Normalize profile to peak value or integral.
- Parameters
- mode[‘integral’, ‘peak’]
Normalize image profile so that it integrates to unity (‘integral’) or the maximum value corresponds to one (‘peak’).
- Returns
- profile
ImageProfile Normalized image profile.
- profile
-
peek(figsize=(8, 4.5), **kwargs)[source]¶ Show image profile and error.
- Parameters
- **kwargsdict
Keyword arguments passed to
ImageProfile.plot_profile()
- Returns
- ax
Axes Axes object
- ax
-
smooth(kernel='box', radius='0.1 deg', **kwargs)[source]¶ Smooth profile with error propagation.
Smoothing is described by a convolution:
\[x_j = \sum_i x_{(j - i)} h_i\]Where \(h_i\) are the coefficients of the convolution kernel.
The corresponding error on \(x_j\) is then estimated using Gaussian error propagation, neglecting correlations between the individual \(x_{(j - i)}\):
\[\Delta x_j = \sqrt{\sum_i \Delta x^{2}_{(j - i)} h^{2}_i}\]- Parameters
- kernel{‘gauss’, ‘box’}
Kernel shape
- radius
Quantity, str or float Smoothing width given as quantity or float. If a float is given it is interpreted as smoothing width in pixels. If an (angular) quantity is given it is converted to pixels using
xref[1] - x_ref[0].- kwargsdict
Keyword arguments passed to
uniform_filter(‘box’) andgaussian_filter(‘gauss’).
- Returns
- profile
ImageProfile Smoothed image profile.
- profile