SkyModel

class gammapy.modeling.models.SkyModel(spatial_model, spectral_model, name='source')[source]

Bases: gammapy.modeling.models.SkyModelBase

Sky model component.

This model represents a factorised sky model. It has Parameters combining the spatial and spectral parameters.

TODO: add possibility to have a temporal model component also.

Parameters:
spatial_model : SpatialModel

Spatial model (must be normalised to integrate to 1)

spectral_model : SpectralModel

Spectral model

name : str

Model identifier

Attributes Summary

evaluation_radius Angle
frame
name
parameters Parameters (Parameters)
position SkyCoord
spatial_model SpatialModel
spectral_model SpectralModel
tag

Methods Summary

__call__(self, lon, lat, energy) Call self as a function.
copy(self, \*\*kwargs) Copy SkyModel
create(tag, \*args, \*\*kwargs) Create a model instance.
evaluate(self, lon, lat, energy) Evaluate the model at given points.
evaluate_geom(self, geom) Evaluate model on Geom.
from_dict(data) Create SkyModel from dict
to_dict(self) Create dict for YAML serilisation

Attributes Documentation

evaluation_radius

Angle

frame
name
parameters

Parameters (Parameters)

position

SkyCoord

spatial_model

SpatialModel

spectral_model

SpectralModel

tag = 'SkyModel'

Methods Documentation

__call__(self, lon, lat, energy)

Call self as a function.

copy(self, **kwargs)[source]

Copy SkyModel

static create(tag, *args, **kwargs)

Create a model instance.

Examples

>>> from gammapy.modeling import Model
>>> spectral_model = Model.create("PowerLaw2SpectralModel", amplitude="1e-10 cm-2 s-1", index=3)
>>> type(spectral_model)
gammapy.modeling.models.spectral.PowerLaw2SpectralModel
evaluate(self, lon, lat, energy)[source]

Evaluate the model at given points.

The model evaluation follows numpy broadcasting rules.

Return differential surface brightness cube. At the moment in units: cm-2 s-1 TeV-1 deg-2

Parameters:
lon, lat : Quantity

Spatial coordinates

energy : Quantity

Energy coordinate

Returns:
value : Quantity

Model value at the given point.

evaluate_geom(self, geom)[source]

Evaluate model on Geom.

classmethod from_dict(data)[source]

Create SkyModel from dict

to_dict(self)[source]

Create dict for YAML serilisation