Model#

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

Bases: object

Model class that contains only methods to create a model listed in the registries.

Methods Summary

create(tag[, model_type])

Create a model instance.

from_dict(data)

Create a model instance from a dictionary.

Methods Documentation

static create(tag, model_type=None, *args, **kwargs)[source]#

Create a model instance.

Examples

>>> from gammapy.modeling.models import Model
>>> spectral_model = Model.create(
...            "pl-2", model_type="spectral", amplitude="1e-10 cm-2 s-1", index=3
...        )
>>> type(spectral_model)
<class 'gammapy.modeling.models.spectral.PowerLaw2SpectralModel'>
static from_dict(data)[source]#

Create a model instance from a dictionary.