TemplateNDSpectralModel#
- class gammapy.modeling.models.TemplateNDSpectralModel[source]#
Bases:
SpectralModel
A model generated from a ND map where extra dimensions define the parameter space.
- Parameters:
- map
RegionNDMap
Map template.
- metadict, optional
Meta information, meta[‘filename’] will be used for serialisation.
- interp_kwargsdict
Interpolation keyword arguments passed to
gammapy.maps.Map.interp_by_pix
. Default arguments are {‘method’: ‘linear’, ‘fill_value’: 0}.
- map
Attributes Summary
Template map as a
RegionNDMap
.Methods Summary
evaluate
(energy, **kwargs)from_dict
(data, **kwargs)to_dict
([full_output])Create dictionary for YAML serilisation.
write
([overwrite, filename])Write the map.
Attributes Documentation
- default_parameters = <gammapy.modeling.parameter.Parameters object>#
- map#
Template map as a
RegionNDMap
.
- tag = ['TemplateNDSpectralModel', 'templateND']#
Methods Documentation
- write(overwrite=False, filename=None)[source]#
Write the map.
- Parameters:
- overwrite: bool, optional
Overwrite existing file. Default is False, which will raise a warning if the template file exists already.
- filenamestr, optional
Filename of the template model. By default, the template model will be saved with the
TemplateNDSpectralModel.filename
attribute. Iffilename
is provided, this attribute will be used.
- classmethod __new__(*args, **kwargs)#