FoVBackgroundModel#

class gammapy.modeling.models.FoVBackgroundModel[source]#

Bases: 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:
dataset_namestr

Dataset name.

spectral_modelSpectralModel, Optional

Normalized spectral model. Default is PowerLawNormSpectralModel

spatial_modelSpatialModel, Optional

Unitless Spatial model (unit is dropped on evaluation if defined). Default is None.

covariance_datandarray, optional

Covariance data array. Default is None.

namestr, optional

Name of the created object. Default is None and the name is generated automatically.

Attributes Summary

default_parameters

name

Model name.

parameters

Model parameters.

parameters_unique_names

List of unique parameter names.

spatial_model

Spatial norm model.

spectral_model

Spectral norm model.

tag

Methods Summary

contributes(*args, **kwargs)

FoV background models always contribute.

copy([name, copy_data])

Copy the FoVBackgroundModel instance.

evaluate(energy[, lon, lat])

Evaluate model.

evaluate_geom(geom)

Evaluate map.

freeze([model_type])

Freeze model parameters.

from_dict(data, **kwargs)

Create model from dictionary.

reset_to_default()

Reset parameter values to default.

to_dict([full_output])

Create dictionary for YAML serialisation.

unfreeze([model_type])

Restore parameters frozen status to default.

Attributes Documentation

default_parameters = <gammapy.modeling.parameter.Parameters object>#
name#

Model name.

parameters#

Model parameters.

parameters_unique_names#

List of unique parameter names. Return formatted as par_type.par_name.

spatial_model#

Spatial norm model.

spectral_model#

Spectral norm model.

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

Methods Documentation

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

FoV background models always contribute.

copy(name=None, copy_data=False, **kwargs)[source]#

Copy the FoVBackgroundModel instance.

Parameters:
namestr, optional

Ignored, present for API compatibility. Default is None.

copy_databool, optional

Ignored, present for API compatibility. Default is False.

**kwargsdict

Keyword arguments forwarded to FoVBackgroundModel.

Returns:
modelFoVBackgroundModel

Copied FoV background model.

evaluate(energy, lon=None, lat=None)[source]#

Evaluate model.

evaluate_geom(geom)[source]#

Evaluate map.

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

Freeze model parameters.

classmethod from_dict(data, **kwargs)[source]#

Create model from dictionary.

Parameters:
datadict

Data dictionary.

reset_to_default()[source]#

Reset parameter values to default.

to_dict(full_output=False)[source]#

Create dictionary for YAML serialisation.

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

Restore parameters frozen status to default.

__init__(dataset_name, spectral_model=None, spatial_model=None, covariance_data=None, name=None)[source]#
classmethod __new__(*args, **kwargs)#