FoVBackgroundModel#
- class gammapy.modeling.models.FoVBackgroundModel(dataset_name, spectral_model=None, spatial_model=None, covariance_data=None)[source]#
Bases:
ModelBase
Field of view background model.
The background model holds the correction parameters applied to the instrumental background attached to a
MapDataset
orSpectrumDataset
.- Parameters:
- dataset_namestr
Dataset name.
- spectral_model
SpectralModel
, Optional Normalized spectral model. Default is
PowerLawNormSpectralModel
- spatial_model
SpatialModel
, Optional Unitless Spatial model (unit is dropped on evaluation if defined). Default is None.
Attributes Summary
Frozen status of a model, True if all parameters are frozen.
Model name.
Model parameters.
List of unique parameter names.
Spatial norm model.
Spectral norm model.
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.
from_parameters
(parameters, **kwargs)Create model from parameter list.
reassign
(datasets_names, new_datasets_names)Reassign a model from one dataset to another.
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
- 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.
- 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']#
- type#
Methods Documentation
- 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:
- model
FoVBackgroundModel
Copied FoV background model.
- model
- classmethod from_dict(data, **kwargs)[source]#
Create model from dictionary.
- Parameters:
- datadict
Data dictionary.
- classmethod from_parameters(parameters, **kwargs)#
Create model from parameter list.
- Parameters:
- parameters
Parameters
Parameters for init.
- parameters
- Returns:
- model
Model
Model instance.
- model
- 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:
- model
Model
Reassigned model.
- model