SafeMaskMaker

class gammapy.makers.SafeMaskMaker(methods=('aeff-default', ), aeff_percent=10, bias_percent=10, position=None, offset_max='3 deg')[source]

Bases: gammapy.makers.Maker

Make safe data range mask for a given observation.

Parameters
methods{“aeff-default”, “aeff-max”, “edisp-bias”, “offset-max”, “bkg-peak”}

Method to use for the safe energy range. Can be a list with a combination of those. Resulting masks are combined with logical and. “aeff-default” uses the energy ranged specified in the DL3 data files, if available.

aeff_percentfloat

Percentage of the maximal effective area to be used as lower energy threshold for method “aeff-max”.

bias_percentfloat

Percentage of the energy bias to be used as lower energy threshold for method “edisp-bias”

positionSkyCoord

Position at which the aeff_percent or bias_percent are computed. By default, it uses the position of the center of the map.

offset_maxstr or Quantity

Maximum offset cut.

Attributes Summary

available_methods

tag

Methods Summary

make_mask_energy_aeff_default(dataset, …)

Make safe energy mask from aeff default.

make_mask_energy_aeff_max(dataset)

Make safe energy mask from effective area maximum value.

make_mask_energy_bkg_peak(dataset)

Make safe energy mask based on the binned background.

make_mask_energy_edisp_bias(dataset)

Make safe energy mask from energy dispersion bias.

make_mask_offset_max(dataset, observation)

Make maximum offset mask.

run(dataset[, observation])

Make safe data range mask.

Attributes Documentation

available_methods = {'aeff-default', 'aeff-max', 'bkg-peak', 'edisp-bias', 'offset-max'}
tag = 'SafeMaskMaker'

Methods Documentation

static make_mask_energy_aeff_default(dataset, observation)[source]

Make safe energy mask from aeff default.

Parameters
datasetMapDataset or SpectrumDataset

Dataset to compute mask for.

observation: `~gammapy.data.Observation`

Observation to compute mask for.

Returns
mask_safendarray

Safe data range mask.

make_mask_energy_aeff_max(dataset)[source]

Make safe energy mask from effective area maximum value.

Parameters
datasetMapDataset or SpectrumDataset

Dataset to compute mask for.

Returns
mask_safendarray

Safe data range mask.

static make_mask_energy_bkg_peak(dataset)[source]

Make safe energy mask based on the binned background.

The energy threshold is defined as the upper edge of the energy bin with the highest predicted background rate. This method is motivated by its use in the HESS DL3 validation paper: https://arxiv.org/pdf/1910.08088.pdf

Parameters
datasetMapDataset or SpectrumDataset

Dataset to compute mask for.

Returns
mask_safendarray

Safe data range mask.

make_mask_energy_edisp_bias(dataset)[source]

Make safe energy mask from energy dispersion bias.

Parameters
datasetMapDataset or SpectrumDataset

Dataset to compute mask for.

Returns
mask_safendarray

Safe data range mask.

make_mask_offset_max(dataset, observation)[source]

Make maximum offset mask.

Parameters
datasetMapDataset or SpectrumDataset

Dataset to compute mask for.

observation: `~gammapy.data.Observation`

Observation to compute mask for.

Returns
mask_safendarray

Maximum offset mask.

run(dataset, observation=None)[source]

Make safe data range mask.

Parameters
datasetMapDataset or SpectrumDataset

Dataset to compute mask for.

observation: `~gammapy.data.Observation`

Observation to compute mask for.

Returns
datasetDataset

Dataset with defined safe range mask.