ReflectedRegionsFinder

class gammapy.background.ReflectedRegionsFinder(region, center, angle_increment='0.1 rad', min_distance='0 rad', min_distance_input='0.1 rad', exclusion_mask=None)[source]

Bases: object

Find reflected regions.

This class is responsible for placing Reflected regions for a given input region and pointing position. It converts to pixel coordinates internally. At the moment it works only for circles. If you want to make a background estimate for an IACT observation using the reflected regions method, see also ReflectedRegionsBackgroundEstimator

Parameters:

region : CircleSkyRegion

Region to rotate

center : SkyCoord

Rotation point

angle_increment : Angle, optional

Rotation angle for each step

min_distance : Angle, optional

Minimal distance between to reflected regions

min_distance_input : Angle, optional

Minimal distance from input region

exclusion_mask : SkyImage, optional

Exclusion mask

Examples

>>> from astropy.coordinates import SkyCoord, Angle
>>> from regions import CircleSkyRegion
>>> from gammapy.background import ReflectedRegionsFinder
>>> pointing = SkyCoord(83.2, 22.7, unit='deg', frame='icrs')
>>> target_position = SkyCoord(80.2, 23.5, unit='deg', frame='icrs')
>>> theta = Angle(0.4, 'deg')
>>> on_region = CircleSkyRegion(target_position, theta)
>>> finder = ReflectedRegionsFinder(min_distance_input='1 rad', region=on_region, center=pointing))
>>> regions = finder.run()
>>> print(regions[0])
Region: CircleSkyRegion
center: <SkyCoord (Galactic): (l, b) in deg
    ( 184.9367087, -8.37920222)>
    radius: 0.400147197682 deg

Methods Summary

find_regions() Find reflected regions.
make_empty_mask(region, center) Create empty exclusion mask.
plot([fig, ax]) Standard debug plot.
run() Run all steps.
setup() Compute parameters for reflected regions algorithm.

Methods Documentation

find_regions()[source]

Find reflected regions.

static make_empty_mask(region, center)[source]

Create empty exclusion mask.

The size of the mask is chosen such that all reflected region are contained on the image.

Parameters:

region : CircleSkyRegion

Region to rotate

center : SkyCoord

Rotation point

plot(fig=None, ax=None)[source]

Standard debug plot.

See example here: :ref:’regions_reflected’.

run()[source]

Run all steps.

setup()[source]

Compute parameters for reflected regions algorithm.