FoVBackgroundMaker#

class gammapy.makers.FoVBackgroundMaker(method='scale', exclusion_mask=None, spectral_model='pl-norm', min_counts=0, min_npred_background=0, fit=None)[source]#

Bases: gammapy.makers.core.Maker

Normalize template background on the whole field-of-view.

The dataset background model can be simply scaled (method=”scale”) or fitted (method=”fit”) on the dataset counts.

The normalization is performed outside the exclusion mask that is passed on init. This also internally takes into account the dataset fit mask.

If a SkyModel is set on the input dataset its parameters are frozen during the FoV re-normalization.

If the requirement (greater than) of either min_counts or min_npred_background is not satisfied, the background will not be normalised.

Parameters
method{‘scale’, ‘fit’}

The normalization method to be applied. Default ‘scale’.

exclusion_maskWcsNDMap

Exclusion mask.

spectral_modelSpectralModel or str

Reference norm spectral model to use for the FoVBackgroundModel, if none is defined on the dataset. By default, use pl-norm.

min_countsint

Minimum number of counts, or residuals counts if a SkyModel is set, required outside the exclusion region.

min_npred_backgroundfloat

Minimum number of predicted background counts required outside the exclusion region.

Attributes Summary

available_methods

method

Method property.

tag

Methods Summary

make_background_fit(dataset)

Fit the FoV background model on the dataset counts data.

make_background_scale(dataset)

Fit the FoV background model on the dataset counts data.

make_default_fov_background_model(dataset)

Add FoV background model to the model definition.

make_exclusion_mask(dataset)

Project input exclusion mask to dataset geometry.

run(dataset[, observation])

Run FoV background maker.

Attributes Documentation

available_methods = ['fit', 'scale']#
method#

Method property.

tag = 'FoVBackgroundMaker'#

Methods Documentation

make_background_fit(dataset)[source]#

Fit the FoV background model on the dataset counts data.

Parameters
datasetMapDataset

Input dataset.

Returns
datasetMapDataset

Map dataset with fitted background model.

make_background_scale(dataset)[source]#

Fit the FoV background model on the dataset counts data.

Parameters
datasetMapDataset

Input dataset.

Returns
datasetMapDataset

Map dataset with scaled background model.

make_default_fov_background_model(dataset)[source]#

Add FoV background model to the model definition.

Parameters
datasetMapDataset

Input map dataset.

Returns
datasetMapDataset

Map dataset including background model.

make_exclusion_mask(dataset)[source]#

Project input exclusion mask to dataset geometry.

Parameters
datasetMapDataset

Input map dataset.

Returns
maskWcsNDMap

Projected exclusion mask.

run(dataset, observation=None)[source]#

Run FoV background maker.

Parameters
datasetMapDataset

Input map dataset.