SkyModel

class gammapy.modeling.models.SkyModel(spectral_model, spatial_model=None, temporal_model=None, name=None, apply_irf=None, datasets_names=None)[source]

Bases: gammapy.modeling.models.core.Model

Sky model component.

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

Parameters
spectral_modelSpectralModel

Spectral model

spatial_modelSpatialModel

Spatial model (must be normalised to integrate to 1)

temporal_modeltemporalModel

Temporal model

namestr

Model identifier

apply_irfdict

Dictionary declaring which IRFs should be applied to this model. Options are {“exposure”: True, “psf”: True, “edisp”: True}

datasets_nameslist of str

Which datasets this model is applied to.

Attributes Summary

covariance

default_parameters

evaluation_radius

Angle

frame

name

parameters

Parameters (Parameters)

position

SkyCoord

spatial_model

SpatialModel

spectral_model

SpectralModel

tag

temporal_model

TemporalModel

Methods Summary

__call__(lon, lat, energy[, time])

Call self as a function.

copy([name])

Copy SkyModel

create(spectral_model[, spatial_model, …])

Create a model instance.

evaluate(lon, lat, energy[, time])

Evaluate the model at given points.

evaluate_geom(geom[, gti])

Evaluate model on Geom.

from_dict(data)

Create SkyModel from dict

from_parameters(parameters, **kwargs)

Create model from parameter list

integrate_geom(geom[, gti])

Integrate model on Geom.

to_dict([full_output])

Create dict for YAML serilisation

Attributes Documentation

covariance
default_parameters = <gammapy.modeling.parameter.Parameters object>
evaluation_radius

Angle

frame
name
parameters

Parameters (Parameters)

position

SkyCoord

spatial_model

SpatialModel

spectral_model

SpectralModel

tag = ['SkyModel', 'sky-model']
temporal_model

TemporalModel

Methods Documentation

__call__(lon, lat, energy, time=None)[source]

Call self as a function.

copy(name=None, **kwargs)[source]

Copy SkyModel

classmethod create(spectral_model, spatial_model=None, temporal_model=None, **kwargs)[source]

Create a model instance.

Parameters
spectral_modelstr

Tag to create spectral model

spatial_modelstr

Tag to create spatial model

temporal_modelstr

Tag to create temporal model

**kwargsdict

Keyword arguments passed to SkyModel

Returns
modelSkyModel

Sky model

evaluate(lon, lat, energy, time=None)[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, latQuantity

Spatial coordinates

energyQuantity

Energy coordinate

time: `~astropy.time.Time`

Time co-ordinate

Returns
valueQuantity

Model value at the given point.

evaluate_geom(geom, gti=None)[source]

Evaluate model on Geom.

classmethod from_dict(data)[source]

Create SkyModel from dict

classmethod from_parameters(parameters, **kwargs)

Create model from parameter list

Parameters
parametersParameters

Parameters for init

Returns
modelModel

Model instance

integrate_geom(geom, gti=None)[source]

Integrate model on Geom.

Parameters
geomGeom

Map geometry

gtiGTI

GIT table

Returns
fluxMap

Predicted flux map

to_dict(full_output=False)[source]

Create dict for YAML serilisation