set_and_restore_mask_fit#
- class gammapy.datasets.set_and_restore_mask_fit[source]#
Bases:
objectContext manager to set a
mask_fiton dataset and restore the initial mask.- Parameters:
- datasets
datasets the Datasets to apply the energy mask to.
- mask_fit
Map, optional New mask to apply. Default if None.
- energy_min
Quantity, optional minimum energy.
- energy_min
Quantity, optional maximum energy.
- round_to_edge: bool, optional
Whether to round
energy_minandenergy_maxto the closest axis bin value. Seeround. 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.
- datasets
- __init__(datasets, mask_fit=None, energy_min=None, energy_max=None, round_to_edge=False, operator=<ufunc 'logical_and'>)[source]#
- classmethod __new__(*args, **kwargs)#