TemplateNDSpatialModel#
- class gammapy.modeling.models.TemplateNDSpatialModel[source]#
Bases:
SpatialModel
A model generated from a ND map where extra dimensions define the parameter space.
- Parameters:
- map
WcsNDMap
orHpxNDMap
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, “values_scale”: “log”}.- copy_databool
Create a deepcopy of the map data or directly use the original. Default is True. Use False to save memory in case of large maps.
- map
Attributes Summary
Methods Summary
evaluate
(lon, lat[, energy])from_dict
(data)Create a spatial model from a dictionary.
to_dict
([full_output])Create dictionary for YAML serialisation.
write
([overwrite, filename])Write the map.
Attributes Documentation
- default_parameters = <gammapy.modeling.parameter.Parameters object>#
- is_energy_dependent#
- tag = ['TemplateNDSpatialModel', 'templateND']#
Methods Documentation
- classmethod from_dict(data)[source]#
Create a spatial model from a dictionary.
- Parameters:
- datadict
Dictionary containing model parameters.
- kwargsdict
Keyword arguments passed to
from_parameters
.
- write(overwrite=False, filename=None)[source]#
Write the map.
- Parameters:
- overwritebool, 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
TemplateNDSpatialModel.filename
attribute. Iffilename
is provided, this attribute will be used.
- classmethod __new__(*args, **kwargs)#