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
- methodstr in [‘fit’, ‘scale’]
the normalization method to be applied. Default ‘scale’.
- exclusion_mask
WcsNDMap
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
Method
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
- dataset
MapDataset
Input dataset.
- dataset
- Returns
- dataset
MapDataset
Map dataset with fitted background model
- dataset
- make_background_scale(dataset)[source]#
Fit the FoV background model on the dataset counts data
- Parameters
- dataset
MapDataset
Input dataset.
- dataset
- Returns
- dataset
MapDataset
Map dataset with scaled background model
- dataset
- make_default_fov_background_model(dataset)[source]#
Add fov background model to the model definition
- Parameters
- dataset
MapDataset
Input map dataset.
- dataset
- Returns
- dataset
MapDataset
Map dataset including background model
- dataset
- make_exclusion_mask(dataset)[source]#
Project input exclusion mask to dataset geom
- Parameters
- dataset
MapDataset
Input map dataset.
- dataset
- Returns
- mask
WcsNDMap
Projected exclusion mask
- mask
- run(dataset, observation=None)[source]#
Run FoV background maker.
- Parameters
- dataset
MapDataset
Input map dataset.
- dataset