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.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.

If a SkyModel is set on the input dataset and method is ‘fit’, it’ parameters are frozen during the fov normalization fit.

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

Parameters
methodstr in [‘fit’, ‘scale’]

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 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

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 geom

run(dataset[, observation])

Run FoV background maker.

Attributes Documentation

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

Method

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 geom

Parameters
datasetMapDataset

Input map dataset.

Returns
maskWcsNDMap

Projected exclusion mask

run(dataset, observation=None)[source]

Run FoV background maker.

Fit the background model norm

Parameters
datasetMapDataset

Input map dataset.