set_and_restore_mask_fit#

class gammapy.datasets.set_and_restore_mask_fit[source]#

Bases: object

Context manager to set a mask_fit on dataset and restore the initial mask.

Parameters:
datasetsdatasets

the Datasets to apply the energy mask to.

mask_fitMap, optional

New mask to apply. Default if None.

energy_minQuantity, optional

minimum energy.

energy_minQuantity, optional

maximum energy.

round_to_edge: bool, optional

Whether to round energy_min and energy_max to the closest axis bin value. See round. Default is False.

operator{np.logical_and, np.logical_or, None}, optional

Operator to apply between to existing dataset.mask_fit and the new one. Default is np.logical_and. If None the existing mask_fit is ignored.

__init__(datasets, mask_fit=None, energy_min=None, energy_max=None, round_to_edge=False, operator=<ufunc 'logical_and'>)[source]#
classmethod __new__(*args, **kwargs)#