TemplateNDSpectralModel#

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

Bases: SpectralModel

A model generated from a ND map where extra dimensions define the parameter space.

Parameters:
mapRegionNDMap

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}.

Attributes Summary

default_parameters

map

Template map as a RegionNDMap.

tag

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

evaluate(energy, **kwargs)[source]#
classmethod from_dict(data, **kwargs)[source]#
to_dict(full_output=False)[source]#

Create dictionary for YAML serilisation.

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. If filename is provided, this attribute will be used.

__init__(map, interp_kwargs=None, meta=None, filename=None)[source]#
classmethod __new__(*args, **kwargs)#