FoVBackgroundModel#

class gammapy.modeling.models.FoVBackgroundModel(spectral_model=None, dataset_name=None)[source]#

Bases: gammapy.modeling.models.core.ModelBase

Field of view background model

The background model holds the correction parameters applied to the instrumental background attached to a MapDataset or SpectrumDataset.

Parameters
spectral_modelSpectralModel

Normalized spectral model.

dataset_namestr

Dataset name

Attributes Summary

covariance

default_parameters

frozen

Frozen status of a model, True if all parameters are frozen

name

Model name

parameters

Model parameters

spectral_model

Spectral norm model

tag

type

Methods Summary

contributes(*args, **kwargs)

FoV background models always contribute

copy(**kwargs)

evaluate(energy)

Evaluate model

evaluate_geom(geom)

Evaluate map

freeze([model_type])

Freeze model parameters

from_dict(data)

Create model from dict

from_parameters(parameters, **kwargs)

Create model from parameter list

reassign(datasets_names, new_datasets_names)

Reassign a model from one dataset to another

reset_to_default()

Reset parameter values to default

to_dict([full_output])

Create dict for YAML serialisation

unfreeze([model_type])

Restore parameters frozen status to default

Attributes Documentation

covariance#
default_parameters = <gammapy.modeling.parameter.Parameters object>#
frozen#

Frozen status of a model, True if all parameters are frozen

name#

Model name

parameters#

Model parameters

spectral_model#

Spectral norm model

tag = ['FoVBackgroundModel', 'fov-bkg']#
type#

Methods Documentation

static contributes(*args, **kwargs)[source]#

FoV background models always contribute

copy(**kwargs)#
evaluate(energy)[source]#

Evaluate model

evaluate_geom(geom)[source]#

Evaluate map

freeze(model_type='spectral')[source]#

Freeze model parameters

classmethod from_dict(data)[source]#

Create model from dict

Parameters
datadict

Data dictionary

classmethod from_parameters(parameters, **kwargs)#

Create model from parameter list

Parameters
parametersParameters

Parameters for init

Returns
modelModel

Model instance

reassign(datasets_names, new_datasets_names)#

Reassign a model from one dataset to another

Parameters
datasets_namesstr or list

Name of the datasets where the model is currently defined

new_datasets_namesstr or list

Name of the datasets where the model should be defined instead. If multiple names are given the two list must have the save length, as the reassignment is element-wise.

Returns
modelModel

Reassigned model.

reset_to_default()[source]#

Reset parameter values to default

to_dict(full_output=False)[source]#

Create dict for YAML serialisation

unfreeze(model_type='spectral')[source]#

Restore parameters frozen status to default