SkyDiffuseCube

class gammapy.modeling.models.SkyDiffuseCube(map, norm=1, tilt=0, reference='1 TeV', meta=None, interp_kwargs=None, name='diffuse', filename=None)[source]

Bases: gammapy.modeling.models.SkyModelBase

Cube sky map template model (3D).

This is for a 3D map with an energy axis. Use TemplateSpatialModel for 2D maps.

Parameters:
map : Map

Map template

norm : float

Norm parameter (multiplied with map values)

tilt : float

Additional tilt in the spectrum

reference : Quantity

Reference energy of the tilt.

meta : dict, optional

Meta information, meta[‘filename’] will be used for serialization

interp_kwargs : dict

Interpolation keyword arguments passed to gammapy.maps.Map.interp_by_coord. Default arguments are {‘interp’: ‘linear’, ‘fill_value’: 0}.

Attributes Summary

evaluation_radius Angle
frame
map
meta
norm
parameters Parameters (Parameters)
position SkyCoord
tag

Methods Summary

__call__(self, lon, lat, energy) Call self as a function.
copy(self) A shallow copy
create(tag, \*args, \*\*kwargs) Create a model instance.
evaluate(self, lon, lat, energy) Evaluate model.
evaluate_geom(self, geom)
from_dict(data)
read(filename, \*\*kwargs) Read map from FITS file.
to_dict(self)

Attributes Documentation

evaluation_radius

Angle

frame
map
meta
norm
parameters

Parameters (Parameters)

position

SkyCoord

tag = 'SkyDiffuseCube'

Methods Documentation

__call__(self, lon, lat, energy)

Call self as a function.

copy(self)[source]

A shallow copy

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

evaluate_geom(self, geom)
classmethod from_dict(data)[source]
classmethod read(filename, **kwargs)[source]

Read map from FITS file.

The default unit used if none is found in the file is cm-2 s-1 MeV-1 sr-1.

Parameters:
filename : str

FITS image filename.

to_dict(self)[source]