AdaptiveRingBackgroundEstimator¶
-
class
gammapy.background.AdaptiveRingBackgroundEstimator(r_in, r_out_max, width, stepsize='0.02 deg', threshold_alpha=0.1, theta='0.22 deg', method='fixed_width')[source]¶ Bases:
objectAdaptive ring background algorithm.
This algorithm extends the
RingBackgroundEstimatormethod by adapting the size of the ring to achieve a minimum on / off exposure ratio (alpha) in regions where the area to estimate the background from is limited.Parameters: r_in :
QuantityInner radius of the ring.
r_out_max :
QuantityMaximal outer radius of the ring.
width :
QuantityWidth of the ring.
stepsize :
QuantityStepsize used for increasing the radius.
threshold_alpha : float
Threshold on alpha above which the adaptive ring takes action.
theta :
QuantityIntegration radius used for alpha computation.
method : {‘fixed_width’, ‘fixed_r_in’}
Adaptive ring method.
Examples
Example using
AdaptiveRingBackgroundEstimator:from gammapy.maps import Map from gammapy.background import AdaptiveRingBackgroundEstimator filename = '$GAMMAPY_EXTRA/test_datasets/unbundled/poisson_stats_image/input_all.fits.gz' images = { 'counts': Map.read(filename, hdu='counts'), 'exposure_on': Map.read(filename, hdu='exposure'), 'exclusion': Map.read(filename, hdu='exclusion'), } adaptive_ring_bkg = AdaptiveRingBackgroundEstimator( r_in='0.22 deg', r_out_max='0.8 deg', width='0.1 deg', ) results = adaptive_ring_bkg.run(images) results['background'].plot()
Attributes Summary
parametersParameter dict. Methods Summary
kernels(image)Ring kernels according to the specified method. run(images)Run adaptive ring background algorithm. Attributes Documentation
-
parameters¶ Parameter dict.
Methods Documentation
-
kernels(image)[source]¶ Ring kernels according to the specified method.
Parameters: image :
WcsNDMapMap specifying the WCS information.
Returns: kernels : list
List of
Ring2DKernel
-